Interface JavaExecutable

All Superinterfaces:
JavaAnnotatedElement, JavaGenericDeclaration, JavaMember, JavaModel, Serializable
All Known Subinterfaces:
JavaConstructor, JavaMethod
All Known Implementing Classes:
DefaultJavaConstructor, DefaultJavaExecutable, DefaultJavaMethod, JavaMethodDelegate

public interface JavaExecutable extends JavaAnnotatedElement, JavaGenericDeclaration, JavaMember
A shared interface for the common functionality of Method and Constructor.
Since:
2.0
See Also:
  • Method Details

    • getDeclaringClass

      JavaClass getDeclaringClass()
      Description copied from interface: JavaMember
      Specified by:
      getDeclaringClass in interface JavaMember
      Returns:
      the declaring class
    • getExceptions

      List<JavaClass> getExceptions()
      Returns:
      a list of Exceptions, never null
    • getExceptionTypes

      List<JavaType> getExceptionTypes()
    • getParameterByName

      JavaParameter getParameterByName(String name)
      Parameters:
      name - the name of the parameter
      Returns:
      the JavaParameter matching the name, otherwise null
    • getParameters

      List<JavaParameter> getParameters()
      Equivalent of Executable.getParameterTypes(), where a JavaParameter also contains the original name if available.
      Returns:
      a list of JavaParameters, never null
    • getParameterTypes

      List<JavaType> getParameterTypes()
      Returns:
      a list of JavaParameters, never null
      Since:
      1.12
    • getParameterTypes

      List<JavaType> getParameterTypes(boolean resolve)
      If a class inherits this method from a generic class or interface, you can use this method to get the resolved parameter types
      Parameters:
      resolve - true if the resolved types should be returned, otherwise false
      Returns:
      the parameter types
      Since:
      1.12
    • getSourceCode

      String getSourceCode()
      Get the original source code of the body of this method.
      Returns:
      Code as string.
    • isVarArgs

      boolean isVarArgs()
      Returns:
      true if the final parameter is a varArg, otherwise false
    • getCallSignature

      String getCallSignature()