- All Superinterfaces:
ClassfileElement,CodeElement,Instruction
- All Known Implementing Classes:
AbstractInstruction.BoundFieldInstruction,AbstractInstruction.UnboundFieldInstruction
public sealed interface FieldInstruction
extends Instruction
permits AbstractInstruction.BoundFieldInstruction, AbstractInstruction.UnboundFieldInstruction
Models a field access instruction in the
code array of a Code
attribute. Corresponding opcodes will have a kind of Opcode.Kind.FIELD_ACCESS. Delivered as a CodeElement when
traversing the elements of a CodeModel.-
Method Summary
Modifier and TypeMethodDescriptionfield()Returns theFieldRefEntryconstant described by this instruction.default Utf8Entryname()Returns the name of the field.static FieldInstructionof(Opcode op, ClassEntry owner, NameAndTypeEntry nameAndType) Returns a field access instruction.static FieldInstructionof(Opcode op, ClassEntry owner, Utf8Entry name, Utf8Entry type) Returns a field access instruction.static FieldInstructionof(Opcode op, FieldRefEntry field) Returns a field access instruction.default ClassEntryowner()Returns the class holding the field.default Utf8Entrytype()Returns the field descriptor of the field.default ClassDescReturns a symbolic descriptor for the type of the field.Methods inherited from interface org.glavo.classfile.Instruction
opcode, sizeInBytes
-
Method Details
-
field
FieldRefEntry field()Returns theFieldRefEntryconstant described by this instruction.- Returns:
- the
FieldRefEntryconstant described by this instruction
-
owner
Returns the class holding the field.- Returns:
- the class holding the field
-
name
Returns the name of the field.- Returns:
- the name of the field
-
type
Returns the field descriptor of the field.- Returns:
- the field descriptor of the field
-
typeSymbol
Returns a symbolic descriptor for the type of the field.- Returns:
- a symbolic descriptor for the type of the field
-
of
Returns a field access instruction.- Parameters:
op- the opcode for the specific type of field access instruction, which must be of kindOpcode.Kind.FIELD_ACCESSfield- a constant pool entry describing the field- Returns:
- a field access instruction
-
of
Returns a field access instruction.- Parameters:
op- the opcode for the specific type of field access instruction, which must be of kindOpcode.Kind.FIELD_ACCESSowner- the class holding the fieldname- the name of the fieldtype- the field descriptor- Returns:
- a field access instruction
-
of
Returns a field access instruction.- Parameters:
op- the opcode for the specific type of field access instruction, which must be of kindOpcode.Kind.FIELD_ACCESSowner- the class holding the fieldnameAndType- the name and field descriptor of the field- Returns:
- a field access instruction
-