protected abstract static class InvokeDynamic.AbstractDelegator extends InvokeDynamic
InvokeDynamic.AbstractDelegator, InvokeDynamic.Appender, InvokeDynamic.InvocationProvider, InvokeDynamic.TerminationHandler, InvokeDynamic.WithImplicitArguments, InvokeDynamic.WithImplicitTarget, InvokeDynamic.WithImplicitType
Implementation.Composable, Implementation.Compound, Implementation.Context, Implementation.Simple, Implementation.SpecialMethodInvocation, Implementation.Target
InstrumentedType.Prepareable.NoOp
arguments, assigner, bootstrap, invocationProvider, terminationHandler, typing
Modifier | Constructor and Description |
---|---|
protected |
AbstractDelegator(MethodDescription.InDefinedShape bootstrap,
List<? extends JavaConstant> arguments,
InvokeDynamic.InvocationProvider invocationProvider,
InvokeDynamic.TerminationHandler terminationHandler,
Assigner assigner,
Assigner.Typing typing)
Creates a new abstract delegator for a dynamic method invocation.
|
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.
|
protected abstract InvokeDynamic |
materialize()
Resolves the current configuration into a fully initialized invoke dynamic instance.
|
InstrumentedType |
prepare(InstrumentedType instrumentedType)
Prepares a given instrumented type.
|
InvokeDynamic |
withArgument(int... index)
Passes parameters of the instrumented method to the bootstrapped method.
|
InvokeDynamic.WithImplicitType |
withArgument(int index)
Passes a parameter of the instrumented method to the bootstrapped method.
|
Implementation.Composable |
withAssigner(Assigner assigner,
Assigner.Typing typing)
Instructs this implementation to use the provided assigner and decides if the assigner should apply
dynamic typing.
|
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 |
withEnumeration(EnumerationDescription... enumerationDescription)
Hands the provided enumerations to the dynamically bound method.
|
InvokeDynamic |
withField(FieldLocator.Factory fieldLocatorFactory,
String... name)
Passes the values of the specified fields to the bootstrap method.
|
InvokeDynamic |
withField(String... fieldName)
Passes the values of the specified fields to the bootstrap method.
|
InvokeDynamic.WithImplicitType |
withField(String name)
Passes the values of the specified fields to the bootstrap method.
|
InvokeDynamic.WithImplicitType |
withField(String name,
FieldLocator.Factory fieldLocatorFactory)
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(JavaConstant... javaConstant)
Hands the provided Java instance to the dynamically bound 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.WithImplicitType |
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.
|
protected AbstractDelegator(MethodDescription.InDefinedShape bootstrap, List<? extends JavaConstant> arguments, InvokeDynamic.InvocationProvider invocationProvider, InvokeDynamic.TerminationHandler terminationHandler, Assigner assigner, Assigner.Typing typing)
bootstrap
- The bootstrap method or constructor.arguments
- The arguments that are provided to the bootstrap method or constructor.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.typing
- Indicates if dynamic type castings should be attempted for incompatible assignments.protected abstract InvokeDynamic materialize()
public InvokeDynamic withBooleanValue(boolean... value)
boolean
arguments
as its next parameters.withBooleanValue
in class InvokeDynamic
value
- The arguments to pass to the bootstrapped method.public InvokeDynamic withByteValue(byte... value)
byte
arguments
as its next parameters.withByteValue
in class InvokeDynamic
value
- The arguments to pass to the bootstrapped method.public InvokeDynamic withShortValue(short... value)
short
arguments
as its next parameters.withShortValue
in class InvokeDynamic
value
- The arguments to pass to the bootstrapped method.public InvokeDynamic withCharacterValue(char... value)
char
arguments
as its next parameters.withCharacterValue
in class InvokeDynamic
value
- The arguments to pass to the bootstrapped method.public InvokeDynamic withIntegerValue(int... value)
int
arguments
as its next parameters.withIntegerValue
in class InvokeDynamic
value
- The arguments to pass to the bootstrapped method.public InvokeDynamic withLongValue(long... value)
long
arguments
as its next parameters.withLongValue
in class InvokeDynamic
value
- The arguments to pass to the bootstrapped method.public InvokeDynamic withFloatValue(float... value)
float
arguments
as its next parameters.withFloatValue
in class InvokeDynamic
value
- The arguments to pass to the bootstrapped method.public InvokeDynamic withDoubleValue(double... value)
double
arguments
as its next parameters.withDoubleValue
in class InvokeDynamic
value
- The arguments to pass to the bootstrapped method.public InvokeDynamic withValue(Object... value)
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.WithImplicitType 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.
withReference
in class InvokeDynamic
value
- The arguments to pass to the bootstrapped method.public InvokeDynamic withReference(Object... value)
withReference
in class InvokeDynamic
value
- The arguments to pass to the bootstrapped method.public InvokeDynamic withType(TypeDescription... typeDescription)
withType
in class InvokeDynamic
typeDescription
- The classes to provide to the bound method as an argument.public InvokeDynamic withInstance(JavaConstant... javaConstant)
withInstance
in class InvokeDynamic
javaConstant
- The constants to provide to the bound method as an argument.public InvokeDynamic withNullValue(Class<?>... type)
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)
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)
withArgument
in class InvokeDynamic
index
- The indices of the parameters that should be passed to the bootstrapped method.public InvokeDynamic.WithImplicitType withArgument(int index)
withArgument
in class InvokeDynamic
index
- The index of the parameter that should be passed to the bootstrapped method.public InvokeDynamic withThis(Class<?>... type)
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)
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()
withMethodArguments
in class InvokeDynamic
public InvokeDynamic withImplicitAndMethodArguments()
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 withField(String... fieldName)
withField
in class InvokeDynamic
fieldName
- The names of the fields to be passed to the bootstrapped method.public InvokeDynamic withEnumeration(EnumerationDescription... enumerationDescription)
withEnumeration
in class InvokeDynamic
enumerationDescription
- The enumeration values to provide to the bound method as an argument.public InvokeDynamic withField(FieldLocator.Factory fieldLocatorFactory, String... name)
withField
in class InvokeDynamic
fieldLocatorFactory
- The field locator factory to use.name
- The names of the fields to be passed to the bootstrapped method.public InvokeDynamic.WithImplicitType withField(String name)
withField
in class InvokeDynamic
name
- The names of the fields to be passed to the bootstrapped method.public InvokeDynamic.WithImplicitType withField(String name, FieldLocator.Factory fieldLocatorFactory)
withField
in class InvokeDynamic
name
- The names of the fields to be passed to the bootstrapped method.fieldLocatorFactory
- The field locator factory to use.public Implementation.Composable withAssigner(Assigner assigner, Assigner.Typing typing)
withAssigner
in class InvokeDynamic
assigner
- The assigner to use.typing
- true
if the assigner should attempt dynamic typing.public Implementation andThen(Implementation implementation)
andThen
in interface Implementation.Composable
andThen
in class InvokeDynamic
implementation
- The subsequent implementation.public InstrumentedType prepare(InstrumentedType instrumentedType)
prepare
in interface InstrumentedType.Prepareable
prepare
in class InvokeDynamic
instrumentedType
- The instrumented type in its current form.public ByteCodeAppender appender(Implementation.Target implementationTarget)
appender
in interface Implementation
appender
in class InvokeDynamic
implementationTarget
- The target of the current implementation.InstrumentedType.Prepareable.prepare(InstrumentedType)
.Copyright © 2014–2023. All rights reserved.