Module AccessFlag

module AccessFlag: sig .. end
Access flags for the various Java elements.


Types

type t = [ `Abstract
| `Annotation
| `Bridge
| `Enum
| `Final
| `Interface
| `Module
| `Native
| `Private
| `Protected
| `Public
| `Static
| `Strict
| `Super
| `Synchronized
| `Synthetic
| `Transient
| `Varargs
| `Volatile ]
Possible flags for any Java element.
type for_class = [ `Abstract
| `Annotation
| `Enum
| `Final
| `Interface
| `Module
| `Public
| `Super
| `Synthetic ]
Possible flags for a class.
type for_inner_class = [ `Abstract
| `Annotation
| `Enum
| `Final
| `Interface
| `Module
| `Private
| `Protected
| `Public
| `Static
| `Super
| `Synthetic ]
Possible flags for an inner-class.
type for_field = [ `Enum
| `Final
| `Module
| `Private
| `Protected
| `Public
| `Static
| `Synthetic
| `Transient
| `Volatile ]
Possible flags for a field.
type for_method = [ `Abstract
| `Bridge
| `Final
| `Module
| `Native
| `Private
| `Protected
| `Public
| `Static
| `Strict
| `Synchronized
| `Synthetic
| `Varargs ]
Possible flags for a method.
type for_constructor = [ `Module | `Private | `Protected | `Public | `Strict | `Synthetic | `Varargs ] 
Possible flags for a constructor.
type for_initializer = [ `Static | `Strict ] 
Possible flags for an initializer.
type for_package = [ `Abstract | `Interface | `Synthetic ] 
Possible flags for a package.
type for_module = [ `Abstract | `Interface | `Synthetic ] 
Possible flags for a module.

Exception

type error = 
| Invalid_class_flags of t option
| Invalid_inner_class_flags of t option
| Invalid_field_flags of t option
| Invalid_method_flags of t option
| Invalid_constructor_flags of t option
| Invalid_initializer_flags of t option
| Invalid_package_flags of t option
| Invalid_module_flags of t option
| Several_visibility_flags
| Unknown_flag of string
exception Exception of error
val string_of_error : error -> string

Functions

val to_u2 : t -> Utils.u2
to_u2 f converts flag f into an integer mask, as used in the class file format.
val list_to_u2 : t list -> Utils.u2
to_u2 dom l converts flag list l into an integer mask, as used in the class file format.
val from_u2 : bool -> Utils.u2 -> t list
from_u2 meth mask converts mask into flag list, meth indicating whether the considered Java element is a method (including constructors).
val to_string : t -> string
Converts the passed flag into a string.
val of_string : string -> t
Converts the passed string into a flag. Raises Exception if the passed string is not a valid flag.
val to_utf8 : t -> Utils.UTF8.t
Converts the passed flag into a UTF8 string.
val of_utf8 : Utils.UTF8.t -> t
Converts the passed UTF8 string into a flag. Raises Exception if the passed string is not a valid flag.
val list_to_utf8 : t list -> Utils.UTF8.t
Converts the passed flag list to its corresponding UTF8 string. Flags are separated by a single space, and a single space is also added at the end of the returned string.
val check_class_flags : t list -> for_class list
Acts as the identity function if the passed flags form a valid flag set for a class, raises Exception otherwise.
val check_inner_class_flags : t list -> for_inner_class list
Acts as the identity function if the passed flags form a valid flag set for an inner class, raises Exception otherwise.
val check_field_flags : bool -> t list -> for_field list
Acts as the identity function if the passed flags form a valid flag set for a field, raises Exception otherwise. The passed boolean indicates whether the checked field belongs to an interface.
val check_method_flags : bool -> t list -> for_method list
Acts as the identity function if the passed flags form a valid flag set for a method, raises Exception otherwise. The passed boolean indicates whether the checked method belongs to an interface.
val check_constructor_flags : t list -> for_constructor list
Acts as the identity function if the passed flags form a valid flag set for a constructor, raises Exception otherwise.
val check_initializer_flags : t list -> for_initializer list
Acts as the identity function if the passed flags form a valid flag set for an initializer, raises Exception otherwise.
val check_package_flags : t list -> for_package list
Acts as the identity function if the passed flags form a valid flag set for a package, raises Exception otherwise.
val check_module_flags : t list -> for_module list
Acts as the identity function if the passed flags form a valid flag set for a module, raises Exception otherwise.
val equal : t -> t -> bool
Equality over flags.
val compare : t -> t -> int
Comparison over flags.
val hash : t -> int
Hash function over flags.
val compare_according_to_visibility : t -> t -> int
Comparison over flags. The order is the one defined by java.lang.reflect.Modifier.
val list_compare_according_to_visibility : t list -> t list -> int
Comparison over flag list.
val version_bounds : t -> Version.bounds
Returns the version bounds for the passed flag.