Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## xjavadoc
Class MethodImpl

    java.lang.Object
      xjavadoc.AbstractProgramElement
          xjavadoc.MemberImpl
              xjavadoc.AbstractExecutableMember
                  xjavadoc.MethodImpl

All Implemented Interfaces:
  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 inherited from class xjavadoc.XMethod
`XMethod.PropertyAccessorPredicate, XMethod.PropertyMutatorPredicate`

Field Summary
`static int` | `instanceCount`

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
`void` | `addParameterData(String type, String name, int dimension)` Adds a parameter
`void` | `addThrownException(String thrownException)`
`protected String` | `buildStringId()`
`boolean` | `equals(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.
`XMethod` | `getMutator()` If this method is an accessor, and a corresponding mutator exists, that mutator will be returned.
`String` | `getName()` Get name
`String` | `getNameWithoutPrefix()` Returns the name of the method with the prefix stripped away.
`String` | `getNameWithSignature(boolean withParam)` Gets the name and signature
`(package private) int` | `getParameterDimension(int index)`
`(package private) String` | `getParameterName(int index)`
`List` | `getParameters()` Returns the method parameters.
`(package private) String` | `getParameterType(int index)`
`String` | `getParameterTypes()` Returns the parameters as a comma separated list of classes.
`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.
`String` | `getSignature(boolean withParam)` Gets the signature
`XProgramElement` | `getSuperElement()`
`XProgramElement` | `getSuperElement(boolean forMethod)`
`List` | `getSuperInterfaceElements()`
`List` | `getThrownExceptions()` Returns the thrown exception classes.
`int` | `hashCode()`
`boolean` | `isConstructor()` Gets the Constructor attribute of the SourceMethod object
`boolean` | `isNative()` Gets the Native attribute of the AbstractExecutableMember object
`boolean` | `isPropertyAccessor()`
`boolean` | `isPropertyMutator()`
`boolean` | `isSynchronized()` Gets the Synchronized attribute of the AbstractExecutableMember object
`void` | `setName(String name)`
`void` | `setReturnDimension(int d)` Sets the ReturnDimension attribute of the SourceMethod object
`void` | `setReturnType(String returnType)` Sets the ReturnType attribute of the SourceMethod object
`boolean` | `throwsException(String exception_class_name)` Return true if the member throws the specified exception in its throws block.
`String` | `toString()`

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

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 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 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 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:
  - "isIt" -> "It"
  - "setIt" -> "It"
  - "addIt" -> "It"
  - "createIt" -> "It"
  - "isit" -> null

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

### setReturnType

    public final void setReturnType(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(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 String toString()

  Overrides:
    `toString` in class `AbstractExecutableMember`

### buildStringId

    protected String buildStringId()

  Specified by:
    `buildStringId` in class `AbstractExecutableMember`

### 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 List getParameters()

  Returns the method parameters.

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

### 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

### 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

### getParameterTypes

    public 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 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(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(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)

### getParameterType

    final String getParameterType(int index)

### getParameterName

    final String getParameterName(int index)

### getParameterDimension

    final int getParameterDimension(int index)

### getName

    public String getName()

  Description copied from interface: `Named`
  Get name

  Specified by:
    `getName` in interface `Named`
  Returns:
    name

### setName

    public void setName(String name)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002-2004 XDoclet Team. All Rights Reserved.