Package net.bytebuddy.asm
Class MemberSubstitution.Substitution.Chain.Step.Simple
java.lang.Object
net.bytebuddy.asm.MemberSubstitution.Substitution.Chain.Step.Simple
- All Implemented Interfaces:
MemberSubstitution.Substitution.Chain.Step
,MemberSubstitution.Substitution.Chain.Step.Factory
,MemberSubstitution.Substitution.Chain.Step.Resolution
- Enclosing interface:
MemberSubstitution.Substitution.Chain.Step
@Enhance
public static class MemberSubstitution.Substitution.Chain.Step.Simple
extends Object
implements MemberSubstitution.Substitution.Chain.Step, MemberSubstitution.Substitution.Chain.Step.Resolution, MemberSubstitution.Substitution.Chain.Step.Factory
A simple substitution step within a substitution chain.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.asm.MemberSubstitution.Substitution.Chain.Step
MemberSubstitution.Substitution.Chain.Step.Factory, MemberSubstitution.Substitution.Chain.Step.ForArgumentLoading, MemberSubstitution.Substitution.Chain.Step.ForArgumentSubstitution, MemberSubstitution.Substitution.Chain.Step.ForAssignment, MemberSubstitution.Substitution.Chain.Step.ForDelegation, MemberSubstitution.Substitution.Chain.Step.ForField, MemberSubstitution.Substitution.Chain.Step.ForInvocation, MemberSubstitution.Substitution.Chain.Step.OfOriginalExpression, MemberSubstitution.Substitution.Chain.Step.Resolution, MemberSubstitution.Substitution.Chain.Step.Simple
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final TypeDescription.Generic
The resulting type of applying the stack manipulation.private final StackManipulation
The stack manipulation to apply. -
Constructor Summary
ConstructorsConstructorDescriptionSimple
(StackManipulation stackManipulation, Type resultType) Creates a new simple substitution step.Simple
(StackManipulation stackManipulation, TypeDescription.Generic resultType) Creates a new simple substitution step. -
Method Summary
Modifier and TypeMethodDescriptionReturns the resulting type of the substitution orvoid
if no resulting value is applied.Returns the stack manipulation to apply the substitution.make
(Assigner assigner, Assigner.Typing typing, TypeDescription instrumentedType, MethodDescription instrumentedMethod) Creates a substitution step for an instrumented method.Resolves a compile-time constant as the next step value.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.
-
Field Details
-
stackManipulation
The stack manipulation to apply. -
resultType
The resulting type of applying the stack manipulation.
-
-
Constructor Details
-
Simple
Creates a new simple substitution step.- Parameters:
stackManipulation
- The stack manipulation to apply.resultType
- The resulting type of applying the stack manipulation.
-
Simple
Creates a new simple substitution step.- Parameters:
stackManipulation
- The stack manipulation to apply.resultType
- The resulting type of applying the stack manipulation.
-
-
Method Details
-
of
Resolves a compile-time constant as the next step value.- Parameters:
value
- The compile-time constant to resolve.- Returns:
- An appropriate step factory.
-
make
public MemberSubstitution.Substitution.Chain.Step make(Assigner assigner, Assigner.Typing typing, TypeDescription instrumentedType, MethodDescription instrumentedMethod) Creates a substitution step for an instrumented method.- Specified by:
make
in interfaceMemberSubstitution.Substitution.Chain.Step.Factory
- Parameters:
assigner
- The assigner to use.typing
- The typing to use.instrumentedType
- The instrumented type.instrumentedMethod
- The instrumented method.- Returns:
- The substitution step to apply.
-
resolve
public MemberSubstitution.Substitution.Chain.Step.Resolution 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.- Specified by:
resolve
in interfaceMemberSubstitution.Substitution.Chain.Step
- Parameters:
target
- The target member of invokedynamic invocation.parameters
- The parameters of the substituted element.result
- The resulting type of the substituted element.methodHandle
- A method handle of the stackManipulation invocation that is being substituted.stackManipulation
- The byte code instruction that is being substituted.current
- The current type of the applied substitution that is the top element on the operand stack.offsets
- The arguments of the substituted byte code element mapped to their local variable offsets.freeOffset
- The first free offset in the local variable array.- Returns:
- A resolved substitution step for the supplied inputs.
-
getStackManipulation
Returns the stack manipulation to apply the substitution.- Specified by:
getStackManipulation
in interfaceMemberSubstitution.Substitution.Chain.Step.Resolution
- Returns:
- The stack manipulation to apply the substitution.
-
getResultType
Returns the resulting type of the substitution orvoid
if no resulting value is applied.- Specified by:
getResultType
in interfaceMemberSubstitution.Substitution.Chain.Step.Resolution
- Returns:
- The resulting type of the substitution or
void
if no resulting value is applied.
-