Package com.thoughtworks.qdox.model.impl
Class DefaultJavaExecutable
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
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionEquivalent 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 typesprotected JavaType
protected String
getSignature
(boolean withModifiers, boolean isDeclaration) Get the original source code of the body of this method.getTagsByName
(String name, boolean inherited) boolean
isPublic()
Equivalent ofModifier.isPublic(int)
boolean
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
-
Field Details
-
parameters
-
exceptions
-
varArgs
private boolean varArgs -
sourceCode
-
-
Constructor Details
-
DefaultJavaExecutable
public DefaultJavaExecutable()
-
-
Method Details
-
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
- Specified by:
getParameterByName
in interfaceJavaExecutable
- Parameters:
name
- the name of the parameter- Returns:
- the
JavaParameter
matching the name, otherwisenull
-
getExceptions
Equivalent ofExecutable.getExceptionTypes()
- Specified by:
getExceptions
in interfaceJavaExecutable
- Returns:
- a list of Exceptions, never
null
-
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
-
setExceptions
-
signatureMatches
-
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
- Specified by:
getTagsByName
in classAbstractInheritableJavaEntity
-
getParameterTypes
Equivalent ofExecutable.getParameterTypes()
- Specified by:
getParameterTypes
in interfaceJavaExecutable
- Returns:
- a list of JavaParameters, never
null
-
getParameterTypes
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
Get the original source code of the body of this method.- Specified by:
getSourceCode
in interfaceJavaExecutable
- Returns:
- Code as string.
-
setSourceCode
-
getCallSignature
- Specified by:
getCallSignature
in interfaceJavaExecutable
-
getReturns
-
getSignature
- Since:
- 1.3
-