Package | Description |
---|---|
net.bytebuddy.agent.builder |
An agent builder is used to easily implement load-time class-transformations using a Java agent.
|
net.bytebuddy.asm |
The ASM package contains classes that are meant for direct interaction with the ASM API.
|
net.bytebuddy.dynamic.scaffold.inline |
All classes and types in this package are related to creating a
DynamicType by
enhancing a given type. |
net.bytebuddy.implementation |
The implementation package contains any logic for intercepting method calls.
|
net.bytebuddy.implementation.bytecode.constant |
StackManipulation s in this package are responsible for
creating compile-time constants and pushing them onto the operand stack. |
net.bytebuddy.implementation.bytecode.member |
StackManipulation s of this package are responsible for
accessing type or method members, i.e. |
net.bytebuddy.utility |
This package contains utility classes for common use within any Byte Buddy logic.
|
Constructor and Description |
---|
LambdaMethodImplementation(TypeDescription targetType,
JavaConstant.MethodHandle targetMethod,
JavaConstant.MethodType specializedLambdaMethod)
Creates a implementation of a lambda expression's functional method.
|
SerializationImplementation(TypeDescription targetType,
TypeDescription lambdaType,
String lambdaMethodName,
JavaConstant.MethodType lambdaMethod,
JavaConstant.MethodHandle targetMethod,
JavaConstant.MethodType specializedMethod)
Creates a new implementation for a serializable's lambda expression's
writeReplace method. |
Modifier and Type | Method and Description |
---|---|
protected abstract JavaConstant.MethodHandle |
MemberSubstitution.Source.handle(JavaConstant.MethodHandle methodHandle,
MethodDescription instrumentedMethod)
Resolves a method handle.
|
protected abstract JavaConstant.MethodHandle |
MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForFieldHandle.Access.resolve(FieldDescription.InDefinedShape fieldDescription)
Resolves a handle for the represented field access.
|
protected abstract JavaConstant.MethodHandle |
Advice.OffsetMapping.ForFieldHandle.Access.resolve(FieldDescription.InDefinedShape fieldDescription)
Returns the appropriate method handle.
|
Modifier and Type | Method and Description |
---|---|
StackManipulation |
MemberSubstitution.Substitution.Chain.Step.ForDelegation.Dispatcher.Resolved.apply(MemberSubstitution.Target target,
JavaConstant.MethodHandle methodHandle)
Creates a stack manipulation for a given substitution target.
|
StackManipulation |
MemberSubstitution.Substitution.Chain.Step.ForDelegation.Dispatcher.ForRegularInvocation.apply(MemberSubstitution.Target target,
JavaConstant.MethodHandle methodHandle)
Creates a stack manipulation for a given substitution target.
|
StackManipulation |
MemberSubstitution.Substitution.Chain.Step.ForDelegation.Dispatcher.ForDynamicInvocation.Resolved.apply(MemberSubstitution.Target target,
JavaConstant.MethodHandle methodHandle)
Creates a stack manipulation for a given substitution target.
|
StackManipulation |
MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.Resolved.apply(MemberSubstitution.Target target,
TypeList.Generic parameters,
TypeDescription.Generic result,
TypeDescription.Generic current,
JavaConstant.MethodHandle methodHandle,
Map<Integer,Integer> offsets,
int offset)
Applies this offset mapping.
|
StackManipulation |
MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.Resolved.ForStackManipulation.apply(MemberSubstitution.Target target,
TypeList.Generic parameters,
TypeDescription.Generic result,
TypeDescription.Generic current,
JavaConstant.MethodHandle methodHandle,
Map<Integer,Integer> offsets,
int offset)
Applies this offset mapping.
|
StackManipulation |
MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForStackManipulation.Resolved.apply(MemberSubstitution.Target target,
TypeList.Generic parameters,
TypeDescription.Generic result,
TypeDescription.Generic current,
JavaConstant.MethodHandle methodHandle,
Map<Integer,Integer> offsets,
int offset)
Applies this offset mapping.
|
StackManipulation |
MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForArgument.Resolved.apply(MemberSubstitution.Target target,
TypeList.Generic parameters,
TypeDescription.Generic result,
TypeDescription.Generic current,
JavaConstant.MethodHandle methodHandle,
Map<Integer,Integer> offsets,
int offset)
Applies this offset mapping.
|
StackManipulation |
MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForThisReference.Resolved.apply(MemberSubstitution.Target target,
TypeList.Generic parameters,
TypeDescription.Generic result,
TypeDescription.Generic current,
JavaConstant.MethodHandle methodHandle,
Map<Integer,Integer> offsets,
int offset)
Applies this offset mapping.
|
StackManipulation |
MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForAllArguments.Resolved.apply(MemberSubstitution.Target target,
TypeList.Generic parameters,
TypeDescription.Generic result,
TypeDescription.Generic current,
JavaConstant.MethodHandle methodHandle,
Map<Integer,Integer> offsets,
int offset)
Applies this offset mapping.
|
StackManipulation |
MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForSelfCallHandle.Bound.apply(MemberSubstitution.Target target,
TypeList.Generic parameters,
TypeDescription.Generic result,
TypeDescription.Generic current,
JavaConstant.MethodHandle methodHandle,
Map<Integer,Integer> offsets,
int offset)
Applies this offset mapping.
|
StackManipulation |
MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForSelfCallHandle.Unbound.apply(MemberSubstitution.Target target,
TypeList.Generic parameters,
TypeDescription.Generic result,
TypeDescription.Generic current,
JavaConstant.MethodHandle methodHandle,
Map<Integer,Integer> offsets,
int offset)
Applies this offset mapping.
|
StackManipulation |
MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForOrigin.Resolved.apply(MemberSubstitution.Target target,
TypeList.Generic parameters,
TypeDescription.Generic result,
TypeDescription.Generic current,
JavaConstant.MethodHandle methodHandle,
Map<Integer,Integer> offsets,
int offset)
Applies this offset mapping.
|
StackManipulation |
MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForStubValue.Resolved.apply(MemberSubstitution.Target target,
TypeList.Generic parameters,
TypeDescription.Generic result,
TypeDescription.Generic current,
JavaConstant.MethodHandle methodHandle,
Map<Integer,Integer> offsets,
int offset)
Applies this offset mapping.
|
StackManipulation |
MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForCurrent.Resolved.apply(MemberSubstitution.Target target,
TypeList.Generic parameters,
TypeDescription.Generic result,
TypeDescription.Generic current,
JavaConstant.MethodHandle methodHandle,
Map<Integer,Integer> offsets,
int offset)
Applies this offset mapping.
|
MemberSubstitution.Replacement.Binding |
MemberSubstitution.Replacement.bind(TypeDescription instrumentedType,
MethodDescription instrumentedMethod,
JavaConstant.MethodHandle methodHandle,
JavaConstant.MethodType methodType,
String name,
List<JavaConstant> constants)
Binds this replacement for a dynamic method invocation that was discovered.
|
MemberSubstitution.Replacement.Binding |
MemberSubstitution.Replacement.NoOp.bind(TypeDescription instrumentedType,
MethodDescription instrumentedMethod,
JavaConstant.MethodHandle methodHandle,
JavaConstant.MethodType methodType,
String name,
List<JavaConstant> constants)
Binds this replacement for a dynamic method invocation that was discovered.
|
MemberSubstitution.Replacement.Binding |
MemberSubstitution.Replacement.ForElementMatchers.bind(TypeDescription instrumentedType,
MethodDescription instrumentedMethod,
JavaConstant.MethodHandle methodHandle,
JavaConstant.MethodType methodType,
String name,
List<JavaConstant> constants)
Binds this replacement for a dynamic method invocation that was discovered.
|
MemberSubstitution.Replacement.Binding |
MemberSubstitution.Replacement.ForDynamicInvocation.bind(TypeDescription instrumentedType,
MethodDescription instrumentedMethod,
JavaConstant.MethodHandle methodHandle,
JavaConstant.MethodType methodType,
String name,
List<JavaConstant> constants)
Binds this replacement for a dynamic method invocation that was discovered.
|
MemberSubstitution.Replacement.Binding |
MemberSubstitution.Replacement.ForFirstBinding.bind(TypeDescription instrumentedType,
MethodDescription instrumentedMethod,
JavaConstant.MethodHandle methodHandle,
JavaConstant.MethodType methodType,
String name,
List<JavaConstant> constants)
Binds this replacement for a dynamic method invocation that was discovered.
|
protected abstract JavaConstant.MethodHandle |
MemberSubstitution.Source.handle(JavaConstant.MethodHandle methodHandle,
MethodDescription instrumentedMethod)
Resolves a method handle.
|
List<JavaConstant> |
MemberSubstitution.Substitution.Chain.Step.ForDelegation.BootstrapArgumentResolver.Resolved.make(MemberSubstitution.Target target,
JavaConstant.MethodHandle methodHandle)
Returns the constant values to supply to the bootstrap method.
|
List<JavaConstant> |
MemberSubstitution.Substitution.Chain.Step.ForDelegation.BootstrapArgumentResolver.ForDefaultValues.Resolved.make(MemberSubstitution.Target target,
JavaConstant.MethodHandle methodHandle)
Returns the constant values to supply to the bootstrap method.
|
StackManipulation |
MemberSubstitution.Replacement.Binding.make(TypeList.Generic parameters,
TypeDescription.Generic result,
JavaConstant.MethodHandle methodHandle,
StackManipulation stackManipulation,
int freeOffset)
Creates a stack manipulation that represents the substitution.
|
StackManipulation |
MemberSubstitution.Replacement.Binding.Unresolved.make(TypeList.Generic parameters,
TypeDescription.Generic result,
JavaConstant.MethodHandle methodHandle,
StackManipulation stackManipulation,
int freeOffset)
Creates a stack manipulation that represents the substitution.
|
StackManipulation |
MemberSubstitution.Replacement.Binding.ForMember.make(TypeList.Generic parameters,
TypeDescription.Generic result,
JavaConstant.MethodHandle methodHandle,
StackManipulation stackManipulation,
int freeOffset)
Creates a stack manipulation that represents the substitution.
|
StackManipulation |
MemberSubstitution.Replacement.Binding.ForDynamicInvocation.make(TypeList.Generic parameters,
TypeDescription.Generic result,
JavaConstant.MethodHandle methodHandle,
StackManipulation stackManipulation,
int freeOffset)
Creates a stack manipulation that represents the substitution.
|
boolean |
MemberSubstitution.LambdaMetaFactoryMatcher.matches(JavaConstant.MethodHandle target)
Matches a target against this element matcher.
|
StackManipulation |
MemberSubstitution.Substitution.resolve(MemberSubstitution.Target target,
TypeList.Generic parameters,
TypeDescription.Generic result,
JavaConstant.MethodHandle methodHandle,
StackManipulation stackManipulation,
int freeOffset)
Resolves this substitution into a stack manipulation.
|
StackManipulation |
MemberSubstitution.Substitution.Stubbing.resolve(MemberSubstitution.Target target,
TypeList.Generic parameters,
TypeDescription.Generic result,
JavaConstant.MethodHandle methodHandle,
StackManipulation stackManipulation,
int freeOffset)
Resolves this substitution into a stack manipulation.
|
StackManipulation |
MemberSubstitution.Substitution.ForValue.resolve(MemberSubstitution.Target target,
TypeList.Generic parameters,
TypeDescription.Generic result,
JavaConstant.MethodHandle methodHandle,
StackManipulation stackManipulation,
int freeOffset)
Resolves this substitution into a stack manipulation.
|
StackManipulation |
MemberSubstitution.Substitution.ForFieldAccess.resolve(MemberSubstitution.Target target,
TypeList.Generic parameters,
TypeDescription.Generic result,
JavaConstant.MethodHandle methodHandle,
StackManipulation stackManipulation,
int freeOffset)
Resolves this substitution into a stack manipulation.
|
StackManipulation |
MemberSubstitution.Substitution.ForMethodInvocation.resolve(MemberSubstitution.Target target,
TypeList.Generic parameters,
TypeDescription.Generic result,
JavaConstant.MethodHandle methodHandle,
StackManipulation stackManipulation,
int freeOffset)
Resolves this substitution into a stack manipulation.
|
StackManipulation |
MemberSubstitution.Substitution.Chain.resolve(MemberSubstitution.Target target,
TypeList.Generic parameters,
TypeDescription.Generic result,
JavaConstant.MethodHandle methodHandle,
StackManipulation stackManipulation,
int freeOffset)
Resolves this substitution into a stack manipulation.
|
MemberSubstitution.Substitution.Chain.Step.Resolution |
MemberSubstitution.Substitution.Chain.Step.resolve(MemberSubstitution.Target target,
TypeList.Generic parameters,
TypeDescription.Generic result,
JavaConstant.MethodHandle methodHandle,
StackManipulation stackManipulation,
TypeDescription.Generic current,
Map<Integer,Integer> offsets,
int freeOffset)
Resolves this step of a substitution chain.
|
MemberSubstitution.Substitution.Chain.Step.Resolution |
MemberSubstitution.Substitution.Chain.Step.OfOriginalExpression.resolve(MemberSubstitution.Target target,
TypeList.Generic parameters,
TypeDescription.Generic result,
JavaConstant.MethodHandle methodHandle,
StackManipulation stackManipulation,
TypeDescription.Generic current,
Map<Integer,Integer> offsets,
int freeOffset)
Resolves this step of a substitution chain.
|
MemberSubstitution.Substitution.Chain.Step.Resolution |
MemberSubstitution.Substitution.Chain.Step.Simple.resolve(MemberSubstitution.Target target,
TypeList.Generic parameters,
TypeDescription.Generic result,
JavaConstant.MethodHandle methodHandle,
StackManipulation stackManipulation,
TypeDescription.Generic current,
Map<Integer,Integer> offsets,
int freeOffset)
Resolves this step of a substitution chain.
|
MemberSubstitution.Substitution.Chain.Step.Resolution |
MemberSubstitution.Substitution.Chain.Step.ForAssignment.resolve(MemberSubstitution.Target target,
TypeList.Generic parameters,
TypeDescription.Generic result,
JavaConstant.MethodHandle methodHandle,
StackManipulation stackManipulation,
TypeDescription.Generic current,
Map<Integer,Integer> offsets,
int freeOffset)
Resolves this step of a substitution chain.
|
MemberSubstitution.Substitution.Chain.Step.Resolution |
MemberSubstitution.Substitution.Chain.Step.ForArgumentSubstitution.resolve(MemberSubstitution.Target target,
TypeList.Generic parameters,
TypeDescription.Generic result,
JavaConstant.MethodHandle methodHandle,
StackManipulation stackManipulation,
TypeDescription.Generic current,
Map<Integer,Integer> offsets,
int freeOffset)
Resolves this step of a substitution chain.
|
MemberSubstitution.Substitution.Chain.Step.Resolution |
MemberSubstitution.Substitution.Chain.Step.ForArgumentLoading.resolve(MemberSubstitution.Target target,
TypeList.Generic parameters,
TypeDescription.Generic result,
JavaConstant.MethodHandle methodHandle,
StackManipulation stackManipulation,
TypeDescription.Generic current,
Map<Integer,Integer> offsets,
int freeOffset)
Resolves this step of a substitution chain.
|
MemberSubstitution.Substitution.Chain.Step.Resolution |
MemberSubstitution.Substitution.Chain.Step.ForField.resolve(MemberSubstitution.Target target,
TypeList.Generic parameters,
TypeDescription.Generic result,
JavaConstant.MethodHandle methodHandle,
StackManipulation stackManipulation,
TypeDescription.Generic current,
Map<Integer,Integer> offsets,
int freeOffset)
Resolves this step of a substitution chain.
|
MemberSubstitution.Substitution.Chain.Step.Resolution |
MemberSubstitution.Substitution.Chain.Step.ForInvocation.resolve(MemberSubstitution.Target target,
TypeList.Generic parameters,
TypeDescription.Generic result,
JavaConstant.MethodHandle methodHandle,
StackManipulation stackManipulation,
TypeDescription.Generic current,
Map<Integer,Integer> offsets,
int freeOffset)
Resolves this step of a substitution chain.
|
MemberSubstitution.Substitution.Chain.Step.Resolution |
MemberSubstitution.Substitution.Chain.Step.ForDelegation.resolve(MemberSubstitution.Target target,
TypeList.Generic parameters,
TypeDescription.Generic result,
JavaConstant.MethodHandle methodHandle,
StackManipulation stackManipulation,
TypeDescription.Generic current,
Map<Integer,Integer> offsets,
int freeOffset)
Resolves this step of a substitution chain.
|
Modifier and Type | Method and Description |
---|---|
MemberSubstitution.WithoutSpecification.ForMatchedDynamicInvocation |
MemberSubstitution.dynamic(ElementMatcher<? super JavaConstant.MethodHandle> matcher)
Matches invokedynamic instructions that are dispatched for the supplied method handle.
|
Constructor and Description |
---|
Factory(ElementMatcher<? super JavaConstant.MethodHandle> handleMatcher,
ElementMatcher.Junction<? super String> nameMatcher,
ElementMatcher.Junction<? super JavaConstant.MethodType> typeMatcher,
ElementMatcher.Junction<? super List<JavaConstant>> argumentsMatcher,
MemberSubstitution.Substitution.Factory substitutionFactory)
Creates a factory for a replacement for a replacement for an invokedynamic instruction.
|
ForDynamicInvocation(ElementMatcher<? super JavaConstant.MethodHandle> handleMatcher,
ElementMatcher.Junction<? super String> nameMatcher,
ElementMatcher.Junction<? super JavaConstant.MethodType> typeMatcher,
ElementMatcher.Junction<? super List<JavaConstant>> argumentsMatcher,
MemberSubstitution.Substitution substitution)
Creates a replacement for an invokedynamic instruction.
|
ForMatchedDynamicInvocation(MethodGraph.Compiler methodGraphCompiler,
MemberSubstitution.TypePoolResolver typePoolResolver,
boolean strict,
boolean failIfNoMatch,
MemberSubstitution.Replacement.Factory replacementFactory,
ElementMatcher<? super JavaConstant.MethodHandle> handleMatcher,
ElementMatcher.Junction<? super String> nameMatcher,
ElementMatcher.Junction<? super JavaConstant.MethodType> typeMatcher,
ElementMatcher.Junction<? super List<? extends JavaConstant>> argumentsMatcher)
Creates a member substitution for an invokedynamic instruction.
|
Modifier and Type | Method and Description |
---|---|
JavaConstant.MethodHandle |
RebaseImplementationTarget.RebasedMethodInvocation.toMethodHandle() |
Modifier and Type | Method and Description |
---|---|
JavaConstant.MethodHandle |
Implementation.SpecialMethodInvocation.toMethodHandle()
Returns a method handle representing this special method invocation.
|
JavaConstant.MethodHandle |
Implementation.SpecialMethodInvocation.Illegal.toMethodHandle() |
JavaConstant.MethodHandle |
Implementation.SpecialMethodInvocation.Simple.toMethodHandle()
Returns a method handle representing this special method invocation.
|
Modifier and Type | Method and Description |
---|---|
Handle |
JavaConstantValue.Visitor.onMethodHandle(JavaConstant.MethodHandle constant)
Invoked on a constant that represents a
JavaConstant.MethodHandle . |
Constructor and Description |
---|
Invokedynamic(String name,
JavaConstant.MethodType type,
JavaConstant.MethodHandle bootstrap,
List<? extends JavaConstant> arguments)
Creates a stack manipulation for a bootstrap method.
|
Modifier and Type | Method and Description |
---|---|
JavaConstant.MethodHandle |
JavaConstant.Dynamic.getBootstrap()
Returns a handle representation of the bootstrap method.
|
static JavaConstant.MethodHandle |
JavaConstant.MethodHandle.of(Constructor<?> constructor)
Creates a method handle representation of the given constructor.
|
static JavaConstant.MethodHandle |
JavaConstant.MethodHandle.of(Method method)
Creates a method handle representation of the given method.
|
static JavaConstant.MethodHandle |
JavaConstant.MethodHandle.of(MethodDescription.InDefinedShape methodDescription)
Creates a method handle representation of the given method.
|
static JavaConstant.MethodHandle |
JavaConstant.MethodHandle.ofAsm(TypePool typePool,
Handle handle)
Resolves an ASM
Handle to a JavaConstant.MethodHandle . |
static JavaConstant.MethodHandle |
JavaConstant.MethodHandle.ofGetter(Field field)
Returns a method handle for a setter of the given field.
|
static JavaConstant.MethodHandle |
JavaConstant.MethodHandle.ofGetter(FieldDescription.InDefinedShape fieldDescription)
Returns a method handle for a setter of the given field.
|
static JavaConstant.MethodHandle |
JavaConstant.MethodHandle.ofLoaded(Object methodHandle)
Creates a method handles representation of a loaded method handle which is analyzed using a public
MethodHandles.Lookup object. |
static JavaConstant.MethodHandle |
JavaConstant.MethodHandle.ofLoaded(Object methodHandle,
Object lookup)
Creates a method handles representation of a loaded method handle which is analyzed using the given lookup context.
|
static JavaConstant.MethodHandle |
JavaConstant.MethodHandle.ofSetter(Field field)
Returns a method handle for a getter of the given field.
|
static JavaConstant.MethodHandle |
JavaConstant.MethodHandle.ofSetter(FieldDescription.InDefinedShape fieldDescription)
Returns a method handle for a getter of the given field.
|
static JavaConstant.MethodHandle |
JavaConstant.MethodHandle.ofSpecial(Method method,
Class<?> type)
Creates a method handle representation of the given method for an explicit special method invocation of an otherwise virtual method.
|
static JavaConstant.MethodHandle |
JavaConstant.MethodHandle.ofSpecial(MethodDescription.InDefinedShape methodDescription,
TypeDescription typeDescription)
Creates a method handle representation of the given method for an explicit special method invocation of an otherwise virtual method.
|
Modifier and Type | Method and Description |
---|---|
T |
JavaConstant.Visitor.onMethodHandle(JavaConstant.MethodHandle constant)
Invoked on a constant that represents a
JavaConstant.MethodHandle . |
JavaConstant |
JavaConstant.Visitor.NoOp.onMethodHandle(JavaConstant.MethodHandle constant)
Invoked on a constant that represents a
JavaConstant.MethodHandle . |
Constructor and Description |
---|
Dynamic(String name,
TypeDescription typeDescription,
JavaConstant.MethodHandle bootstrap,
List<JavaConstant> arguments)
Creates a dynamic resolved constant.
|
Copyright © 2014–2025. All rights reserved.