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>exceptionsprivate java.util.List<JavaParameter>parametersprivate java.lang.StringsourceCodeprivate booleanvarArgs
-
Constructor Summary
Constructors Constructor Description DefaultJavaExecutable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetCallSignature()java.util.List<JavaClass>getExceptions()Equivalent ofExecutable.getExceptionTypes()java.util.List<JavaType>getExceptionTypes()JavaParametergetParameterByName(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 JavaTypegetReturns()protected java.lang.StringgetSignature(boolean withModifiers, boolean isDeclaration)java.lang.StringgetSourceCode()Get the original source code of the body of this method.java.util.List<DocletTag>getTagsByName(java.lang.String name, boolean inherited)booleanisPublic()Equivalent ofModifier.isPublic(int)booleanisVarArgs()Equivalent ofExecutable.isVarArgs()voidsetExceptions(java.util.List<JavaClass> exceptions)voidsetParameters(java.util.List<JavaParameter> javaParameters)voidsetSourceCode(java.lang.String sourceCode)protected booleansignatureMatches(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:
getParametersin interfaceJavaExecutable- Returns:
- a list of JavaParameters, never
null
-
getParameterByName
public JavaParameter getParameterByName(java.lang.String name)
- Specified by:
getParameterByNamein interfaceJavaExecutable- Parameters:
name- the name of the parameter- Returns:
- the
JavaParametermatching the name, otherwisenull
-
getExceptions
public java.util.List<JavaClass> getExceptions()
Equivalent ofExecutable.getExceptionTypes()- Specified by:
getExceptionsin interfaceJavaExecutable- Returns:
- a list of Exceptions, never
null
-
getExceptionTypes
public java.util.List<JavaType> getExceptionTypes()
- Specified by:
getExceptionTypesin interfaceJavaExecutable
-
isVarArgs
public boolean isVarArgs()
Equivalent ofExecutable.isVarArgs()- Specified by:
isVarArgsin interfaceJavaExecutable- Returns:
trueif 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:
isPublicin interfaceJavaMember- Overrides:
isPublicin classAbstractJavaEntity- Returns:
trueif entity is public, otherwisefalse
-
getTagsByName
public java.util.List<DocletTag> getTagsByName(java.lang.String name, boolean inherited)
- Specified by:
getTagsByNamein classAbstractInheritableJavaEntity
-
getParameterTypes
public java.util.List<JavaType> getParameterTypes()
Equivalent ofExecutable.getParameterTypes()- Specified by:
getParameterTypesin 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:
getParameterTypesin interfaceJavaExecutable- Parameters:
resolve-trueif 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:
getSourceCodein interfaceJavaExecutable- Returns:
- Code as string.
-
setSourceCode
public void setSourceCode(java.lang.String sourceCode)
-
getCallSignature
public java.lang.String getCallSignature()
- Specified by:
getCallSignaturein interfaceJavaExecutable
-
getReturns
protected JavaType getReturns()
-
getSignature
protected java.lang.String getSignature(boolean withModifiers, boolean isDeclaration)- Since:
- 1.3
-
-