- java.lang.Object
-
- com.thoughtworks.qdox.model.impl.AbstractJavaModel
-
- com.thoughtworks.qdox.model.impl.AbstractBaseJavaEntity
-
- com.thoughtworks.qdox.model.impl.AbstractJavaEntity
-
- com.thoughtworks.qdox.model.impl.AbstractInheritableJavaEntity
-
- com.thoughtworks.qdox.model.impl.DefaultJavaExecutable
-
- All Implemented Interfaces:
JavaAnnotatedElement
,JavaExecutable
,JavaGenericDeclaration
,JavaMember
,JavaModel
,Serializable
- Direct Known Subclasses:
DefaultJavaConstructor
,DefaultJavaMethod
public abstract class DefaultJavaExecutable extends AbstractInheritableJavaEntity implements JavaExecutable
The BaseMethod contains all methods used by both JavaMethod and JavaConstructor- Author:
- Robert Scholte
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DefaultJavaExecutable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getCallSignature()
List<JavaClass>
getExceptions()
Equivalent ofExecutable.getExceptionTypes()
List<JavaType>
getExceptionTypes()
JavaParameter
getParameterByName(String name)
List<JavaParameter>
getParameters()
Equivalent ofExecutable.getParameterTypes()
, where a JavaParameter also contains the original name if available.List<JavaType>
getParameterTypes()
Equivalent ofExecutable.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 typesprotected JavaType
getReturns()
protected String
getSignature(boolean withModifiers, boolean isDeclaration)
String
getSourceCode()
Get the original source code of the body of this method.List<DocletTag>
getTagsByName(String name, boolean inherited)
boolean
isPublic()
Equivalent ofModifier.isPublic(int)
boolean
isVarArgs()
Equivalent ofExecutable.isVarArgs()
void
setExceptions(List<JavaClass> exceptions)
void
setParameters(List<JavaParameter> javaParameters)
void
setSourceCode(String sourceCode)
protected boolean
signatureMatches(List<JavaType> parameterTypes, boolean varArgs)
-
Methods inherited from class com.thoughtworks.qdox.model.impl.AbstractInheritableJavaEntity
getTagByName
-
Methods inherited from class com.thoughtworks.qdox.model.impl.AbstractJavaEntity
getDeclaringClass, getModifiers, getName, isAbstract, isFinal, isNative, isPrivate, isProtected, isStatic, isStrictfp, isSynchronized, isTransient, isVolatile, setDeclaringClass, setModifiers, setName
-
Methods inherited from class com.thoughtworks.qdox.model.impl.AbstractBaseJavaEntity
getAnnotations, getComment, getNamedParameter, getSource, getTagByName, getTags, getTagsByName, setAnnotations, setComment, setSource, setTags
-
Methods inherited from class com.thoughtworks.qdox.model.impl.AbstractJavaModel
getLineNumber, getModelWriter, setLineNumber, setModelWriterFactory
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.thoughtworks.qdox.model.JavaAnnotatedElement
getAnnotations, getComment, getNamedParameter, getTagByName, getTags, getTagsByName
-
Methods inherited from interface com.thoughtworks.qdox.model.JavaExecutable
getDeclaringClass
-
Methods inherited from interface com.thoughtworks.qdox.model.JavaGenericDeclaration
getTypeParameters
-
Methods inherited from interface com.thoughtworks.qdox.model.JavaMember
getModifiers, getName, isAbstract, isFinal, isNative, isPrivate, isProtected, isStatic, isStrictfp, isSynchronized, isTransient, isVolatile
-
Methods inherited from interface com.thoughtworks.qdox.model.JavaModel
getCodeBlock, getLineNumber
-
-
-
-
Method Detail
-
getParameters
public List<JavaParameter> getParameters()
Equivalent ofExecutable.getParameterTypes()
, where a JavaParameter also contains the original name if available.- Specified by:
getParameters
in interfaceJavaExecutable
- Returns:
- a list of JavaParameters, never
null
-
getParameterByName
public JavaParameter getParameterByName(String name)
- Specified by:
getParameterByName
in interfaceJavaExecutable
- Parameters:
name
- the name of the parameter- Returns:
- the
JavaParameter
matching the name, otherwisenull
-
getExceptions
public List<JavaClass> getExceptions()
Equivalent ofExecutable.getExceptionTypes()
- Specified by:
getExceptions
in interfaceJavaExecutable
- Returns:
- a list of Exceptions, never
null
-
getExceptionTypes
public List<JavaType> getExceptionTypes()
- Specified by:
getExceptionTypes
in interfaceJavaExecutable
-
isVarArgs
public boolean isVarArgs()
Equivalent ofExecutable.isVarArgs()
- Specified by:
isVarArgs
in interfaceJavaExecutable
- Returns:
true
if the final parameter is a varArg, otherwisefalse
-
setParameters
public void setParameters(List<JavaParameter> javaParameters)
-
signatureMatches
protected boolean signatureMatches(List<JavaType> parameterTypes, boolean varArgs)
-
isPublic
public boolean isPublic()
Equivalent ofModifier.isPublic(int)
- Specified by:
isPublic
in interfaceJavaMember
- Overrides:
isPublic
in classAbstractJavaEntity
- Returns:
true
if entity is public, otherwisefalse
-
getTagsByName
public List<DocletTag> getTagsByName(String name, boolean inherited)
- Specified by:
getTagsByName
in classAbstractInheritableJavaEntity
-
getParameterTypes
public List<JavaType> getParameterTypes()
Equivalent ofExecutable.getParameterTypes()
- Specified by:
getParameterTypes
in interfaceJavaExecutable
- Returns:
- a list of JavaParameters, never
null
-
getParameterTypes
public 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- Specified by:
getParameterTypes
in interfaceJavaExecutable
- Parameters:
resolve
-true
if the resolved types should be returned, otherwisefalse
- Returns:
- the parameter types
-
getSourceCode
public String getSourceCode()
Get the original source code of the body of this method.- Specified by:
getSourceCode
in interfaceJavaExecutable
- Returns:
- Code as string.
-
setSourceCode
public void setSourceCode(String sourceCode)
-
getCallSignature
public String getCallSignature()
- Specified by:
getCallSignature
in interfaceJavaExecutable
-
getReturns
protected JavaType getReturns()
-
getSignature
protected String getSignature(boolean withModifiers, boolean isDeclaration)
- Since:
- 1.3
-
-