Common Classes [Java]
A snippet of the code which will be used to demonstrate examples:
Common Classes and their use-cases
Method - Returns all the methods which are defined.
Common predicates of the Method
class:
hasQualifiedName() - Returns all the methods that belong to the specific class.
getCallee() - Returns all the calls the method makes:
getDeclaringType() - Gets the class where this method is declared:
MethodAccess - Returns all the methods which were invoked with a list of arguments.
Common predicates of the MethodAccess
class:
getMethod() - Cast the
MethodAccess
object of typeMethod
so the predicates listed above can be called.getCaller() - Returns all the locations (<- change this word) from where the method is called:
Last updated
Was this helpful?