protected abstract static class InvokeDynamic.AbstractDelegator extends InvokeDynamic
InvokeDynamic.AbstractDelegator, InvokeDynamic.Appender, InvokeDynamic.InvocationProvider, InvokeDynamic.TerminationHandler, InvokeDynamic.WithImplicitArguments, InvokeDynamic.WithImplicitArgumentType, InvokeDynamic.WithImplicitFieldType, InvokeDynamic.WithImplicitTarget
Implementation.Compound, Implementation.Context, Implementation.Simple, Implementation.SpecialMethodInvocation, Implementation.Target
assigner, bootstrapMethod, dynamicallyTyped, handleArguments, invocationProvider, terminationHandler
Constructor and Description |
---|
AbstractDelegator(MethodDescription bootstrapMethod,
List<?> handleArguments,
InvokeDynamic.InvocationProvider invocationProvider,
InvokeDynamic.TerminationHandler terminationHandler,
Assigner assigner,
boolean dynamicallyTyped)
Creates a new abstract delegator for a dynamic method invocation.
|
Modifier and Type | Method and Description |
---|---|
protected abstract InvokeDynamic |
materialize()
Resolves the current configuration into a fully initialized invoke dynamic instance.
|
InvokeDynamic |
withArgument(int... index)
Passes parameters of the instrumented method to the bootstrapped method.
|
InvokeDynamic.WithImplicitArgumentType |
withArgument(int index)
Passes a parameter of the instrumented method to the bootstrapped method.
|
InvokeDynamic |
withBooleanValue(boolean... value)
Requires the bootstrap method to bootstrap a method that takes the specified
boolean arguments
as its next parameters. |
InvokeDynamic |
withByteValue(byte... value)
Requires the bootstrap method to bootstrap a method that takes the specified
byte arguments
as its next parameters. |
InvokeDynamic |
withCharacterValue(char... value)
Requires the bootstrap method to bootstrap a method that takes the specified
char arguments
as its next parameters. |
InvokeDynamic |
withDoubleValue(double... value)
Requires the bootstrap method to bootstrap a method that takes the specified
double arguments
as its next parameters. |
InvokeDynamic |
withField(String... fieldName)
Passes the values of the specified fields to the bootstrap method.
|
InvokeDynamic |
withFloatValue(float... value)
Requires the bootstrap method to bootstrap a method that takes the specified
float arguments
as its next parameters. |
InvokeDynamic |
withImplicitAndMethodArguments()
Adds a potential
this reference and all method arguments to the the bootstrapped method. |
InvokeDynamic |
withInstance(JavaInstance... javaInstance)
Hands the provided Java instance to the dynamically bound method.
|
InvokeDynamic |
withInstanceField(String fieldName,
Class<?> fieldType)
Passes the value of the specified instance field to the bootstrapped method.
|
InvokeDynamic |
withInstanceField(String fieldName,
TypeDescription fieldType)
Passes the value of the specified instance field to the bootstrapped method.
|
InvokeDynamic |
withIntegerValue(int... value)
Requires the bootstrap method to bootstrap a method that takes the specified
int arguments
as its next parameters. |
InvokeDynamic |
withLongValue(long... value)
Requires the bootstrap method to bootstrap a method that takes the specified
long arguments
as its next parameters. |
InvokeDynamic |
withMethodArguments()
Adds all method arguments to the the bootstrapped method.
|
InvokeDynamic |
withNullValue(Class<?>... type)
Passes
null values of the given types to the bootstrapped method. |
InvokeDynamic |
withNullValue(TypeDescription... typeDescription)
Passes
null values of the given types to the bootstrapped method. |
InvokeDynamic |
withReference(Object... value)
Requires the bootstrap method to bootstrap a method that takes the specified arguments as its next parameters.
|
InvokeDynamic.WithImplicitFieldType |
withReference(Object value)
Requires the bootstrap method to bootstrap a method that takes the specified argument as its next parameter while
allowing to specify the value to be of a different type than the actual instance type.
|
InvokeDynamic |
withShortValue(short... value)
Requires the bootstrap method to bootstrap a method that takes the specified
short arguments
as its next parameters. |
InvokeDynamic |
withThis(Class<?>... type)
Passes references to
this onto the operand stack where the instance is represented as
the given types. |
InvokeDynamic |
withThis(TypeDescription... typeDescription)
Passes references to
this onto the operand stack where the instance is represented as
the given types. |
InvokeDynamic |
withType(TypeDescription... typeDescription)
Hands the provided types to the dynamically bound method.
|
InvokeDynamic |
withValue(Object... value)
Requires the bootstrap method to bootstrap a method that takes the specified arguments as its next parameters.
|
andThen, appender, bootstrap, bootstrap, bootstrap, bootstrap, bootstrap, bootstrap, equals, getInvocationProvider, hashCode, prepare, toString, withAssigner, withEnumeration
public AbstractDelegator(MethodDescription bootstrapMethod, List<?> handleArguments, InvokeDynamic.InvocationProvider invocationProvider, InvokeDynamic.TerminationHandler terminationHandler, Assigner assigner, boolean dynamicallyTyped)
bootstrapMethod
- The bootstrap method.handleArguments
- The arguments that are provided to the bootstrap method.invocationProvider
- The target provided that identifies the method to be bootstrapped.terminationHandler
- A handler that handles the method return.assigner
- The assigner to be used.dynamicallyTyped
- true
if the assigner should attempt dynamically-typed assignments.protected abstract InvokeDynamic materialize()
public InvokeDynamic withBooleanValue(boolean... value)
InvokeDynamic
boolean
arguments
as its next parameters.withBooleanValue
in class InvokeDynamic
value
- The arguments to pass to the bootstrapped method.public InvokeDynamic withByteValue(byte... value)
InvokeDynamic
byte
arguments
as its next parameters.withByteValue
in class InvokeDynamic
value
- The arguments to pass to the bootstrapped method.public InvokeDynamic withShortValue(short... value)
InvokeDynamic
short
arguments
as its next parameters.withShortValue
in class InvokeDynamic
value
- The arguments to pass to the bootstrapped method.public InvokeDynamic withCharacterValue(char... value)
InvokeDynamic
char
arguments
as its next parameters.withCharacterValue
in class InvokeDynamic
value
- The arguments to pass to the bootstrapped method.public InvokeDynamic withIntegerValue(int... value)
InvokeDynamic
int
arguments
as its next parameters.withIntegerValue
in class InvokeDynamic
value
- The arguments to pass to the bootstrapped method.public InvokeDynamic withLongValue(long... value)
InvokeDynamic
long
arguments
as its next parameters.withLongValue
in class InvokeDynamic
value
- The arguments to pass to the bootstrapped method.public InvokeDynamic withFloatValue(float... value)
InvokeDynamic
float
arguments
as its next parameters.withFloatValue
in class InvokeDynamic
value
- The arguments to pass to the bootstrapped method.public InvokeDynamic withDoubleValue(double... value)
InvokeDynamic
double
arguments
as its next parameters.withDoubleValue
in class InvokeDynamic
value
- The arguments to pass to the bootstrapped method.public InvokeDynamic withValue(Object... value)
InvokeDynamic
Requires the bootstrap method to bootstrap a method that takes the specified arguments as its next parameters. Note that any primitive parameters are passed as their wrapper types. Furthermore, values that can be stored in the instrumented class's constant pool might be of different object identity when passed to the bootstrapped method or might not be visible to the the created class what later results in a runtime error.
withValue
in class InvokeDynamic
value
- The arguments to pass to the bootstrapped method.public InvokeDynamic.WithImplicitFieldType withReference(Object value)
InvokeDynamic
Requires the bootstrap method to bootstrap a method that takes the specified argument as its next parameter while allowing to specify the value to be of a different type than the actual instance type.
withReference
in class InvokeDynamic
value
- The arguments to pass to the bootstrapped method.public InvokeDynamic withReference(Object... value)
InvokeDynamic
withReference
in class InvokeDynamic
value
- The arguments to pass to the bootstrapped method.public InvokeDynamic withType(TypeDescription... typeDescription)
InvokeDynamic
withType
in class InvokeDynamic
typeDescription
- The classes to provide to the bound method as an argument.public InvokeDynamic withInstance(JavaInstance... javaInstance)
InvokeDynamic
withInstance
in class InvokeDynamic
javaInstance
- The Java instance to provide to the bound method as an argument.public InvokeDynamic withNullValue(Class<?>... type)
InvokeDynamic
null
values of the given types to the bootstrapped method.withNullValue
in class InvokeDynamic
type
- The type that the null
values should represent.public InvokeDynamic withNullValue(TypeDescription... typeDescription)
InvokeDynamic
null
values of the given types to the bootstrapped method.withNullValue
in class InvokeDynamic
typeDescription
- The type that the null
values should represent.public InvokeDynamic withArgument(int... index)
InvokeDynamic
withArgument
in class InvokeDynamic
index
- The indices of the parameters that should be passed to the bootstrapped method.public InvokeDynamic.WithImplicitArgumentType withArgument(int index)
InvokeDynamic
withArgument
in class InvokeDynamic
index
- The index of the parameter that should be passed to the bootstrapped method.public InvokeDynamic withThis(Class<?>... type)
InvokeDynamic
this
onto the operand stack where the instance is represented as
the given types.withThis
in class InvokeDynamic
type
- The types as which the this
reference of the intercepted method should be masked.this
references are passed as the next arguments.public InvokeDynamic withThis(TypeDescription... typeDescription)
InvokeDynamic
this
onto the operand stack where the instance is represented as
the given types.withThis
in class InvokeDynamic
typeDescription
- The types as which the this
reference of the intercepted method should be masked.this
references are passed as the next arguments.public InvokeDynamic withMethodArguments()
InvokeDynamic
withMethodArguments
in class InvokeDynamic
public InvokeDynamic withImplicitAndMethodArguments()
InvokeDynamic
this
reference and all method arguments to the the bootstrapped method.withImplicitAndMethodArguments
in class InvokeDynamic
this
reference and all
parameters of the instrumented method added.public InvokeDynamic withInstanceField(String fieldName, Class<?> fieldType)
InvokeDynamic
withInstanceField
in class InvokeDynamic
fieldName
- The name of the field.fieldType
- The type of the field.public InvokeDynamic withInstanceField(String fieldName, TypeDescription fieldType)
InvokeDynamic
withInstanceField
in class InvokeDynamic
fieldName
- The name of the field.fieldType
- The type of the field.public InvokeDynamic withField(String... fieldName)
InvokeDynamic
withField
in class InvokeDynamic
fieldName
- The names of the fields to be passed to the bootstrapped method.Copyright © 2014–2015. All rights reserved.