Package net.bytebuddy.asm
Class MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForStackManipulation
- java.lang.Object
-
- net.bytebuddy.asm.MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForStackManipulation
-
- All Implemented Interfaces:
MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping
- Enclosing interface:
- MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping
@Enhance public static class MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForStackManipulation extends java.lang.Object implements MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping
An offset mapping that resolves a given stack manipulation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForStackManipulation.Factory<T extends java.lang.annotation.Annotation>
A factory to produce an offset mapping based upon a stack manipulation..static class
MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForStackManipulation.OfAnnotationProperty<T extends java.lang.annotation.Annotation>
A factory that binds a given annotation property to the parameter.static class
MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForStackManipulation.OfDefaultValue<T extends java.lang.annotation.Annotation>
A factory that binds the default value of the annotated parameter, i.e.static class
MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForStackManipulation.OfDynamicInvocation<T extends java.lang.annotation.Annotation>
A factory that invokes a method dynamically and assignes the result to the annotated parameter.static class
MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForStackManipulation.OfSerializedConstant<T extends java.lang.annotation.Annotation>
Assigns a value to the annotated parameter that is deserialized from a given input.protected static class
MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForStackManipulation.Resolved
A resolved offset mapping for a stack manipulation.-
Nested classes/interfaces inherited from interface net.bytebuddy.asm.MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping
MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForAllArguments, MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForArgument, MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForCurrent, MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForField, MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForFieldHandle, MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForOrigin, MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForSelfCallHandle, MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForStackManipulation, MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForStubValue, MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForThisReference
-
-
Field Summary
Fields Modifier and Type Field Description private StackManipulation
stackManipulation
The stack manipulation to apply.private TypeDescription.Generic
targetType
The type of the parameter or method target that is bound by this mapping.private TypeDescription.Generic
typeDescription
The type of the value that is produced by the stack manipulation.
-
Constructor Summary
Constructors Constructor Description ForStackManipulation(StackManipulation stackManipulation, TypeDescription.Generic typeDescription, TypeDescription.Generic targetType)
Creates a new offset mapping for a stack manipulation.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <S extends java.lang.annotation.Annotation>
MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.Factory<S>of(java.lang.Class<S> annotationType, java.lang.Object value)
Resolves an offset mapping that binds the provided annotation type to a given constant value.MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.Resolved
resolve(Assigner assigner, Assigner.Typing typing, TypeDescription instrumentedType, MethodDescription instrumentedMethod)
Resolves an offset mapping for a given instrumented method.
-
-
-
Field Detail
-
stackManipulation
private final StackManipulation stackManipulation
The stack manipulation to apply.
-
typeDescription
private final TypeDescription.Generic typeDescription
The type of the value that is produced by the stack manipulation.
-
targetType
private final TypeDescription.Generic targetType
The type of the parameter or method target that is bound by this mapping.
-
-
Constructor Detail
-
ForStackManipulation
public ForStackManipulation(StackManipulation stackManipulation, TypeDescription.Generic typeDescription, TypeDescription.Generic targetType)
Creates a new offset mapping for a stack manipulation.- Parameters:
stackManipulation
- The stack manipulation to apply.typeDescription
- The type of the value that is produced by the stack manipulation.targetType
- The type of the parameter or method target that is bound by this mapping.
-
-
Method Detail
-
of
public static <S extends java.lang.annotation.Annotation> MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.Factory<S> of(java.lang.Class<S> annotationType, @MaybeNull java.lang.Object value)
Resolves an offset mapping that binds the provided annotation type to a given constant value.- Type Parameters:
S
- The type of the annotation.- Parameters:
annotationType
- The annotation type to bind.value
- The constant value being bound ornull
.- Returns:
- An appropriate factory for an offset mapping.
-
resolve
public MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.Resolved resolve(Assigner assigner, Assigner.Typing typing, TypeDescription instrumentedType, MethodDescription instrumentedMethod)
Resolves an offset mapping for a given instrumented method.- Specified by:
resolve
in interfaceMemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping
- Parameters:
assigner
- The assigner to use.typing
- The typing to use if no explicit typing is specified.instrumentedType
- The instrumented type.instrumentedMethod
- The instrumented method.- Returns:
- A resolved version of this offset mapping.
-
-