org.apache.tapestry.enhance
Class MethodSignatureImpl

java.lang.Object
  extended by org.apache.tapestry.enhance.MethodSignatureImpl
All Implemented Interfaces:
MethodSignature
Direct Known Subclasses:
GenericsMethodSignatureImpl

public class MethodSignatureImpl
extends Object
implements MethodSignature

JDK 1.4 based version of MethodSignature.


Field Summary
protected  Class[] _exceptionTypes
           
protected  int _hashCode
           
protected  String _name
           
protected  Class[] _parameterTypes
           
protected  Class _returnType
           
 
Constructor Summary
MethodSignatureImpl(Class returnType, String name, Class[] parameterTypes, Class[] exceptionTypes)
           
MethodSignatureImpl(Method m)
           
 
Method Summary
protected static int count(Object[] array)
           
 boolean equals(Object o)
          Returns true if the other object is an instance of MethodSignature with identical values for return type, name, parameter types and exception types.
protected  boolean exceptionsEncompass(Class[] otherExceptions)
          The nuts and bolts of checking that another method signature's exceptions are a subset of this signature's.
 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.
 int hashCode()
           
 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).
protected  boolean mismatch(Class[] a1, Class[] a2)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_hashCode

protected int _hashCode

_returnType

protected Class _returnType

_name

protected String _name

_parameterTypes

protected Class[] _parameterTypes

_exceptionTypes

protected Class[] _exceptionTypes
Constructor Detail

MethodSignatureImpl

public MethodSignatureImpl(Class returnType,
                           String name,
                           Class[] parameterTypes,
                           Class[] exceptionTypes)

MethodSignatureImpl

public MethodSignatureImpl(Method m)
Method Detail

getExceptionTypes

public Class[] getExceptionTypes()
Description copied from interface: MethodSignature
Returns the exceptions for this method. Caution: do not modify the returned array. May return null.

Specified by:
getExceptionTypes in interface MethodSignature

getName

public String getName()
Description copied from interface: MethodSignature
The name of the method.

Specified by:
getName in interface MethodSignature
Returns:
method name

getParameterTypes

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

Specified by:
getParameterTypes in interface MethodSignature

getReturnType

public Class getReturnType()
Description copied from interface: MethodSignature
Method return type.

Specified by:
getReturnType in interface MethodSignature
Returns:
The return type of the method.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

count

protected static int count(Object[] array)

equals

public boolean equals(Object o)
Returns true if the other object is an instance of MethodSignature with identical values for return type, name, parameter types and exception types.

Overrides:
equals in class Object

mismatch

protected boolean mismatch(Class[] a1,
                           Class[] a2)

toString

public String toString()
Overrides:
toString in class Object

getUniqueId

public String getUniqueId()
Description copied from interface: MethodSignature
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).

Specified by:
getUniqueId in interface MethodSignature

isGeneric

public boolean isGeneric()
Description copied from interface: MethodSignature
If the method definition has generic parameters or return types it is expected that this will return true.

Specified by:
isGeneric in interface MethodSignature
Returns:
True if this is a generics based method, false otherwise.

isOverridingSignatureOf

public boolean isOverridingSignatureOf(MethodSignature ms)
Description copied from interface: MethodSignature
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).

Specified by:
isOverridingSignatureOf in interface MethodSignature

exceptionsEncompass

protected boolean exceptionsEncompass(Class[] otherExceptions)
The nuts and bolts of checking that another method signature's exceptions are a subset of this signature's.



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