Skip to content
jordanell edited this page May 18, 2012 · 4 revisions

The Method class is a representational class that holds information regarding a method inside of a Java application.

Method Contains

  • The name of the method. This is a fully qualified name including package, class, method name and variable types (Ex. package.A.foo(int, Bar), where package is the package the method resides in, A is the class the method is declared in, foo is the method name and int and Bar are the parameter types.)
  • The Clazz it is defined in. This is a reference to the Clazz object the method is declared in.
  • The starting character. This is the character number inside the file where the method starts.
  • The ending character. This is the character number inside the file where the method ends.
  • The return type. This is simply a String holding the return type of the method. This can be void.
  • A list of methods called. This is a list of references to other methods which this method calls.
  • A list of methods that call this method.
  • A list of "fuzzy" method calls. These method calls are not ganrunteed to be 100% accurate and are just general guesses of functions that may be called. This is causes due to checks that are only possible at run time of a program.
  • A list of "fuzzy" methods that call this method. In the same accordance of fuzzy method calls, this is just a guess as to some methods that may call the current method.
  • The ASTNode. The node for the starting point of the method declaration.

  • A list of unresolved method calls. When the resolving phase fails to resolve a method call, the String of that potential method call is placed in this list.

Method Does Not Contain

  • A list of variables. No variables that are declared anywhere inside this function are stored.
  • Logic. The logic or control of the method is not stored. (Ex. for or while loops, if statements or switch statements.)

Clone this wiki locally