xjavadoc

Class AbstractExecutableMember

Implemented Interfaces:
Comparable, Named, XExecutableMember, XMember, XProgramElement
Known Direct Subclasses:
ConstructorImpl, MethodImpl

(package private) abstract class AbstractExecutableMember
extends MemberImpl
implements XExecutableMember

Baseclass for XExecutableMember.
Author:
Aslak Helles?y

Field Summary

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.
private static Integer[]
_dimensions
private String
_nameWithSignature
private List
_parameterData
private static ParameterImpl[]
_parameterPool
private String
_signature
private String
_stringId
private List
_thrownExceptions

Fields inherited from class xjavadoc.MemberImpl

_name

Fields inherited from class xjavadoc.AbstractProgramElement

EMPTY_LIST, _containingClass, _doc, _javadocToken, _modifierString, _modifiers, _tagFactory, _token, _xJavaDoc

Constructor Summary

AbstractExecutableMember(AbstractClass containingClass, XTagFactory tagFactory)

Method Summary

void
addParameterData(String type, String name, int dimension)
Adds a parameter
void
addThrownException(String thrownException)
private StringBuffer
appendSignature(StringBuffer sb, boolean withParam)
protected abstract String
buildStringId()
boolean
equals(Object o)
String
getNameWithSignature(boolean withParam)
Gets the name and signature
(package private) int
getParameterDimension(int index)
(package private) String
getParameterName(int index)
(package private) String
getParameterType(int index)
String
getParameterTypes()
List
getParameters()
Returns the method parameters.
private List
getQualifiedExceptions()
String
getSignature(boolean withParam)
Gets the signature
XProgramElement
getSuperElement(boolean forMethod)
List
getThrownExceptions()
int
hashCode()
boolean
isNative()
Gets the Native attribute of the AbstractExecutableMember object
boolean
isSynchronized()
Gets the Synchronized attribute of the AbstractExecutableMember object
private String
stringId()
Gets the StringId attribute of the MethodImpl object
boolean
throwsException(String exception_class_name)
String
toString()
private static String
toString(XParameter parameter, boolean withParam)

Methods inherited from class xjavadoc.MemberImpl

getName, getSuperInterfaceElements, setName

Methods inherited from class xjavadoc.AbstractProgramElement

addModifier, compareTo, getContainingAbstractClass, getContainingClass, getContainingPackage, getDoc, getModifierSpecifier, getModifiers, getTagFactory, getXJavaDoc, isAbstract, isFinal, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, reset, setJavaDoc, setToken, updateDoc

Field Details

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
Field Value:
20

MAX_ARRAY_SIZE

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

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.
Field Value:
2

_dimensions

private static final Integer[] _dimensions

_nameWithSignature

private String _nameWithSignature

_parameterData

private List _parameterData

_parameterPool

private static ParameterImpl[] _parameterPool

_signature

private String _signature

_stringId

private String _stringId

_thrownExceptions

private List _thrownExceptions

Constructor Details

AbstractExecutableMember

protected AbstractExecutableMember(AbstractClass containingClass,
                                   XTagFactory tagFactory)

Method Details

addParameterData

public void addParameterData(String type,
                             String name,
                             int dimension)
Adds a parameter
Parameters:
type - qualified nyme of parameter type
name - parameter name
dimension - parameter dimension

addThrownException

public void addThrownException(String thrownException)

appendSignature

private final StringBuffer appendSignature(StringBuffer sb,
                                           boolean withParam)

buildStringId

protected abstract String buildStringId()

equals

public boolean equals(Object o)

getNameWithSignature

public final 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

getParameterDimension

(package private) final int getParameterDimension(int index)

getParameterName

(package private) final String getParameterName(int index)

getParameterType

(package private) final String getParameterType(int index)

getParameterTypes

public String getParameterTypes()
Specified by:
getParameterTypes in interface XExecutableMember

getParameters

public final List getParameters()
Returns the method parameters.
Specified by:
getParameters in interface XExecutableMember
Returns:
the method parameters

getQualifiedExceptions

private List getQualifiedExceptions()

getSignature

public final 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

getSuperElement

public XProgramElement getSuperElement(boolean forMethod)

getThrownExceptions

public List getThrownExceptions()
Specified by:
getThrownExceptions in interface XExecutableMember

hashCode

public int hashCode()

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

stringId

private final String stringId()
Gets the StringId attribute of the MethodImpl object
Returns:
The StringId value

throwsException

public boolean throwsException(String exception_class_name)
Specified by:
throwsException in interface XExecutableMember

toString

public String toString()

toString

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