public class Forwarding extends Object implements Implementation.Composable
MethodDelegation| Modifier and Type | Class and Description | 
|---|---|
protected static class  | 
Forwarding.Appender
An appender for implementing a  
Forwarding operation. | 
protected static interface  | 
Forwarding.PreparationHandler
A preparation handler is responsible for reading the field containing the forwarding instance. 
 | 
protected static class  | 
Forwarding.TerminationHandler
A termination handler is responsible for a method's return. 
 | 
Implementation.Composable, Implementation.Compound, Implementation.Context, Implementation.Simple, Implementation.SpecialMethodInvocation, Implementation.Target| Modifier and Type | Field and Description | 
|---|---|
protected Forwarding.PreparationHandler | 
preparationHandler
A handler for preparing the instrumented type and the field invocation operation. 
 | 
protected Forwarding.TerminationHandler | 
terminationHandler
The termination handler to apply. 
 | 
| Modifier | Constructor and Description | 
|---|---|
protected  | 
Forwarding(Forwarding.PreparationHandler preparationHandler,
          Forwarding.TerminationHandler terminationHandler)
Creates a new forwarding implementation. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
Implementation | 
andThen(Implementation implementation)
Appends the supplied implementation to this implementation. 
 | 
ByteCodeAppender | 
appender(Implementation.Target implementationTarget)
Creates a byte code appender that determines the implementation of the instrumented type's methods. 
 | 
boolean | 
equals(Object object)  | 
int | 
hashCode()  | 
InstrumentedType | 
prepare(InstrumentedType instrumentedType)
Prepares a given instrumented type. 
 | 
static Implementation.Composable | 
to(Object delegate)
Forwards all intercepted method invocations to the given instance which is stored in a  
static field
 of the instrumented class. | 
static Implementation.Composable | 
to(Object delegate,
  String fieldName)
Forwards all intercepted method invocations to the given instance which is stored in a  
static field
 of the instrumented class. | 
static Implementation.Composable | 
to(Object delegate,
  String fieldName,
  Type type)
Forwards all intercepted method invocations to the given instance which is stored in a  
static field
 of the instrumented class. | 
static Implementation.Composable | 
to(Object delegate,
  Type type)
Forwards all intercepted method invocations to the given instance which is stored in a  
static field
 of the instrumented class. | 
static Implementation.Composable | 
toField(String name)
Delegates a method invocation to a field. 
 | 
static Implementation.Composable | 
toField(String name,
       FieldLocator.Factory fieldLocatorFactory)
Delegates a method invocation to a field. 
 | 
String | 
toString()  | 
protected final Forwarding.PreparationHandler preparationHandler
protected final Forwarding.TerminationHandler terminationHandler
protected Forwarding(Forwarding.PreparationHandler preparationHandler, Forwarding.TerminationHandler terminationHandler)
preparationHandler - A handler for preparing the instrumented type and the field invocation operation.terminationHandler - The termination handler to apply.public static Implementation.Composable to(Object delegate)
static field
 of the instrumented class. The field name is generated from the instance's hash code.delegate - The delegate to which all intercepted methods should be forwarded.public static Implementation.Composable to(Object delegate, String fieldName)
static field
 of the instrumented class.delegate - The delegate to which all intercepted methods should be forwarded.fieldName - The name of the field in which the delegate should be stored.public static Implementation.Composable to(Object delegate, Type type)
static field
 of the instrumented class.delegate - The delegate to which all intercepted methods should be forwarded.type - The type of the field. Must be a subtype of the delegate's type.public static Implementation.Composable to(Object delegate, String fieldName, Type type)
static field
 of the instrumented class.delegate - The delegate to which all intercepted methods should be forwarded.fieldName - The name of the field in which the delegate should be stored.type - The type of the field. Must be a subtype of the delegate's type.public static Implementation.Composable toField(String name)
name - The name of the field.public static Implementation.Composable toField(String name, FieldLocator.Factory fieldLocatorFactory)
name - The name of the field.fieldLocatorFactory - The field locator factory to use.public ByteCodeAppender appender(Implementation.Target implementationTarget)
Implementationappender in interface ImplementationimplementationTarget - The target of the current implementation.InstrumentedType.Prepareable.prepare(InstrumentedType).public Implementation andThen(Implementation implementation)
Implementation.ComposableandThen in interface Implementation.Composableimplementation - The subsequent implementation.public InstrumentedType prepare(InstrumentedType instrumentedType)
InstrumentedType.Prepareableprepare in interface InstrumentedType.PrepareableinstrumentedType - The instrumented type in its current form.Copyright © 2014–2016. All rights reserved.