Package net.bytebuddy.asm
Class Advice.OffsetMapping.Target.ForStackManipulation
- java.lang.Object
-
- net.bytebuddy.asm.Advice.OffsetMapping.Target.ForStackManipulation
-
- All Implemented Interfaces:
Advice.OffsetMapping.Target
- Enclosing interface:
- Advice.OffsetMapping.Target
@Enhance public static class Advice.OffsetMapping.Target.ForStackManipulation extends java.lang.Object implements Advice.OffsetMapping.Target
A target for an offset mapping that represents a read-only stack manipulation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAdvice.OffsetMapping.Target.ForStackManipulation.WritableA constant value that can be written to.-
Nested classes/interfaces inherited from interface net.bytebuddy.asm.Advice.OffsetMapping.Target
Advice.OffsetMapping.Target.AbstractReadOnlyAdapter, Advice.OffsetMapping.Target.ForArray, Advice.OffsetMapping.Target.ForDefaultValue, Advice.OffsetMapping.Target.ForField, Advice.OffsetMapping.Target.ForStackManipulation, Advice.OffsetMapping.Target.ForVariable
-
-
Field Summary
Fields Modifier and Type Field Description private StackManipulationstackManipulationThe represented stack manipulation.
-
Constructor Summary
Constructors Constructor Description ForStackManipulation(StackManipulation stackManipulation)Creates a new target for an offset mapping for a stack manipulation.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Advice.OffsetMapping.Targetof(java.lang.Object value)Creates a target for an offset mapping for a constant value ornull.static Advice.OffsetMapping.Targetof(MethodDescription.InDefinedShape methodDescription)Creates a target for aMethodorConstructorconstant.static Advice.OffsetMapping.Targetof(TypeDescription typeDescription)Creates a target for an offset mapping for a type constant.StackManipulationresolveIncrement(int value)Resolves an increment instruction.StackManipulationresolveRead()Resolves a read instruction.StackManipulationresolveWrite()Resolves a write instruction.
-
-
-
Field Detail
-
stackManipulation
private final StackManipulation stackManipulation
The represented stack manipulation.
-
-
Constructor Detail
-
ForStackManipulation
public ForStackManipulation(StackManipulation stackManipulation)
Creates a new target for an offset mapping for a stack manipulation.- Parameters:
stackManipulation- The represented stack manipulation.
-
-
Method Detail
-
of
public static Advice.OffsetMapping.Target of(MethodDescription.InDefinedShape methodDescription)
Creates a target for aMethodorConstructorconstant.- Parameters:
methodDescription- The method or constructor to represent.- Returns:
- A mapping for a method or constructor constant.
-
of
public static Advice.OffsetMapping.Target of(TypeDescription typeDescription)
Creates a target for an offset mapping for a type constant.- Parameters:
typeDescription- The type constant to represent.- Returns:
- A mapping for a type constant.
-
of
public static Advice.OffsetMapping.Target of(@MaybeNull java.lang.Object value)
Creates a target for an offset mapping for a constant value ornull.- Parameters:
value- The constant value to represent ornull.- Returns:
- An appropriate target for an offset mapping.
-
resolveRead
public StackManipulation resolveRead()
Resolves a read instruction.- Specified by:
resolveReadin interfaceAdvice.OffsetMapping.Target- Returns:
- A stack manipulation that represents a reading of an advice parameter.
-
resolveWrite
public StackManipulation resolveWrite()
Resolves a write instruction.- Specified by:
resolveWritein interfaceAdvice.OffsetMapping.Target- Returns:
- A stack manipulation that represents a writing to an advice parameter.
-
resolveIncrement
public StackManipulation resolveIncrement(int value)
Resolves an increment instruction.- Specified by:
resolveIncrementin interfaceAdvice.OffsetMapping.Target- Parameters:
value- The incrementation value.- Returns:
- A stack manipulation that represents a writing to an advice parameter.
-
-