org.apache.tapestry5.services
Interface TransformMethod

All Superinterfaces:
AnnotationProvider, Comparable<TransformMethod>

public interface TransformMethod
extends AnnotationProvider, Comparable<TransformMethod>

A method defined by (or created within) a ClassTransformation, allowing for access and manipulation of the method.

The natural sorting order of TransformMethods is the same as TransformMethodSignature.

Since:
5.2.0

Method Summary
 void addAdvice(ComponentMethodAdvice advice)
          Add advice for the method; the advice will be threaded into method invocations of the indicated method.
 void addOperationAfter(ComponentInstanceOperation operation)
          Adds an operation that will execute after any further advice or operations.
 void addOperationBefore(ComponentInstanceOperation operation)
          Adds an operation that will execute before any further advice or operations.
 MethodAccess getAccess()
          Returns an object that can be used to invoke the method on an instance of the component class (regardless of the actual visibility of the method).
 String getMethodIdentifier()
          Converts a signature to a string used to identify the method; this consists of the TransformMethodSignature.getMediumDescription() appended with source file information and line number information (when available).
 String getName()
          Returns just the name of the method.
<A extends Annotation>
A
getParameterAnnotation(int index, Class<A> annotationType)
          Gets an annotation on a parameter of the method.
 TransformMethodSignature getSignature()
           
 boolean isOverride()
          Returns true if the method is an override of a method from the parent class.
 
Methods inherited from interface org.apache.tapestry5.ioc.AnnotationProvider
getAnnotation
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getSignature

TransformMethodSignature getSignature()
Returns:
the signature for the method, defining name, visibility, return type, parameter types and thrown exceptions

getName

String getName()
Returns just the name of the method.


getAccess

MethodAccess getAccess()
Returns an object that can be used to invoke the method on an instance of the component class (regardless of the actual visibility of the method).


addAdvice

void addAdvice(ComponentMethodAdvice advice)
Add advice for the method; the advice will be threaded into method invocations of the indicated method. A method may be given multiple advice; each advice will receive control in turn (assuming the previous advice invokes Invocation.proceed()) in the order the advice is added. The last advice will proceed to the original method implementation.

Parameters:
advice - to receive control when the method is invoked
See Also:
addOperationAfter(ComponentInstanceOperation), addOperationBefore(ComponentInstanceOperation)

addOperationBefore

void addOperationBefore(ComponentInstanceOperation operation)
Adds an operation that will execute before any further advice or operations. This is converted into advice that invokes the operation, then invokes Invocation.proceed().


addOperationAfter

void addOperationAfter(ComponentInstanceOperation operation)
Adds an operation that will execute after any further advice or operations. This is converted into advice that invokes Invocation.proceed() before invoking the operation.


getMethodIdentifier

String getMethodIdentifier()
Converts a signature to a string used to identify the method; this consists of the TransformMethodSignature.getMediumDescription() appended with source file information and line number information (when available).

Returns:
a string that identifies the class, method name, types of parameters, source file and source line number

isOverride

boolean isOverride()
Returns true if the method is an override of a method from the parent class.

Returns:
true if the parent class contains a method with the name signature

getParameterAnnotation

<A extends Annotation> A getParameterAnnotation(int index,
                                                Class<A> annotationType)
Gets an annotation on a parameter of the method.

Parameters:
index - index of parameter
annotationType - type of annotation to check for
Returns:
the annotation, if found, or null


Copyright © 2003-2012 The Apache Software Foundation.