Enum Class FieldAccess
- All Implemented Interfaces:
Serializable,Comparable<FieldAccess>,Constable
An access representation to a given field.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classA dispatcher for implementing a non-generic read or write access on a field.static interfaceRepresentation of a field access for which a getter and a setter can be created.protected static classA dispatcher for implementing a generic read or write access on a field.Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe opcode for getting a field value.private final intThe opcode for setting a field value.private final intThe amount of operand slots this field access operation consumes when it is applied before eventually adding new values onto the operand stack. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateFieldAccess(int putterOpcode, int getterOpcode, StackSize targetSizeChange) Creates a new field access. -
Method Summary
Modifier and TypeMethodDescriptionstatic StackManipulationforEnumeration(EnumerationDescription enumerationDescription) Creates an accessor to read an enumeration value.static FieldAccess.DefinedforField(FieldDescription fieldDescription) Creates a field access representation for a given field.static FieldAccess.DefinedforField(FieldDescription.InDefinedShape fieldDescription) Creates a field access representation for a given field.static FieldAccessReturns the enum constant of this class with the specified name.static FieldAccess[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
STATIC
The representation of field access to a static field. -
INSTANCE
The representation of field access to an instance field.
-
-
Field Details
-
putterOpcode
private final int putterOpcodeThe opcode for setting a field value. -
getterOpcode
private final int getterOpcodeThe opcode for getting a field value. -
targetSizeChange
private final int targetSizeChangeThe amount of operand slots this field access operation consumes when it is applied before eventually adding new values onto the operand stack.
-
-
Constructor Details
-
FieldAccess
Creates a new field access.- Parameters:
putterOpcode- The opcode for setting a field value.getterOpcode- The opcode for getting a field value.targetSizeChange- The amount of operand slots this field access operation consumes when it is applied before eventually adding new values onto the operand stack.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-
forEnumeration
Creates an accessor to read an enumeration value.- Parameters:
enumerationDescription- The description of the enumeration.- Returns:
- A stack manipulation for reading the enumeration.
-
forField
Creates a field access representation for a given field.- Parameters:
fieldDescription- The field to be accessed.- Returns:
- A field access definition for the given field.
-
forField
Creates a field access representation for a given field. If the field's return type derives from its declared shape, the value is additionally casted to the generically resolved field.- Parameters:
fieldDescription- The field to be accessed.- Returns:
- A field access definition for the given field.
-