Enum MethodVariableAccess
java.lang.Object
java.lang.Enum<MethodVariableAccess>
net.bytebuddy.implementation.bytecode.member.MethodVariableAccess
- All Implemented Interfaces:
Serializable, Comparable<MethodVariableAccess>, java.lang.constant.Constable
A stack assignment that loads a method variable from a given index of the local variable array.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA stack manipulation that loads all parameters of a given method onto the operand stack.protected static classA stack manipulation that increments an integer variable.protected classA stack manipulation for loading a variable of a method's local variable array onto the operand stack.protected classA stack manipulation for storing a variable into a method's local variable array.Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe opcode for loading this variable type.private final StackSizeThe size of the local variable on the JVM stack.private final intThe opcode for storing a local variable type. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateMethodVariableAccess(int loadOpcode, int storeOpcode, StackSize stackSize) Creates a new method variable access for a given JVM type. -
Method Summary
Modifier and TypeMethodDescriptionallArgumentsOf(MethodDescription methodDescription) Loads all arguments of the provided method onto the operand stack.increment(int offset, int value) Creates a stack assignment for incrementing the given offset of the local variable array.static StackManipulationincrement(ParameterDescription parameterDescription, int value) Increments the value of the supplied parameter.static StackManipulationload(ParameterDescription parameterDescription) Loads a parameter's value onto the operand stack.loadFrom(int offset) Creates a stack assignment for a reading given offset of the local variable array.static StackManipulationloadThis()Loads a reference to thethisreference what is only meaningful for a non-static method.static MethodVariableAccessof(TypeDefinition typeDefinition) Locates the correct accessor for a variable of a given type.static StackManipulationstore(ParameterDescription parameterDescription) Stores the top operand stack value at the supplied parameter.storeAt(int offset) Creates a stack assignment for writing to a given offset of the local variable array.static MethodVariableAccessReturns the enum constant of this type with the specified name.static MethodVariableAccess[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
INTEGER
The accessor handler for a JVM-integer. -
LONG
The accessor handler for along. -
FLOAT
The accessor handler for afloat. -
DOUBLE
The accessor handler for adouble. -
REFERENCE
The accessor handler for a reference type.
-
-
Field Details
-
loadOpcode
private final int loadOpcodeThe opcode for loading this variable type. -
storeOpcode
private final int storeOpcodeThe opcode for storing a local variable type. -
size
The size of the local variable on the JVM stack.
-
-
Constructor Details
-
MethodVariableAccess
Creates a new method variable access for a given JVM type.- Parameters:
loadOpcode- The opcode for loading this variable type.storeOpcode- The opcode for storing this variable type.stackSize- The size of the JVM type.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
of
Locates the correct accessor for a variable of a given type.- Parameters:
typeDefinition- The type of the variable to be loaded.- Returns:
- An accessor for the given type.
-
allArgumentsOf
public static MethodVariableAccess.MethodLoading allArgumentsOf(MethodDescription methodDescription) Loads all arguments of the provided method onto the operand stack.- Parameters:
methodDescription- The method for which all parameters are to be loaded onto the operand stack.- Returns:
- A stack manipulation that loads all parameters of the provided method onto the operand stack.
-
loadThis
Loads a reference to thethisreference what is only meaningful for a non-static method.- Returns:
- A stack manipulation loading the
thisreference.
-
loadFrom
Creates a stack assignment for a reading given offset of the local variable array.- Parameters:
offset- The offset of the variable wheredoubleandlongtypes count two slots.- Returns:
- A stack manipulation representing the variable read.
-
storeAt
Creates a stack assignment for writing to a given offset of the local variable array.- Parameters:
offset- The offset of the variable wheredoubleandlongtypes count two slots.- Returns:
- A stack manipulation representing the variable write.
-
increment
Creates a stack assignment for incrementing the given offset of the local variable array.- Parameters:
offset- The offset of the variable wheredoubleandlongtypes count two slots.value- The incremented value.- Returns:
- A stack manipulation representing the variable write.
-
load
Loads a parameter's value onto the operand stack.- Parameters:
parameterDescription- The parameter which to load onto the operand stack.- Returns:
- A stack manipulation loading a parameter onto the operand stack.
-
store
Stores the top operand stack value at the supplied parameter.- Parameters:
parameterDescription- The parameter which to store a value for.- Returns:
- A stack manipulation storing the top operand stack value at this parameter.
-
increment
Increments the value of the supplied parameter.- Parameters:
parameterDescription- The parameter which to increment.value- The value to increment with.- Returns:
- A stack manipulation incrementing the supplied parameter.
-