Module IR.JavaClassName

type t
include Ppx_compare_lib.Comparable.S with type t := t
val compare : t Base__Ppx_compare_lib.compare
include Ppx_compare_lib.Equal.S with type t := t
val equal : t Base__Ppx_compare_lib.equal
val yojson_of_t : t -> Ppx_yojson_conv_lib.Yojson.Safe.t
include Sexplib0.Sexpable.S with type t := t
val t_of_sexp : Sexplib0__.Sexp.t -> t
val sexp_of_t : t -> Sexplib0__.Sexp.t
include Ppx_hash_lib.Hashable.S with type t := t
val hash_fold_t : t Base__Ppx_hash_lib.hash_fold
val hash : t -> Base__Ppx_hash_lib.Std.Hash.hash_value
val hash_normalize : t -> t
val hash_normalize_opt : t option -> t option
val hash_normalize_list : t list -> t list
val make : package:string option -> classname:string -> t

make ~package:(Some "java.lang") "Object" creates a value representing java.lang.Object

val from_string : string -> t

from_string "java.lang.Object" is same as make ~package:(Some "java.lang") "Object"

val to_string : t -> string

to_string (from_string "X.Y.Z") = "X.Y.Z"

val pp : Stdlib.Format.formatter -> t -> unit

pp includes package if any

val pp_with_verbosity : verbose:bool -> Stdlib.Format.formatter -> t -> unit

if verbose then print package if present, otherwise only print class

val package : t -> string option
val classname : t -> string
val get_outer_class_name : t -> t option

If this is an inner class, return the closest outer, e.g. A$B for A$B$C. None if the class is outermost

val is_anonymous_inner_class_name : t -> bool

True if it is either "classic" anonymous Java class: https://docs.oracle.com/javase/tutorial/java/javaOO/anonymousclasses.html, or a synthetic Java class corresponding to a lambda expression.

val get_user_defined_class_if_anonymous_inner : t -> t option

If the current class is anonymous (is_anonymous_inner_class_name is true), return the corresponding user defined (not anonymous) class this anonymous class belongs to.

In general case, BOTH anonymous classes and user-defined classes can be nested: SomeClass$NestedClass$1$17$5. In this example, we should return SomeClass$NestedClass.

If this is not an anonymous class, returns None.