Interface JavaExecutable
- All Superinterfaces:
JavaAnnotatedElement, JavaGenericDeclaration, JavaMember, JavaModel, Serializable
- All Known Subinterfaces:
JavaConstructor, JavaMethod
- All Known Implementing Classes:
DefaultJavaConstructor, DefaultJavaExecutable, DefaultJavaMethod, JavaMethodDelegate
A shared interface for the common functionality of Method and Constructor.
- Since:
- 2.0
- Author:
- Robert Scholte
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionEquivalent ofMember.getDeclaringClass()Equivalent ofExecutable.getExceptionTypes()getParameterByName(String name) Equivalent ofExecutable.getParameterTypes(), where a JavaParameter also contains the original name if available.Equivalent ofExecutable.getParameterTypes()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 typesGet the original source code of the body of this method.booleanEquivalent ofExecutable.isVarArgs()Methods inherited from interface JavaAnnotatedElement
getAnnotations, getComment, getNamedParameter, getTagByName, getTags, getTagsByNameMethods inherited from interface JavaGenericDeclaration
getTypeParametersMethods inherited from interface JavaMember
getModifiers, getName, isAbstract, isFinal, isNative, isPrivate, isProtected, isPublic, isStatic, isStrictfp, isSynchronized, isTransient, isVolatileMethods inherited from interface JavaModel
getCodeBlock, getLineNumber
-
Method Details
-
getDeclaringClass
JavaClass getDeclaringClass()Description copied from interface:JavaMemberEquivalent ofMember.getDeclaringClass()- Specified by:
getDeclaringClassin interfaceJavaMember- Returns:
- the declaring class
-
getExceptions
Equivalent ofExecutable.getExceptionTypes()- Returns:
- a list of Exceptions, never
null
-
getExceptionTypes
-
getParameterByName
- Parameters:
name- the name of the parameter- Returns:
- the
JavaParametermatching the name, otherwisenull
-
getParameters
List<JavaParameter> getParameters()Equivalent ofExecutable.getParameterTypes(), where a JavaParameter also contains the original name if available.- Returns:
- a list of JavaParameters, never
null
-
getParameterTypes
Equivalent ofExecutable.getParameterTypes()- Returns:
- a list of JavaParameters, never
null - Since:
- 1.12
-
getParameterTypes
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-trueif the resolved types should be returned, otherwisefalse- 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()Equivalent ofExecutable.isVarArgs()- Returns:
trueif the final parameter is a varArg, otherwisefalse
-
getCallSignature
String getCallSignature()
-