Top Description Inners Fields Constructors Methods
org.easymock.bytebuddy.implementation

public Class InvokeDynamic

extends Object
implements Composable
Class Inheritance
All Implemented Interfaces
org.easymock.bytebuddy.implementation.Implementation.Composable, org.easymock.bytebuddy.implementation.Implementation, org.easymock.bytebuddy.dynamic.scaffold.InstrumentedType.Prepareable
Known Direct Subclasses
org.easymock.bytebuddy.implementation.InvokeDynamic.AbstractDelegator
Annotations
@Enhance
Imports
edu.umd.cs.findbugs.annotations.SuppressFBWarnings, org.easymock.bytebuddy.build.HashCodeAndEqualsPlugin, org.easymock.bytebuddy.description.annotation.AnnotationDescription, .AnnotationValue, org.easymock.bytebuddy.description.enumeration.EnumerationDescription, org.easymock.bytebuddy.description.field.FieldDescription, org.easymock.bytebuddy.description.method.MethodDescription, .MethodList, .ParameterDescription, .ParameterList, org.easymock.bytebuddy.description.type.TypeDefinition, .TypeDescription, .TypeList, .TypeVariableToken, org.easymock.bytebuddy.dynamic.scaffold.FieldLocator, .InstrumentedType, .MethodGraph, org.easymock.bytebuddy.implementation.bytecode.ByteCodeAppender, .Removal, .StackManipulation, org.easymock.bytebuddy.implementation.bytecode.assign.Assigner, org.easymock.bytebuddy.implementation.bytecode.constant.*, org.easymock.bytebuddy.implementation.bytecode.member.FieldAccess, .MethodInvocation, .MethodReturn, .MethodVariableAccess, org.easymock.bytebuddy.utility.*, org.easymock.bytebuddy.jar.asm.MethodVisitor, .Opcodes, java.lang.reflect.Constructor, .Method, .Type, java.util.ArrayList, .Arrays, .Collections, .List

An implementation that applies a dynamic method invocation.

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected abstract static class
InvokeDynamic.AbstractDelegator

An abstract delegator that allows to specify a configuration for any specification of an argument.

protected class
InvokeDynamic.Appender

The byte code appender to be used by the org.easymock.bytebuddy.implementation.InvokeDynamic implementation.

protected static interface
InvokeDynamic.InvocationProvider

An invocation provider is responsible for loading the arguments of the invoked method onto the operand stack and for creating the actual invoke dynamic instruction.

protected static enum
InvokeDynamic.TerminationHandler

A termination handler is responsible to handle the return value of a method that is invoked via a org.easymock.bytebuddy.implementation.InvokeDynamic.

public static class
InvokeDynamic.WithImplicitArguments

Representation of an org.easymock.bytebuddy.implementation.InvokeDynamic implementation where the bootstrapped method is passed a this reference, if available, and any arguments of the instrumented method.

public static class
InvokeDynamic.WithImplicitTarget

Representation of an org.easymock.bytebuddy.implementation.InvokeDynamic implementation where the bootstrapped method is passed a this reference, if available, and any arguments of the instrumented method and where the invocation target is implicit.

public abstract static class
InvokeDynamic.WithImplicitType

An InvokeDynamic invocation where the last argument is assigned its implicit type.

Field Summary

Modifier and TypeField and Description
protected final List<? extends JavaConstant>
arguments

The arguments that are provided to the bootstrap method.

protected final Assigner
assigner

The assigner to be used.

protected final MethodDescription.InDefinedShape
bootstrap

The bootstrap method.

protected final InvokeDynamic.InvocationProvider
invocationProvider

The target provided that identifies the method to be bootstrapped.

protected final InvokeDynamic.TerminationHandler
terminationHandler

A handler that handles the method return.

protected final Assigner.Typing
typing

Indicates if dynamic type castings should be attempted for incompatible assignments.

Constructor Summary

AccessConstructor and Description
protected
InvokeDynamic(MethodDescription.InDefinedShape
The bootstrap method.
bootstrap
,
List<? extends JavaConstant>
The arguments that are provided to the bootstrap method.
arguments
,
InvokeDynamic.InvocationProvider
The target provided that identifies the method to be bootstrapped.
invocationProvider
,
InvokeDynamic.TerminationHandler
A handler that handles the method return.
terminationHandler
,
Assigner
The assigner to be used.
assigner
,
Assigner.Typing
Indicates if dynamic type castings should be attempted for incompatible assignments.
typing
)

Creates a new invoke dynamic implementation.

Method Summary

Modifier and TypeMethod and Description
public Implementation
andThen(Implementation
The subsequent implementation.
implementation
)

Implements org.easymock.bytebuddy.implementation.Implementation.Composable.andThen.

Appends the supplied implementation to this implementation.
public Implementation.Composable
andThen(Implementation.Composable
The subsequent composable implementation.
implementation
)

Implements org.easymock.bytebuddy.implementation.Implementation.Composable.andThen.

Appends the supplied composable implementation to this implementation.
public ByteCodeAppender
appender(Implementation.Target
The target of the current implementation.
implementationTarget
)

Implements org.easymock.bytebuddy.implementation.Implementation.appender.

Creates a byte code appender that determines the implementation of the instrumented type's methods.
public static InvokeDynamic.WithImplicitTarget

Returns:

An implementation where a this reference, if available, and all arguments of the instrumented method are passed to the bootstrapped method unless explicit parameters are specified.
bootstrap
(Method
The bootstrap method that is used to link the instrumented method.
method
,
Object...
The constant values passed to the bootstrap method. Values can be represented either as TypeDescription, as JavaConstant, as String or a primitive int, long, float or double represented as wrapper type.
constant
)

Implements the instrumented method with a dynamic method invocation which is linked at runtime using the specified bootstrap method.

public static InvokeDynamic.WithImplicitTarget

Returns:

An implementation where a this reference, if available, and all arguments of the instrumented method are passed to the bootstrapped method unless explicit parameters are specified.
bootstrap
(Method
The bootstrap method that is used to link the instrumented method.
method
,
List<?>
The constant values passed to the bootstrap method. Values can be represented either as TypeDescription, as JavaConstant, as String or a primitive int, long, float or double represented as wrapper type.
constants
)

Implements the instrumented method with a dynamic method invocation which is linked at runtime using the specified bootstrap method.

public static InvokeDynamic.WithImplicitTarget

Returns:

An implementation where a this reference, if available, and all arguments of the instrumented method are passed to the bootstrapped method unless explicit parameters are specified.
bootstrap
(Constructor<?>
The bootstrap constructor that is used to link the instrumented method.
constructor
,
Object...
The constant values passed to the bootstrap method. Values can be represented either as TypeDescription, as JavaConstant, as String or a primitive int, long, float or double represented as wrapper type.
constant
)

Implements the instrumented method with a dynamic method invocation which is linked at runtime using the specified bootstrap constructor.

public static InvokeDynamic.WithImplicitTarget

Returns:

An implementation where a this reference, if available, and all arguments of the instrumented method are passed to the bootstrapped method unless explicit parameters are specified.
bootstrap
(Constructor<?>
The bootstrap constructor that is used to link the instrumented method.
constructor
,
List<?>
The constant values passed to the bootstrap method. Values can be represented either as TypeDescription, as JavaConstant, as String or a primitive int, long, float or double represented as wrapper type.
constants
)

Implements the instrumented method with a dynamic method invocation which is linked at runtime using the specified bootstrap constructor.

public static InvokeDynamic.WithImplicitTarget

Returns:

An implementation where a this reference, if available, and all arguments of the instrumented method are passed to the bootstrapped method unless explicit parameters are specified.
bootstrap
(MethodDescription.InDefinedShape
The bootstrap method or constructor that is used to link the instrumented method.
bootstrap
,
Object...
The constant values passed to the bootstrap method. Values can be represented either as TypeDescription, as JavaConstant, as String or a primitive int, long, float or double represented as wrapper type.
constant
)

Implements the instrumented method with a dynamic method invocation which is linked at runtime using the specified bootstrap method or constructor.

public static InvokeDynamic.WithImplicitTarget

Returns:

An implementation where a this reference, if available, and all arguments of the instrumented method are passed to the bootstrapped method unless explicit parameters are specified.
bootstrap
(MethodDescription.InDefinedShape
The bootstrap method or constructor that is used to link the instrumented method.
bootstrap
,
List<?>
The constant values passed to the bootstrap method. Values can be represented either as TypeDescription, as JavaConstant, as String or a primitive int, long, float or double represented as wrapper type.
constants
)

Implements the instrumented method with a dynamic method invocation which is linked at runtime using the specified bootstrap method or constructor.

public static InvokeDynamic.WithImplicitArguments

Returns:

A builder for creating a lambda expression.
lambda
(Method
The method that implements the lambda expression.
method
,
Type
The functional interface that is an instance of the lambda expression.
functionalInterface
)

Creates a lambda expression using the JVM's lambda meta factory.

public static InvokeDynamic.WithImplicitArguments

Returns:

A builder for creating a lambda expression.
lambda
(Method
The method that implements the lambda expression.
method
,
Type
The functional interface that is an instance of the lambda expression.
functionalInterface
,
MethodGraph.Compiler
The method graph compiler to use.
methodGraphCompiler
)

Creates a lambda expression using the JVM's lambda meta factory.

public static InvokeDynamic.WithImplicitArguments

Returns:

A builder for creating a lambda expression.
lambda
(MethodDescription.InDefinedShape
The method that implements the lambda expression.
methodDescription
,
TypeDefinition
The functional interface that is an instance of the lambda expression.
functionalInterface
)

Creates a lambda expression using the JVM's lambda meta factory.

public static InvokeDynamic.WithImplicitArguments

Returns:

A builder for creating a lambda expression.
lambda
(MethodDescription.InDefinedShape
The method that implements the lambda expression.
methodDescription
,
TypeDefinition
The functional interface that is an instance of the lambda expression.
functionalInterface
,
MethodGraph.Compiler
The method graph compiler to use.
methodGraphCompiler
)

Creates a lambda expression using the JVM's lambda meta factory.

public InstrumentedType
prepare(InstrumentedType
The instrumented type in its current form.
instrumentedType
)

Implements org.easymock.bytebuddy.dynamic.scaffold.InstrumentedType.Prepareable.prepare.

Prepares a given instrumented type.
public InvokeDynamic

Returns:

This invoke dynamic implementation where the bootstrapped method is passed the specified arguments.
withArgument
(int...
The indices of the parameters that should be passed to the bootstrapped method.
index
)

Passes parameters of the instrumented method to the bootstrapped method.

public InvokeDynamic.WithImplicitType

Returns:

This invoke dynamic implementation where the bootstrapped method is passed the specified argument with its implicit type.
withArgument
(int
The index of the parameter that should be passed to the bootstrapped method.
index
)

Passes a parameter of the instrumented method to the bootstrapped method.

public Implementation.Composable

Returns:

The invoke dynamic instruction where the given assigner and dynamic-typing directive are applied.
withAssigner
(Assigner
The assigner to use.
assigner
,
Assigner.Typing
true if the assigner should attempt dynamic typing.
typing
)

Instructs this implementation to use the provided assigner and decides if the assigner should apply dynamic typing.

public InvokeDynamic

Returns:

This invoke dynamic implementation where the bootstrapped method is passed the specified arguments.
withBooleanValue
(boolean...
The arguments to pass to the bootstrapped method.
value
)

Requires the bootstrap method to bootstrap a method that takes the specified boolean arguments as its next parameters.

public InvokeDynamic

Returns:

This invoke dynamic implementation where the bootstrapped method is passed the specified arguments.
withByteValue
(byte...
The arguments to pass to the bootstrapped method.
value
)

Requires the bootstrap method to bootstrap a method that takes the specified byte arguments as its next parameters.

public InvokeDynamic

Returns:

This invoke dynamic implementation where the bootstrapped method is passed the specified arguments.
withCharacterValue
(char...
The arguments to pass to the bootstrapped method.
value
)

Requires the bootstrap method to bootstrap a method that takes the specified char arguments as its next parameters.

public InvokeDynamic

Returns:

This invoke dynamic implementation where the bootstrapped method is passed the specified arguments.
withDoubleValue
(double...
The arguments to pass to the bootstrapped method.
value
)

Requires the bootstrap method to bootstrap a method that takes the specified double arguments as its next parameters.

public InvokeDynamic

Returns:

This invoke dynamic implementation where the bootstrapped method is passed the specified enumerations.
withEnumeration
(EnumerationDescription...
The enumeration values to provide to the bound method as an argument.
enumerationDescription
)

Hands the provided enumerations to the dynamically bound method.

public InvokeDynamic

Returns:

This invoke dynamic implementation where the bootstrapped method is passed the specified arguments.
withField
(String...
The names of the fields to be passed to the bootstrapped method.
name
)

Passes the values of the specified fields to the bootstrap method.

public InvokeDynamic

Returns:

This invoke dynamic implementation where the bootstrapped method is passed the specified arguments.
withField
(FieldLocator.Factory
The field locator factory to use.
fieldLocatorFactory
,
String...
The names of the fields to be passed to the bootstrapped method.
name
)

Passes the values of the specified fields to the bootstrap method.

public InvokeDynamic.WithImplicitType

Returns:

This invoke dynamic implementation where the bootstrapped method is passed the specified arguments.
withField
(String
The names of the fields to be passed to the bootstrapped method.
name
)

Passes the values of the specified fields to the bootstrap method.

public InvokeDynamic.WithImplicitType

Returns:

This invoke dynamic implementation where the bootstrapped method is passed the specified arguments.
withField
(String
The names of the fields to be passed to the bootstrapped method.
name
,
FieldLocator.Factory
The field locator factory to use.
fieldLocatorFactory
)

Passes the values of the specified fields to the bootstrap method.

public InvokeDynamic

Returns:

This invoke dynamic implementation where the bootstrapped method is passed the specified arguments.
withFloatValue
(float...
The arguments to pass to the bootstrapped method.
value
)

Requires the bootstrap method to bootstrap a method that takes the specified float arguments as its next parameters.

public InvokeDynamic

Returns:

This invoke dynamic implementation with a potential this reference and all parameters of the instrumented method added.
withImplicitAndMethodArguments
()

Adds a potential this reference and all method arguments to the the bootstrapped method.

public InvokeDynamic

Returns:

This invoke dynamic implementation where the bootstrapped method is passed the specified Java instance.
withInstance
(ConstantValue...
The constants to provide to the bound method as an argument.
constant
)

Hands the provided Java instance to the dynamically bound method.

public InvokeDynamic

Returns:

This invoke dynamic implementation where the bootstrapped method is passed the specified Java instance.
withInstance
(JavaConstant...
The constants to provide to the bound method as an argument.
constant
)

Hands the provided Java instance to the dynamically bound method.

public InvokeDynamic

Returns:

This invoke dynamic implementation where the bootstrapped method is passed the specified arguments.
withIntegerValue
(int...
The arguments to pass to the bootstrapped method.
value
)

Requires the bootstrap method to bootstrap a method that takes the specified int arguments as its next parameters.

public InvokeDynamic

Returns:

This invoke dynamic implementation where the bootstrapped method is passed the specified arguments.
withLongValue
(long...
The arguments to pass to the bootstrapped method.
value
)

Requires the bootstrap method to bootstrap a method that takes the specified long arguments as its next parameters.

public InvokeDynamic

Returns:

This invoke dynamic implementation with all parameters of the instrumented method added.
withMethodArguments
()

Adds all method arguments to the the bootstrapped method.

public InvokeDynamic

Returns:

This invoke dynamic implementation where the bootstrapped method is passed the specified arguments.
withNullValue
(Class<?>...
The type that the null values should represent.
type
)

Passes null values of the given types to the bootstrapped method.

public InvokeDynamic

Returns:

This invoke dynamic implementation where the bootstrapped method is passed the specified arguments.
withNullValue
(TypeDescription...
The type that the null values should represent.
typeDescription
)

Passes null values of the given types to the bootstrapped method.

public InvokeDynamic.WithImplicitType

Returns:

This invoke dynamic implementation where the bootstrapped method is passed the specified arguments.
withReference
(Object
The arguments to pass to the bootstrapped method.
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.

public InvokeDynamic

Returns:

This invoke dynamic implementation where the bootstrapped method is passed the specified arguments.
withReference
(Object...
The arguments to pass to the bootstrapped method.
value
)

Requires the bootstrap method to bootstrap a method that takes the specified arguments as its next parameters.

public InvokeDynamic

Returns:

This invoke dynamic implementation where the bootstrapped method is passed the specified arguments.
withShortValue
(short...
The arguments to pass to the bootstrapped method.
value
)

Requires the bootstrap method to bootstrap a method that takes the specified short arguments as its next parameters.

public InvokeDynamic

Returns:

This implementation where this references are passed as the next arguments.
withThis
(Class<?>...
The types as which the this reference of the intercepted method should be masked.
type
)

Passes references to this onto the operand stack where the instance is represented as the given types.

public InvokeDynamic

Returns:

This implementation where this references are passed as the next arguments.
withThis
(TypeDescription...
The types as which the this reference of the intercepted method should be masked.
typeDescription
)

Passes references to this onto the operand stack where the instance is represented as the given types.

public InvokeDynamic

Returns:

This invoke dynamic implementation where the bootstrapped method is passed the specified type.
withType
(TypeDescription...
The classes to provide to the bound method as an argument.
typeDescription
)

Hands the provided types to the dynamically bound method.

public InvokeDynamic

Returns:

This invoke dynamic implementation where the bootstrapped method is passed the specified arguments.
withValue
(Object...
The arguments to pass to the bootstrapped method.
value
)

Requires the bootstrap method to bootstrap a method that takes the specified arguments as its next parameters.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait