1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
use constant_info::ConstantInfo;
use field_info::FieldInfo;
use method_info::MethodInfo;
use attribute_info::AttributeInfo;
#[derive(Clone, Debug)]
pub struct ClassFile {
pub minor_version: u16,
pub major_version: u16,
pub const_pool_size: u16,
pub const_pool: Vec<ConstantInfo>,
pub access_flags: ClassAccessFlags,
pub this_class: u16,
pub super_class: u16,
pub interfaces_count: u16,
pub interfaces: Vec<u16>,
pub fields_count: u16,
pub fields: Vec<FieldInfo>,
pub methods_count: u16,
pub methods: Vec<MethodInfo>,
pub attributes_count: u16,
pub attributes: Vec<AttributeInfo>,
}
bitflags! {
pub struct ClassAccessFlags: u16 {
const PUBLIC = 0x0001;
const FINAL = 0x0010;
const SUPER = 0x0020;
const INTERFACE = 0x0200;
const ABSTRACT = 0x0400;
const SYNTHETIC = 0x1000;
const ANNOTATION = 0x2000;
const ENUM = 0x4000;
}
}