Module Procname.Java

Type of java procedure names.

type kind =
| Non_Static

in Java, procedures called with invokevirtual, invokespecial, and invokeinterface

| Static

in Java, procedures called with invokestatic

type t
val compare : t -> t -> int
val to_simplified_string : ?⁠withclass:bool -> t -> string
val constructor_method_name : string
val class_initializer_method_name : string
val replace_method_name : string -> t -> t

Replace the method name of an existing java procname.

val replace_parameters : Typ.t list -> t -> t

Replace the parameters of a java procname.

val replace_return_type : Typ.t -> t -> t

Replace the method of a java procname.

val get_class_name : t -> string

Return the fully qualified class name of a java procedure name (package + class name)

val get_class_type_name : t -> Typ.Name.t

Return the class name as a typename of a java procedure name.

val get_simple_class_name : t -> string

Return the simple class name of a java procedure name (i.e. name without the package info).

val get_package : t -> string option

Return the package name of a java procedure name.

val get_method : t -> string

Return the method name of a java procedure name.

val get_parameters : t -> Typ.t list

Return the parameters of a java procedure name.

val get_return_typ : t -> Typ.t

Return the return type of pname_java. return Tvoid if there's no return type

val is_constructor : t -> bool

Whether the method is constructor

val is_access_method : t -> bool

Check if the procedure name is an acess method (e.g. access$100 used to access private members from a nested class.

val is_autogen_method : t -> bool

Check if the procedure name is of an auto-generated/synthetic method.

val is_anonymous_inner_class_constructor_exn : t -> bool

Check if the procedure name is an anonymous inner class constructor. Throws if it is not a Java type

val is_close : t -> bool

Check if the method name is "close".

val is_static : t -> bool

Check if the java procedure is static.

val is_vararg : t -> bool

Check if the proc name has the type of a java vararg. Note: currently only checks that the last argument has type Object.

val is_lambda : t -> bool

Check if the proc name comes from a lambda expression

val is_generated : t -> bool

Check if the proc name comes from generated code

val is_class_initializer : t -> bool

Check if this is a class initializer.

val get_class_initializer : Typ.Name.t -> t

Given a java class, generate the procname of its static initializer.

val is_external : t -> bool

Check if the method belongs to one of the specified external packages