Skip to main content

ClassNode

Struct ClassNode 

Source
pub struct ClassNode {
Show 15 fields pub minor_version: u16, pub major_version: u16, pub access_flags: u16, pub constant_pool: Vec<CpInfo>, pub this_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>, pub inner_classes: Vec<InnerClassNode>, pub outer_class: String,
}
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: u16

The minor version of the class file format.

§major_version: u16

The major version of the class file format (e.g., 52 for Java 8, 61 for Java 17).

§access_flags: u16

A 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: u16

The index into the constant pool pointing to a CONSTANT_Class_info structure representing this class.

§name: String

The internal name of the class (e.g., java/lang/String).

§super_name: Option<String>

The internal name of the superclass (e.g., java/lang/String, a/b/c). 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).

§inner_classes: Vec<InnerClassNode>

The inner class entries associated with this class file.

This is a decoded view of the InnerClasses attribute.

§outer_class: String

The internal name of the enclosing class, if known.

This value is empty when no enclosing class information is available.

Implementations§

Source§

impl ClassNode

Source

pub fn new() -> Self

Trait Implementations§

Source§

impl Clone for ClassNode

Source§

fn clone(&self) -> ClassNode

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ClassNode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.