pub enum AccessFlag {
Show 19 variants
ACC_PUBLIC,
ACC_PRIVATE,
ACC_PROTECTED,
ACC_STATIC,
ACC_FINAL,
ACC_SYNCHRONIZED,
ACC_VOLATILE,
ACC_BRIDGE,
ACC_TRANSIENT,
ACC_VARARGS,
ACC_NATIVE,
ACC_INTERFACE,
ACC_ABSTRACT,
ACC_STRICT,
ACC_SYNTHETIC,
ACC_ANNOTATION,
ACC_ENUM,
ACC_CONSTRUCTOR,
ACC_DECLARED_SYNCHRONIZED,
}Expand description
Representation of the different access flag
Bitfields of these flags are used to indicate the accessibility and overall properties of classes and class members.
Variants§
ACC_PUBLIC
Public: visible everywhere
ACC_PRIVATE
Private: only visible to defining class
ACC_PROTECTED
Protected: visible to package and subclasses
ACC_STATIC
Static: meaning depends of where the flag is used
- for classes: is not constructed with an outer
thisreference - for methods: does not take a
thisargument - for fields: global to defining class
ACC_FINAL
Final: meaning depends of where the flag is used
- for classes: not subclassable
- for methods: not overridable
- for fields: immutable after construction
ACC_SYNCHRONIZED
Synchronized (only valid for methods): associated lock automatically
acquired around call to this method.
Note: only valid to set when ACC_NATIVE is also set.
ACC_VOLATILE
Volatile (only valid for fields): special access rules to help with thread safety
ACC_BRIDGE
Bridge (only valid for methods): method added automatically by the compiler as a type-safe bridge
ACC_TRANSIENT
Transient (only valid for fields): the field must not be saved by default serialization
ACC_VARARGS
Varargs (only valid for methods): the last argument to this method should be treated as a “rest” argument by the compiler
ACC_NATIVE
Native (only valid for methods): this method is implemented in native code
ACC_INTERFACE
Interface (only valid for classes): multiply-implementable abstract class
ACC_ABSTRACT
Abstract (only valid for classes and methods):
- for classes: not directly instantiable
- for methods: unimplemented by this class
ACC_STRICT
Strict floating-point (only valid for methods): strict rules for floating-point arithmetic
ACC_SYNTHETIC
Synthetic: not directly defined in source code
ACC_ANNOTATION
Annotation (only valid for classes): declared as an annotation class
ACC_ENUM
Enum (only valid for classes and fields):
- for classes: declared as an enumerated type
- for fields: declared as an enumerated value
ACC_CONSTRUCTOR
Constructor (only valid for methods): contructor method
ACC_DECLARED_SYNCHRONIZED
Declared synchronized (only valid for methods): method declared
as synchronized
Implementations§
Source§impl AccessFlag
impl AccessFlag
Sourcepub fn parse(raw: u32, for_type: AccessFlagType) -> Vec<Self>
pub fn parse(raw: u32, for_type: AccessFlagType) -> Vec<Self>
Converts a raw flag (an unsigned 32 bits integer) into a vector for access flags
The result values will be different depending on where the type is used (for a class, a method, or a field)
Sourcepub fn vec_to_string(flags: &[AccessFlag]) -> String
pub fn vec_to_string(flags: &[AccessFlag]) -> String
Pretty print a vector of access flags
Trait Implementations§
Source§impl Debug for AccessFlag
impl Debug for AccessFlag
Source§impl Display for AccessFlag
Implementation of the Display trait for access flags
impl Display for AccessFlag
Implementation of the Display trait for access flags