xjavadoc
Class AbstractExecutableMember

java.lang.Object
  extended byxjavadoc.AbstractProgramElement
      extended byxjavadoc.MemberImpl
          extended byxjavadoc.AbstractExecutableMember
All Implemented Interfaces:
java.lang.Comparable, Named, XExecutableMember, XMember, XProgramElement
Direct Known Subclasses:
ConstructorImpl, MethodImpl

abstract class AbstractExecutableMember
extends MemberImpl
implements XExecutableMember

Baseclass for XExecutableMember.

Author:
Aslak Hellesøy

Field Summary
private static java.lang.Integer[] _dimensions
           
private  java.lang.String _nameWithSignature
           
private  java.util.List _parameterData
           
private static ParameterImpl[] _parameterPool
           
private  java.lang.String _signature
           
private  java.lang.String _stringId
           
private  java.util.List _thrownExceptions
           
private static int INITIAL_PARAMETER_POOL_SIZE
          Initial size of ParameterImpl pool.
private static int MAX_ARRAY_SIZE
          Maximum dimension of a parameter.
private static int PARAMETER_DATA_SIZE
          Initial size of data to hold parameters.
 
Fields inherited from class xjavadoc.AbstractProgramElement
EMPTY_LIST
 
Constructor Summary
protected AbstractExecutableMember(AbstractClass containingClass, XTagFactory tagFactory)
           
 
Method Summary
 void addParameterData(java.lang.String type, java.lang.String name, int dimension)
          Adds a parameter
 void addThrownException(java.lang.String thrownException)
           
private  java.lang.StringBuffer appendSignature(java.lang.StringBuffer sb, boolean withParam)
           
protected abstract  java.lang.String buildStringId()
           
 boolean equals(java.lang.Object o)
           
 java.lang.String getName()
          Get name
 java.lang.String getNameWithSignature(boolean withParam)
          Gets the name and signature
(package private)  int getParameterDimension(int index)
           
(package private)  java.lang.String getParameterName(int index)
           
 java.util.List getParameters()
          Returns the method parameters.
(package private)  java.lang.String getParameterType(int index)
           
 java.lang.String getParameterTypes()
          Returns the parameters as a comma separated list of classes.
private  java.util.List getQualifiedExceptions()
           
 java.lang.String getSignature(boolean withParam)
          Gets the signature
 XProgramElement getSuperElement(boolean forMethod)
           
 java.util.List getSuperInterfaceElements()
           
 java.util.List getThrownExceptions()
          Returns the thrown exception classes.
 int hashCode()
           
 boolean isNative()
          Gets the Native attribute of the AbstractExecutableMember object
 boolean isSynchronized()
          Gets the Synchronized attribute of the AbstractExecutableMember object
 void setName(java.lang.String name)
           
private  java.lang.String stringId()
          Gets the StringId attribute of the MethodImpl object
 boolean throwsException(java.lang.String exception_class_name)
          Return true if the member throws the specified exception in its throws block.
 java.lang.String toString()
           
private static java.lang.String toString(XParameter parameter, boolean withParam)
           
 
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
isConstructor
 
Methods inherited from interface xjavadoc.XProgramElement
getContainingClass, getContainingPackage, getDoc, getModifiers, getModifierSpecifier, getSuperElement, getSuperInterfaceElements, 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

MAX_ARRAY_SIZE

private static final int MAX_ARRAY_SIZE
Maximum dimension of a parameter. We want to avoid exessive Integer object creation.

See Also:
Constant Field Values

_dimensions

private static final java.lang.Integer[] _dimensions

PARAMETER_DATA_SIZE

private static final int PARAMETER_DATA_SIZE
Initial size of data to hold parameters. Estimate of average number of params in a method.

See Also:
Constant Field Values

INITIAL_PARAMETER_POOL_SIZE

private static final int INITIAL_PARAMETER_POOL_SIZE
Initial size of ParameterImpl pool. Estimate of max number of params in a method

See Also:
Constant Field Values

_parameterPool

private static ParameterImpl[] _parameterPool

_thrownExceptions

private java.util.List _thrownExceptions

_parameterData

private java.util.List _parameterData

_nameWithSignature

private java.lang.String _nameWithSignature

_signature

private java.lang.String _signature

_stringId

private java.lang.String _stringId
Constructor Detail

AbstractExecutableMember

protected AbstractExecutableMember(AbstractClass containingClass,
                                   XTagFactory tagFactory)
Method Detail

toString

private static final java.lang.String toString(XParameter parameter,
                                               boolean withParam)

isNative

public final boolean isNative()
Gets the Native attribute of the AbstractExecutableMember object

Specified by:
isNative in interface XExecutableMember
Returns:
The Native value

isSynchronized

public final boolean isSynchronized()
Gets the Synchronized attribute of the AbstractExecutableMember object

Specified by:
isSynchronized in interface XExecutableMember
Returns:
The Synchronized value

getParameters

public final java.util.List getParameters()
Returns the method parameters.

Specified by:
getParameters in interface XExecutableMember
Returns:
the method parameters

getSignature

public final java.lang.String getSignature(boolean withParam)
Gets the signature

Specified by:
getSignature in interface XExecutableMember
Parameters:
withParam - if true, include the parameters in the signature. Otherwise, only the types will be used.
Returns:
the signature

getNameWithSignature

public final java.lang.String getNameWithSignature(boolean withParam)
Gets the name and signature

Specified by:
getNameWithSignature in interface XExecutableMember
Parameters:
withParam - if true, include the parameters in the signature. Otherwise, only the types will be used.
Returns:
the name and signature

getParameterTypes

public java.lang.String getParameterTypes()
Description copied from interface: XExecutableMember
Returns the parameters as a comma separated list of classes. E.g. a method with signature (java.lang.String,int) would return java.lang.String.class, java.lang.Integer.TYPE.

Specified by:
getParameterTypes in interface XExecutableMember
Returns:
comma separated list of types for all parameters.

getThrownExceptions

public java.util.List getThrownExceptions()
Description copied from interface: XExecutableMember
Returns the thrown exception classes.

Specified by:
getThrownExceptions in interface XExecutableMember
Returns:
a Collection of XClass.

getSuperElement

public XProgramElement getSuperElement(boolean forMethod)

throwsException

public boolean throwsException(java.lang.String exception_class_name)
Description copied from interface: XExecutableMember
Return true if the member throws the specified exception in its throws block.

Specified by:
throwsException in interface XExecutableMember
Parameters:
exception_class_name -
Returns:
true if the member throws the exception

addParameterData

public void addParameterData(java.lang.String type,
                             java.lang.String name,
                             int dimension)
Adds a parameter

Parameters:
type - qualified nyme of parameter type
name - parameter name
dimension - parameter dimension

addThrownException

public void addThrownException(java.lang.String thrownException)

equals

public boolean equals(java.lang.Object o)

hashCode

public int hashCode()

toString

public java.lang.String toString()

buildStringId

protected abstract java.lang.String buildStringId()

getParameterType

final java.lang.String getParameterType(int index)

getParameterName

final java.lang.String getParameterName(int index)

getParameterDimension

final int getParameterDimension(int index)

getQualifiedExceptions

private java.util.List getQualifiedExceptions()

stringId

private final java.lang.String stringId()
Gets the StringId attribute of the MethodImpl object

Returns:
The StringId value

appendSignature

private final java.lang.StringBuffer appendSignature(java.lang.StringBuffer sb,
                                                     boolean withParam)

getName

public java.lang.String getName()
Description copied from interface: Named
Get name

Specified by:
getName in interface Named
Returns:
name

setName

public void setName(java.lang.String name)

getSuperInterfaceElements

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