com.thoughtworks.qdox.model

Class JavaMethod

Implemented Interfaces:
Comparable, Member, Serializable

public class JavaMethod
extends AbstractInheritableJavaEntity
implements Member

Field Summary

private boolean
constructor
private Type[]
exceptions
private JavaParameter[]
parameters
private Type
returns
private String
sourceCode

Fields inherited from class com.thoughtworks.qdox.model.AbstractJavaEntity

comment, lineNumber, modifiers, name, parent, tags

Constructor Summary

JavaMethod()
JavaMethod(String name)
JavaMethod(Type returns, String name)

Method Summary

int
compareTo(Object o)
boolean
equals(Object obj)
String
getCallSignature()
String
getDeclarationSignature(boolean withModifiers)
Type[]
getExceptions()
JavaParameter
getParameterByName(String name)
JavaParameter[]
getParameters()
JavaClass
getParentClass()
String
getPropertyName()
Type
getPropertyType()
Type
getReturns()
private String
getSignature(boolean withModifiers, boolean isDeclaration)
String
getSourceCode()
Get the original source code of the body of this method.
DocletTag[]
getTagsByName(String name, boolean inherited)
int
hashCode()
boolean
isConstructor()
boolean
isPropertyAccessor()
boolean
isPropertyMutator()
boolean
isPublic()
void
setConstructor(boolean constructor)
void
setExceptions(Type[] exceptions)
void
setParameters(JavaParameter[] parameters)
void
setParentClass(JavaClass parentClass)
void
setReturns(Type returns)
void
setSourceCode(String sourceCode)
boolean
signatureMatches(String name, Type[] parameterTypes)
protected void
writeBody(IndentBuffer result)
protected void
writeBody(IndentBuffer result, boolean withModifiers, boolean isDeclaration, boolean isPrettyPrint)

Methods inherited from class com.thoughtworks.qdox.model.AbstractInheritableJavaEntity

getTagByName, getTagsByName

Methods inherited from class com.thoughtworks.qdox.model.AbstractJavaEntity

commentHeader, getComment, getLineNumber, getModifiers, getName, getNamedParameter, getParent, getSource, getTagByName, getTags, getTagsByName, isAbstract, isFinal, isModifierPresent, isNative, isPrivate, isProtected, isPublic, isStatic, isStrictfp, isSynchronized, isTransient, isVolatile, setComment, setLineNumber, setModifiers, setName, setParent, setTags, toString, write, writeAccessibilityModifier, writeAllModifiers, writeBody, writeNonAccessibilityModifiers

Field Details

constructor

private boolean constructor

exceptions

private Type[] exceptions

parameters

private JavaParameter[] parameters

returns

private Type returns

sourceCode

private String sourceCode

Constructor Details

JavaMethod

public JavaMethod()

JavaMethod

public JavaMethod(String name)

JavaMethod

public JavaMethod(Type returns,
                  String name)

Method Details

compareTo

public int compareTo(Object o)

equals

public boolean equals(Object obj)

getCallSignature

public String getCallSignature()
Specified by:
getCallSignature in interface Member
Since:
1.3

getDeclarationSignature

public String getDeclarationSignature(boolean withModifiers)
Specified by:
getDeclarationSignature in interface Member
Since:
1.3

getExceptions

public Type[] getExceptions()

getParameterByName

public JavaParameter getParameterByName(String name)

getParameters

public JavaParameter[] getParameters()

getParentClass

public JavaClass getParentClass()

getPropertyName

public String getPropertyName()
Returns:
the name of the property this method represents, or null if this method is not a property mutator or property accessor.
Since:
1.3

getPropertyType

public Type getPropertyType()
Returns:
the type of the property this method represents, or null if this method is not a property mutator or property accessor.
Since:
1.3

getReturns

public Type getReturns()

getSignature

private String getSignature(boolean withModifiers,
                            boolean isDeclaration)
Since:
1.3

getSourceCode

public String getSourceCode()
Get the original source code of the body of this method.
Returns:
Code as string.

getTagsByName

public DocletTag[] getTagsByName(String name,
                                 boolean inherited)
Overrides:
getTagsByName in interface AbstractInheritableJavaEntity

hashCode

public int hashCode()

isConstructor

public boolean isConstructor()

isPropertyAccessor

public boolean isPropertyAccessor()
Returns:
true if this method is a Java Bean accessor
Since:
1.3

isPropertyMutator

public boolean isPropertyMutator()
Returns:
true if this method is a Java Bean accessor
Since:
1.3

isPublic

public boolean isPublic()
Overrides:
isPublic in interface AbstractJavaEntity

setConstructor

public void setConstructor(boolean constructor)

setExceptions

public void setExceptions(Type[] exceptions)

setParameters

public void setParameters(JavaParameter[] parameters)

setParentClass

public void setParentClass(JavaClass parentClass)

setReturns

public void setReturns(Type returns)

setSourceCode

public void setSourceCode(String sourceCode)

signatureMatches

public boolean signatureMatches(String name,
                                Type[] parameterTypes)
Parameters:
name - method name
parameterTypes - parameter types or null if there are no parameters.
Returns:
true if the signature and parameters match.

writeBody

protected void writeBody(IndentBuffer result)
Overrides:
writeBody in interface AbstractJavaEntity

writeBody

protected void writeBody(IndentBuffer result,
                         boolean withModifiers,
                         boolean isDeclaration,
                         boolean isPrettyPrint)
Since:
1.3