classfile_parser/method_info/
types.rs

1use attribute_info::AttributeInfo;
2
3#[derive(Clone, Debug)]
4pub struct MethodInfo {
5    pub access_flags: MethodAccessFlags,
6    pub name_index: u16,
7    pub descriptor_index: u16,
8    pub attributes_count: u16,
9    pub attributes: Vec<AttributeInfo>,
10}
11
12bitflags! {
13    #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
14    pub struct MethodAccessFlags: u16 {
15        const PUBLIC = 0x0001;       // 	Declared public; may be accessed from outside its package.
16        const PRIVATE = 0x0002;      // 	Declared private; accessible only within the defining class.
17        const PROTECTED = 0x0004;    // 	Declared protected; may be accessed within subclasses.
18        const STATIC = 0x0008;       // 	Declared static.
19        const FINAL = 0x0010;        // 	Declared final; must not be overridden.
20        const SYNCHRONIZED = 0x0020; // 	Declared synchronized; invocation is wrapped by a monitor use.
21        const BRIDGE = 0x0040;       // 	A bridge method, generated by the compiler.
22        const VARARGS = 0x0080;      // 	Declared with variable number of arguments.
23        const NATIVE = 0x0100;       //  Declared native; implemented in a language other than Java
24        const ABSTRACT = 0x0400;     // 	Declared abstract; no implementation is provided.
25        const STRICT = 0x0800;       // 	Declared strictfp; floating-point mode is FP-strict.
26        const SYNTHETIC = 0x1000;    // 	Declared synthetic; not present in the source code.
27    }
28}
29
30#[cfg(test)]
31trait TraitTester:
32    Copy + Clone + PartialEq + Eq + PartialOrd + Ord + ::std::hash::Hash + ::std::fmt::Debug
33{
34}
35
36#[cfg(test)]
37impl TraitTester for MethodAccessFlags {}