jqassistant tool how query java method belongs to class

41 Views Asked by At

I am using a Java plugin and I am querying the calling link of a java method to find out which java class the method belongs to, how to query that, or which property identifier it belongs to.

For example, I want to know which Demo1 or Demo2 class the hello method belongs to and how to find it

class Demo1{

public void hello(){



}

}



class Demo2{

public void hello(){



}

}

How to query or use

1

There are 1 best solutions below

1
Dirk Mahler On

There is a DECLARES relation between a class member (i.e. :Field or :Method) and its enclosing type:

MATCH
  (t:Type)-[:DECLARES]->(m:Method)
WHERE
  m.name = 'hello'
RETURN
  t.fqn, m.signature