org.apache.tapestry.enhance
Interface MethodSignature

All Known Implementing Classes:
GenericsMethodSignatureImpl, MethodSignatureImpl

public interface MethodSignature

A representation of a Method, identifying the name, return type, parameter types and exception types. Actual Method objects are tied to a particular class, and don't compare well with other otherwise identical Methods from other classes or interface; MethodSignatures are distinct from classes and compare well.

Because the intended purpose is to compare methods from interfaces (which are always public and abstract) we don't bother to actually track the modifiers. In addition, at this time, MethodSignature does not distinguish between instance and static methods.


Method Summary
 Class[] getExceptionTypes()
          Returns the exceptions for this method.
 String getName()
          The name of the method.
 Class[] getParameterTypes()
          Returns the parameter types for this method.
 Class getReturnType()
          Method return type.
 String getUniqueId()
          Returns a string consisting of the name of the method and its parameter values.
 boolean isGeneric()
          If the method definition has generic parameters or return types it is expected that this will return true.
 boolean isOverridingSignatureOf(MethodSignature ms)
          Returns true if this signature has the same return type, name and parameters types as the method signature passed in, and this signatures exceptions "trump" (are the same as, or super-implementations of, all exceptions thrown by the other method signature).
 

Method Detail

getExceptionTypes

Class[] getExceptionTypes()
Returns the exceptions for this method. Caution: do not modify the returned array. May return null.


getName

String getName()
The name of the method.

Returns:
method name

getParameterTypes

Class[] getParameterTypes()
Returns the parameter types for this method. May return null. Caution: do not modify the returned array.


getReturnType

Class getReturnType()
Method return type.

Returns:
The return type of the method.

getUniqueId

String getUniqueId()
Returns a string consisting of the name of the method and its parameter values. This is similar to #toString(), but omits the return type and information about thrown exceptions. A unique id is used by MethodIterator to identify overlapping methods (methods with the same name but different thrown exceptions).


isOverridingSignatureOf

boolean isOverridingSignatureOf(MethodSignature ms)
Returns true if this signature has the same return type, name and parameters types as the method signature passed in, and this signatures exceptions "trump" (are the same as, or super-implementations of, all exceptions thrown by the other method signature).


isGeneric

boolean isGeneric()
If the method definition has generic parameters or return types it is expected that this will return true.

Returns:
True if this is a generics based method, false otherwise.


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.