org.apache.tapestry5.services
Class TransformMethodSignature

java.lang.Object
  extended by org.apache.tapestry5.services.TransformMethodSignature
All Implemented Interfaces:
Comparable<TransformMethodSignature>

public class TransformMethodSignature
extends Object
implements Comparable<TransformMethodSignature>

A representation of a method signature, which consists of its name, modifiers (primarily, visibility), return type, parameter types, and declared exception types.

Types are stored as class names (or primitive names) because the signature is used with ClassTransformation (which operates on as-yet unloaded classes).


Constructor Summary
TransformMethodSignature(int modifiers, String type, String name, String[] parameterTypes, String[] exceptionTypes)
           
TransformMethodSignature(int modifiers, String type, String signature, String name, String[] parameterTypes, String[] exceptionTypes)
           
TransformMethodSignature(String name)
          Convenience for adding a public void method with no parameters or exception types.
 
Method Summary
 int compareTo(TransformMethodSignature o)
          Sorting is primarily via method name.
 boolean equals(Object other)
           
 String[] getExceptionTypes()
          Returns a non-null array of the names of each declared exception type thrown by the method.
 String getMediumDescription()
          Returns a shortened form of the string representation of the method.
 String getMethodName()
          Returns the name of the method.
 int getModifiers()
          Returns the set of modifier flags for this method.
 String[] getParameterTypes()
          Returns an array of the type name for each parameter.
 String getReturnType()
          Return the type name of the return type of the method.
 String getSignature()
           
 int hashCode()
           
 String toString()
          Returns the long form description of the signature.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TransformMethodSignature

public TransformMethodSignature(String name)
Convenience for adding a public void method with no parameters or exception types.


TransformMethodSignature

public TransformMethodSignature(int modifiers,
                                String type,
                                String name,
                                String[] parameterTypes,
                                String[] exceptionTypes)

TransformMethodSignature

public TransformMethodSignature(int modifiers,
                                String type,
                                String signature,
                                String name,
                                String[] parameterTypes,
                                String[] exceptionTypes)
Since:
5.3
Method Detail

getExceptionTypes

public String[] getExceptionTypes()
Returns a non-null array of the names of each declared exception type thrown by the method. Calling code should not modify the array.


getMethodName

public String getMethodName()
Returns the name of the method.


getModifiers

public int getModifiers()
Returns the set of modifier flags for this method.

See Also:
Modifier

getSignature

public String getSignature()

getParameterTypes

public String[] getParameterTypes()
Returns an array of the type name for each parameter. Calling code should not modify the array.


getReturnType

public String getReturnType()
Return the type name of the return type of the method.


hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object other)
Overrides:
equals in class Object

toString

public String toString()
Returns the long form description of the signature. This includes modifiers, return type, method name, parameters and thrown exceptions, formatted approximately as it would appear in Java source (except that parameter names, which are not known, do no appear).

Overrides:
toString in class Object

compareTo

public int compareTo(TransformMethodSignature o)
Sorting is primarily via method name. For methods with the same name, the second level of sorting is by parameter count (descending).

Specified by:
compareTo in interface Comparable<TransformMethodSignature>

getMediumDescription

public String getMediumDescription()
Returns a shortened form of the string representation of the method. It lists just the name of the method and the types of any parameters, omitting return type, exceptions and modifiers.



Copyright © 2003-2012 The Apache Software Foundation.