Interface MethodInfo

All Superinterfaces:
Info

public interface MethodInfo extends Info

Info object type representing a java method.

The name and qualified name of a method info object are different: The qualified name of a field includes the name of the class declaring the method.

  • Method Details

    • getDeclaringClass

      ClassInfo getDeclaringClass()

      Answer the info object of the class which declared this method.

      Returns:
      The info object of the class which declares this method.
    • getQualifiedName

      String getQualifiedName()

      Answer the qualified name of the receiver. For methods, the qualified name is the declaring class name plus '.' plus the method name.

      Qualified names provide unique IDs for packages, classes, methods, and methods. The names of annotations are the names of an annotation class, and are not unique.

      Specified by:
      getQualifiedName in interface Info
      Returns:
      The qualified name of the receiver.
    • getParameterTypeNames

      List<String> getParameterTypeNames()

      Answer the in-order names of the types of the parameters of this method. (Note: These are the parameter type names, not the parameter names.)

      Returns:
      The in-order names of the types of the parameters of this method. getParameterTypes()
    • getParameterTypes

      List<? extends ClassInfo> getParameterTypes()

      Answer the in-order types of the parameters of this method.

      Returns:
      The in-order types of the parameters of this method.
    • getExceptionTypeNames

      List<String> getExceptionTypeNames()

      Answer the set of names of the exceptions which may be thrown by this method.

      Returns:
      The names of the exceptions which may be thrown by this method, returned as a set. getExceptionTypes()
    • getExceptionTypes

      List<? extends ClassInfo> getExceptionTypes()

      Answer the class info objects of the exceptions which may be thrown by this method. (No order of the returned class info objects is guaranteed.)

      Returns:
      The class info objects of the exceptions which may be thrown by this method.
    • getReturnTypeName

      String getReturnTypeName()

      Answer the name of the return type of this method.

      For a non-primitive non-void return type, the java qualified class name of the return type is returned. For primitive types, a singleton string is returned, per the java descriptor of the return type:

      • void: V
      • boolean: Z
      • char: C
      • byte: B
      • short: S
      • int: I
      • float: F
      • long: J
      • double: D
      Returns:
      The name of the return type of this method.
    • getReturnType

      ClassInfo getReturnType()

      Answer the class info object of the return type of this method. Note that a non-null class info object is returned in all cases, including void. (void.class is a valid java class).

      Returns:
      The class info object of the return type of this method.
    • getSignature

      String getSignature()

      Answer a string encoding the signature of this method. This is a collation of the qualified name of the method, and of a parenthesized and comma delimited list of the types of the parameters of the method.

      For example: methodWithEmptyParameters(), methodWithTwoParameters(java.lang.String, myPackage.myClass).

      Returns:
      A string encoding the signature of this method.
    • getDescription

      String getDescription()
    • getParameterAnnotations

      List<List<? extends AnnotationInfo>> getParameterAnnotations()

      Answer the in-order parameter annotation collections of parameters of this method.

      Returns:
      The in-order parameter annotation collections of parameters of this method.
    • getAnnotationDefaultValue

      AnnotationValue getAnnotationDefaultValue()

      If this method is on an annotation interface, answer the default value of the method. If no default is defined, or if this method is not on an annotation interface, answer null.

      Returns:
      The default value of this method as an annotation attribute.