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

## org.apache.tapestry5.services
Interface TransformMethod

All Superinterfaces:
  AnnotationProvider, java.lang.Comparable<TransformMethod>

    public interface TransformMethod

extends AnnotationProvider, java.lang.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).
`java.lang.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).
`java.lang.String` | `getName()` Returns just the name of the method.
`
`<A extends java.lang.annotation.Annotation> A`
` | `getParameterAnnotation(int index, java.lang.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

    java.lang.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

    java.lang.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 java.lang.annotation.Annotation> A getParameterAnnotation(int index,
                                                                         java.lang.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

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 © 2003-2012 The Apache Software Foundation.