pub enum Item {
Show 16 variants
UTF8(String),
Integer(i32),
Float(f32),
Long(i64),
Double(f64),
Class(u16),
String(u16),
FieldRef {
class: u16,
name_and_type: u16,
},
MethodRef {
class: u16,
name_and_type: u16,
},
InterfaceMethodRef {
class: u16,
name_and_type: u16,
},
NameAndType {
name: u16,
desc: u16,
},
MethodHandle {
kind: ReferenceKind,
index: u16,
},
MethodType(u16),
InvokeDynamic {
bootstrap_method: u16,
name_and_type: u16,
},
Module(u16),
Package(u16),
}
Expand description
A constant pool item
Variants§
UTF8(String)
An UTF-8 encoded string. Inside the class file itself, a modified format is used.
Integer(i32)
An int
.
Float(f32)
A float
.
Long(i64)
A long
.
Takes two spots, instead of one.
Double(f64)
A double
.
Takes two spots, instead of one.
Class(u16)
An index to the name of the class, or the descriptor of an array type.
Always refers to an Item::UTF8(_)
.
String(u16)
A java.lang.String
object.
FieldRef
Describes a field reference.
Fields
MethodRef
Describes a method reference.
Fields
InterfaceMethodRef
Describes a method reference, where the class is an interface.
Fields
NameAndType
Represents a field or method, without indicating which class or type it belongs to.
Fields
MethodHandle
Represents a method handle
Fields
kind: ReferenceKind
Characterizes its bytecode behaviour.
index: u16
If kind is either GetField, GetStatic, PutField, or PutStatic,
the entry at that index must be a Item::FieldRef { .. }
.
If kind is InvokeVirtual or InvokeSpecial,
the entry at that index must be Item::MethodRef { .. }
.
If kind is InvokeStatic or InvokeSpecial
and the version of the class is less than 52.0,
the entry at that index must be Item::MethodRef { .. }
.
If it is 52.0 or above,
it must either be a MethodRef or an Item::InterfaceMethodRef { .. }
.
If kind is InvokeInterface,
the entry at that index must be an Item::InterfaceMethodRef { .. }
.
MethodType(u16)
Describes a method type.
The entry at that index must be an Item::UTF8(_)
representing a method descriptor.
InvokeDynamic
Describes a invoke dynamic instruction, and specifies information regarding the bootstrap method.
Fields
Module(u16)
Represents a module.
The entry at that index must be a Item::UTF8(_)
with a valid name.
The class must have the MODULE flag set.
Package(u16)
Represents a package exported or opened by a module.
The entry at that index must be an Item::UTF8(_)
with a valid package name encoded in internal form.
The class must have the MODULE flag set.