pub struct ClassNode {Show 14 fields
pub minor_version: u16,
pub major_version: u16,
pub access_flags: u16,
pub constant_pool: Vec<CpInfo>,
pub this_class: u16,
pub super_class: u16,
pub name: String,
pub super_name: Option<String>,
pub source_file: Option<String>,
pub interfaces: Vec<String>,
pub interface_indices: Vec<u16>,
pub fields: Vec<FieldNode>,
pub methods: Vec<MethodNode>,
pub attributes: Vec<AttributeInfo>,
}Expand description
Represents a parsed Java Class File.
This structure holds the complete object model of a .class file, including
its header information, constant pool, interfaces, fields, methods, and attributes.
§See Also
Fields§
§minor_version: u16The minor version of the class file format.
major_version: u16The major version of the class file format (e.g., 52 for Java 8, 61 for Java 17).
access_flags: u16A bitmask of access flags used to denote access permissions to and properties of this class
(e.g., ACC_PUBLIC, ACC_FINAL, ACC_INTERFACE).
constant_pool: Vec<CpInfo>The raw constant pool containing heterogeneous constants (strings, integers, method references, etc.). Index 0 is reserved/unused.
this_class: u16The index into the constant pool pointing to a CONSTANT_Class_info structure representing this class.
super_class: u16The index into the constant pool pointing to a CONSTANT_Class_info structure representing the direct superclass.
This is 0 for java.lang.Object.
name: StringThe internal name of the class (e.g., java/lang/String).
super_name: Option<String>The internal name of the superclass. Returns None if this class is java.lang.Object.
source_file: Option<String>The name of the source file from which this class was compiled, if the SourceFile attribute was present.
interfaces: Vec<String>A list of internal names of the direct superinterfaces of this class or interface.
interface_indices: Vec<u16>A list of indices into the constant pool representing the direct superinterfaces.
fields: Vec<FieldNode>The fields declared by this class or interface.
methods: Vec<MethodNode>The methods declared by this class or interface.
attributes: Vec<AttributeInfo>Global attributes associated with the class (e.g., SourceFile, InnerClasses, EnclosingMethod).