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
,java.io.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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<JavaClass>
exceptions
private java.util.List<JavaParameter>
parameters
private java.lang.String
sourceCode
private boolean
varArgs
-
Constructor Summary
Constructors Constructor Description DefaultJavaExecutable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getCallSignature()
java.util.List<JavaClass>
getExceptions()
Equivalent ofExecutable.getExceptionTypes()
java.util.List<JavaType>
getExceptionTypes()
JavaParameter
getParameterByName(java.lang.String name)
java.util.List<JavaParameter>
getParameters()
Equivalent ofExecutable.getParameterTypes()
, where a JavaParameter also contains the original name if available.java.util.List<JavaType>
getParameterTypes()
Equivalent ofExecutable.getParameterTypes()
java.util.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 java.lang.String
getSignature(boolean withModifiers, boolean isDeclaration)
java.lang.String
getSourceCode()
Get the original source code of the body of this method.java.util.List<DocletTag>
getTagsByName(java.lang.String name, boolean inherited)
boolean
isPublic()
Equivalent ofModifier.isPublic(int)
boolean
isVarArgs()
Equivalent ofExecutable.isVarArgs()
void
setExceptions(java.util.List<JavaClass> exceptions)
void
setParameters(java.util.List<JavaParameter> javaParameters)
void
setSourceCode(java.lang.String sourceCode)
protected boolean
signatureMatches(java.util.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 Detail
-
parameters
private java.util.List<JavaParameter> parameters
-
exceptions
private java.util.List<JavaClass> exceptions
-
varArgs
private boolean varArgs
-
sourceCode
private java.lang.String sourceCode
-
-
Method Detail
-
getParameters
public java.util.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(java.lang.String name)
- Specified by:
getParameterByName
in interfaceJavaExecutable
- Parameters:
name
- the name of the parameter- Returns:
- the
JavaParameter
matching the name, otherwisenull
-
getExceptions
public java.util.List<JavaClass> getExceptions()
Equivalent ofExecutable.getExceptionTypes()
- Specified by:
getExceptions
in interfaceJavaExecutable
- Returns:
- a list of Exceptions, never
null
-
getExceptionTypes
public java.util.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(java.util.List<JavaParameter> javaParameters)
-
setExceptions
public void setExceptions(java.util.List<JavaClass> exceptions)
-
signatureMatches
protected boolean signatureMatches(java.util.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 java.util.List<DocletTag> getTagsByName(java.lang.String name, boolean inherited)
- Specified by:
getTagsByName
in classAbstractInheritableJavaEntity
-
getParameterTypes
public java.util.List<JavaType> getParameterTypes()
Equivalent ofExecutable.getParameterTypes()
- Specified by:
getParameterTypes
in interfaceJavaExecutable
- Returns:
- a list of JavaParameters, never
null
-
getParameterTypes
public java.util.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 java.lang.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(java.lang.String sourceCode)
-
getCallSignature
public java.lang.String getCallSignature()
- Specified by:
getCallSignature
in interfaceJavaExecutable
-
getReturns
protected JavaType getReturns()
-
getSignature
protected java.lang.String getSignature(boolean withModifiers, boolean isDeclaration)
- Since:
- 1.3
-
-