xjavadoc
Class MethodImpl

java.lang.Object
  extended by xjavadoc.AbstractProgramElement
      extended by xjavadoc.MemberImpl
          extended by xjavadoc.AbstractExecutableMember
              extended by xjavadoc.MethodImpl
All Implemented Interfaces:
java.lang.Comparable, Named, XExecutableMember, XMember, XMethod, XProgramElement

final class MethodImpl
extends AbstractExecutableMember
implements XMethod

Describe what this class does

Author:
Aslak Helles�y

Nested Class Summary
 
Nested classes/interfaces inherited from interface xjavadoc.XMethod
XMethod.PropertyAccessorPredicate, XMethod.PropertyMutatorPredicate
 
Field Summary
private  ReturnType _returnType
           
static int instanceCount
           
private  java.lang.String methodNameWithSignatureAndModifiers
           
private  java.lang.String methodNameWithSignatureWithoutModifiers
           
 
Fields inherited from class xjavadoc.AbstractProgramElement
EMPTY_LIST
 
Fields inherited from interface xjavadoc.XMethod
PROPERTY_ACCESSOR_PREDICATE, PROPERTY_MUTATOR_PREDICATE
 
Constructor Summary
MethodImpl(AbstractClass containingClass, XTagFactory tagFactory)
           
 
Method Summary
protected  java.lang.String buildStringId()
           
 boolean equals(java.lang.Object o)
          Two methods are equal if they have the same return type, name and signature, regardless of the enclosing class and modifiers.
 XMethod getAccessor()
          If this method is a mutator, and a corresponding accessor exists, that accessor will be returned.
private  java.lang.String getMethodNameWithSignatureAndModifiers()
           
private  java.lang.String getMethodNameWithSignatureWithoutModifiers()
           
 XMethod getMutator()
          If this method is an accessor, and a corresponding mutator exists, that mutator will be returned.
 java.lang.String getNameWithoutPrefix()
          Returns the name of the method with the prefix stripped away.
 java.lang.String getPropertyName()
          Returns the property name of this method (if it is an accessor or mutator), or null if it is not.
 Type getPropertyType()
          Returns the type of the property this method represents, or null if this method is not a property method.
 Type getReturnType()
          Returns the return type of the method.
 XProgramElement getSuperElement()
           
 java.util.List getSuperInterfaceElements()
           
 int hashCode()
           
 boolean isConstructor()
          Gets the Constructor attribute of the SourceMethod object
 boolean isPropertyAccessor()
           
 boolean isPropertyMutator()
           
 void setReturnDimension(int d)
          Sets the ReturnDimension attribute of the SourceMethod object
 void setReturnType(java.lang.String returnType)
          Sets the ReturnType attribute of the SourceMethod object
 java.lang.String toString()
           
private  java.lang.String toString(boolean modifiers)
          Builds a String uniquely describing this method
 
Methods inherited from class xjavadoc.AbstractExecutableMember
addParameterData, addThrownException, getNameWithSignature, getParameterDimension, getParameterName, getParameters, getParameterType, getParameterTypes, getSignature, getSuperElement, getThrownExceptions, isNative, isSynchronized, throwsException
 
Methods inherited from class xjavadoc.MemberImpl
getName, setName
 
Methods inherited from class xjavadoc.AbstractProgramElement
addModifier, compareTo, getContainingAbstractClass, getContainingClass, getContainingPackage, getDoc, getModifiers, getModifierSpecifier, getTagFactory, getXJavaDoc, isAbstract, isFinal, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, reset, setToken, updateDoc
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface xjavadoc.XExecutableMember
getNameWithSignature, getParameters, getParameterTypes, getSignature, getThrownExceptions, isNative, isSynchronized, throwsException
 
Methods inherited from interface xjavadoc.XProgramElement
getContainingClass, getContainingPackage, getDoc, getModifiers, getModifierSpecifier, getXJavaDoc, isAbstract, isFinal, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, updateDoc
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface xjavadoc.Named
getName
 

Field Detail

instanceCount

public static int instanceCount

methodNameWithSignatureAndModifiers

private java.lang.String methodNameWithSignatureAndModifiers

methodNameWithSignatureWithoutModifiers

private java.lang.String methodNameWithSignatureWithoutModifiers

_returnType

private ReturnType _returnType
Constructor Detail

MethodImpl

public MethodImpl(AbstractClass containingClass,
                  XTagFactory tagFactory)
Method Detail

isConstructor

public final boolean isConstructor()
Gets the Constructor attribute of the SourceMethod object

Specified by:
isConstructor in interface XExecutableMember
Returns:
The Constructor value

getReturnType

public final Type getReturnType()
Description copied from interface: XMethod
Returns the return type of the method.

Specified by:
getReturnType in interface XMethod
Returns:
the return type of the method.

getSuperElement

public XProgramElement getSuperElement()
Specified by:
getSuperElement in interface XProgramElement

getSuperInterfaceElements

public java.util.List getSuperInterfaceElements()
Specified by:
getSuperInterfaceElements in interface XProgramElement
Overrides:
getSuperInterfaceElements in class MemberImpl

getAccessor

public XMethod getAccessor()
Description copied from interface: XMethod
If this method is a mutator, and a corresponding accessor exists, that accessor will be returned. Otherwise, null is returned.

Specified by:
getAccessor in interface XMethod
Returns:
the corresponding accessor.

getMutator

public XMethod getMutator()
Description copied from interface: XMethod
If this method is an accessor, and a corresponding mutator exists, that mutator will be returned. Otherwise, null is returned.

Specified by:
getMutator in interface XMethod
Returns:
the corresponding mutator.

isPropertyAccessor

public boolean isPropertyAccessor()
Specified by:
isPropertyAccessor in interface XMethod
Returns:
true if this is a public Xxx getXxx() method

isPropertyMutator

public boolean isPropertyMutator()
Specified by:
isPropertyMutator in interface XMethod
Returns:
true if this is a public void setXxx(Xxx) method

getPropertyName

public java.lang.String getPropertyName()
Description copied from interface: XMethod
Returns the property name of this method (if it is an accessor or mutator), or null if it is not.

Specified by:
getPropertyName in interface XMethod
Returns:
the property name.

getPropertyType

public Type getPropertyType()
Description copied from interface: XMethod
Returns the type of the property this method represents, or null if this method is not a property method.

Specified by:
getPropertyType in interface XMethod
Returns:
the property type
See Also:
XMethod.isPropertyMutator(), XMethod.isPropertyAccessor(), XMethod.getPropertyName()

getNameWithoutPrefix

public java.lang.String getNameWithoutPrefix()
Description copied from interface: XMethod
Returns the name of the method with the prefix stripped away. The prefix is the first series of lower case characters. Example:

Specified by:
getNameWithoutPrefix in interface XMethod
Returns:
the property name.

setReturnType

public final void setReturnType(java.lang.String returnType)
Sets the ReturnType attribute of the SourceMethod object

Parameters:
returnType - The new ReturnType value

setReturnDimension

public final void setReturnDimension(int d)
Sets the ReturnDimension attribute of the SourceMethod object

Parameters:
d - The new ReturnDimension value

equals

public boolean equals(java.lang.Object o)
Two methods are equal if they have the same return type, name and signature, regardless of the enclosing class and modifiers. Methods are compared for equality when calling XClass.getMethods(true)

Overrides:
equals in class AbstractExecutableMember
Parameters:
o -
Returns:

hashCode

public int hashCode()
Overrides:
hashCode in class AbstractExecutableMember

toString

public java.lang.String toString()
Overrides:
toString in class AbstractExecutableMember

buildStringId

protected java.lang.String buildStringId()
Specified by:
buildStringId in class AbstractExecutableMember

getMethodNameWithSignatureAndModifiers

private java.lang.String getMethodNameWithSignatureAndModifiers()

getMethodNameWithSignatureWithoutModifiers

private java.lang.String getMethodNameWithSignatureWithoutModifiers()

toString

private java.lang.String toString(boolean modifiers)
Builds a String uniquely describing this method

Parameters:
modifiers -
Returns:
a String uniquely describing this method