javalib

Javalib is a library written in OCaml with the aim to provide a high level representation of Java .class files
IN THIS PACKAGE
Module Javalib_pack . JClass
type access = [
| `Default
| `Private
| `Protected
| `Public
]
type attributes = {
synthetic : bool;
deprecated : bool;
other : (string * string) list;
}
type visibility =
| RTVisible
| RTInvisible
type field_kind =
| NotFinal
| Final
| Volatile
type constant_attribute = [
| `Double of float
| `Float of float
| `Int of int32
| `Long of int64
| `String of JBasics.jstr
]
type class_field = {
cf_signature : JBasics.field_signature;
cf_class_signature : JBasics.class_field_signature;
cf_generic_signature : JSignature.fieldTypeSignature option;
cf_access : access;
cf_static : bool;
cf_synthetic : bool;
cf_enum : bool;
cf_kind : field_kind;
cf_value : constant_attribute option;
cf_transient : bool;
cf_annotations : (JBasics.annotation * visibility) list;
cf_other_flags : int list;
cf_attributes : attributes;
}
type interface_field = {
if_signature : JBasics.field_signature;
if_class_signature : JBasics.class_field_signature;
if_generic_signature : JSignature.fieldTypeSignature option;
if_synthetic : bool;
if_value : constant_attribute option;
if_annotations : (JBasics.annotation * visibility) list;
if_other_flags : int list;
if_attributes : attributes;
}
type any_field =
| InterfaceField of interface_field
| ClassField of class_field
type !'a implementation =
| Native
| Java of 'a Lazy.t
type method_annotations = {
ma_global : (JBasics.annotation * visibility) list;
ma_parameters : (JBasics.annotation * visibility) list list;
}
type method_parameter_attribute = {
mp_name : string option;
mp_final : bool;
mp_synthetic : bool;
mp_mandated : bool;
}
type !'a concrete_method = {
cm_signature : JBasics.method_signature;
cm_class_method_signature : JBasics.class_method_signature;
cm_static : bool;
cm_final : bool;
cm_synchronized : bool;
cm_strict : bool;
cm_access : access;
cm_generic_signature : JSignature.methodTypeSignature option;
cm_bridge : bool;
cm_varargs : bool;
cm_synthetic : bool;
cm_other_flags : int list;
cm_exceptions : JBasics.class_name list;
cm_attributes : attributes;
cm_parameters : method_parameter_attribute list;
cm_annotations : method_annotations;
cm_implementation : 'a implementation;
}
type abstract_method = {
am_signature : JBasics.method_signature;
am_class_method_signature : JBasics.class_method_signature;
am_access : [ `Default | `Private | `Protected | `Public ];
am_generic_signature : JSignature.methodTypeSignature option;
am_bridge : bool;
am_varargs : bool;
am_synthetic : bool;
am_other_flags : int list;
am_exceptions : JBasics.class_name list;
am_attributes : attributes;
am_parameters : method_parameter_attribute list;
am_annotations : method_annotations;
am_annotation_default : JBasics.element_value option;
}
type !'a jmethod =
| AbstractMethod of abstract_method
| ConcreteMethod of 'a concrete_method
type inner_class = {
ic_class_name : JBasics.class_name option;
ic_outer_class_name : JBasics.class_name option;
ic_source_name : string option;
ic_access : access;
ic_static : bool;
ic_final : bool;
ic_synthetic : bool;
ic_annotation : bool;
ic_enum : bool;
ic_other_flags : int list;
ic_type : [ `Abstract | `ConcreteClass | `Interface ];
}
type !'a jclass = {
c_name : JBasics.class_name;
c_version : JBasics.version;
c_access : [ `Default | `Public ];
c_final : bool;
c_abstract : bool;
c_super_class : JBasics.class_name option;
c_generic_signature : JSignature.classSignature option;
c_fields : class_field JBasics.FieldMap.t;
c_interfaces : JBasics.class_name list;
c_consts : JBasics.constant array;
c_sourcefile : string option;
c_deprecated : bool;
c_enclosing_method : (JBasics.class_name * JBasics.method_signature option) option;
c_source_debug_extention : string option;
c_inner_classes : inner_class list;
c_synthetic : bool;
c_enum : bool;
c_annotations : (JBasics.annotation * visibility) list;
c_other_flags : int list;
c_other_attributes : (string * string) list;
c_methods : 'a jmethod JBasics.MethodMap.t;
}
type !'a jinterface = {
i_name : JBasics.class_name;
i_version : JBasics.version;
i_access : [ `Default | `Public ];
i_interfaces : JBasics.class_name list;
i_generic_signature : JSignature.classSignature option;
i_consts : JBasics.constant array;
i_sourcefile : string option;
i_deprecated : bool;
i_source_debug_extention : string option;
i_inner_classes : inner_class list;
i_annotation : bool;
i_annotations : (JBasics.annotation * visibility) list;
i_other_attributes : (string * string) list;
i_other_flags : int list;
i_fields : interface_field JBasics.FieldMap.t;
i_methods : 'a jmethod JBasics.MethodMap.t;
}
type !'a interface_or_class =
| JInterface of 'a jinterface
| JClass of 'a jclass
val get_consts : 'a interface_or_class -> JBasics.constant array
val get_access : 'a interface_or_class -> [ `Default | `Public ]
val get_sourcefile : 'a interface_or_class -> string option
val is_deprecated : 'a interface_or_class -> bool
val is_final : 'a interface_or_class -> bool
val get_inner_classes : 'a interface_or_class -> inner_class list
val get_other_attributes : 'a interface_or_class -> (string * string) list
val get_initializer : 'a interface_or_class -> 'a concrete_method option
val get_other_flags : 'a interface_or_class -> int list
val get_method_signature : 'a jmethod -> JBasics.method_signature
val get_class_method_signature : 'a jmethod -> JBasics.class_method_signature
val get_method_visibility : 'a jmethod -> access
val is_static_method : 'a jmethod -> bool
val is_final_method : 'a jmethod -> bool
val is_synchronized_method : 'a jmethod -> bool
val get_concrete_method : 'a interface_or_class -> JBasics.method_signature -> 'a concrete_method
val get_concrete_methods : 'a interface_or_class -> 'a concrete_method JBasics.MethodMap.t
val defines_method : 'a interface_or_class -> JBasics.method_signature -> bool
val get_field_signature : any_field -> JBasics.field_signature
val get_class_field_signature : any_field -> JBasics.class_field_signature
val get_field_visibility : any_field -> access
val is_static_field : any_field -> bool
val is_final_field : any_field -> bool
val defines_field : 'a interface_or_class -> JBasics.field_signature -> bool
val cf_iter : ( class_field -> unit ) -> 'a interface_or_class -> unit
val if_iter : ( interface_field -> unit ) -> 'a interface_or_class -> unit
val f_iter : ( any_field -> unit ) -> 'a interface_or_class -> unit
val cf_fold : ( class_field -> 'b -> 'b ) -> 'a interface_or_class -> 'b -> 'b
val if_fold : ( interface_field -> 'b -> 'b ) -> 'a interface_or_class -> 'b -> 'b
val f_fold : ( any_field -> 'b -> 'b ) -> 'a interface_or_class -> 'b -> 'b
val cm_iter : ( 'a concrete_method -> unit ) -> 'a interface_or_class -> unit
val am_iter : ( abstract_method -> unit ) -> 'a interface_or_class -> unit
val m_iter : ( 'a jmethod -> unit ) -> 'a interface_or_class -> unit
val cm_fold : ( 'a concrete_method -> 'b -> 'b ) -> 'a interface_or_class -> 'b -> 'b
val am_fold : ( abstract_method -> 'b -> 'b ) -> 'a interface_or_class -> 'b -> 'b
val m_fold : ( 'a jmethod -> 'b -> 'b ) -> 'a interface_or_class -> 'b -> 'b
val map_concrete_method : ?force:bool -> ( 'a -> 'b ) -> 'a concrete_method -> 'b concrete_method
val map_concrete_method_with_native : ( 'a implementation -> 'b implementation ) -> 'a concrete_method -> 'b concrete_method
val map_class : ?force:bool -> ( 'a -> 'b ) -> 'a jclass -> 'b jclass
val map_interface : ?force:bool -> ( 'a -> 'b ) -> 'a jinterface -> 'b jinterface
val map_interface_or_class : ?force:bool -> ( 'a -> 'b ) -> 'a interface_or_class -> 'b interface_or_class
val map_class_with_native : ( 'a implementation -> 'b implementation ) -> 'a jclass -> 'b jclass
val map_interface_with_native : ( 'a implementation -> 'b implementation ) -> 'a jinterface -> 'b jinterface
val map_interface_or_class_with_native : ( 'a implementation -> 'b implementation ) -> 'a interface_or_class -> 'b interface_or_class
val map_class_context : ?force:bool -> ( 'a concrete_method -> 'a -> 'b ) -> 'a jclass -> 'b jclass
val map_interface_context : ?force:bool -> ( 'a concrete_method -> 'a -> 'b ) -> 'a jinterface -> 'b jinterface
val map_interface_or_class_context : ?force:bool -> ( 'a concrete_method -> 'a -> 'b ) -> 'a interface_or_class -> 'b interface_or_class
val map_class_with_native_context : ( 'a concrete_method -> 'a implementation -> 'b implementation ) -> 'a jclass -> 'b jclass
val map_interface_with_native_context : ( 'a concrete_method -> 'a implementation -> 'b implementation ) -> 'a jinterface -> 'b jinterface
val map_interface_or_class_with_native_context : ( 'a concrete_method -> 'a implementation -> 'b implementation ) -> 'a interface_or_class -> 'b interface_or_class