Package org.plumelib.bcelutil
Class JvmUtil
- java.lang.Object
-
- org.plumelib.bcelutil.JvmUtil
-
@Deprecated public final class JvmUtil extends Object
Deprecated.Utility functions for working with the JVM.Currently contains conversion utilities between Java and JVM string formats, for types and signatures.
-
-
Field Summary
Fields Modifier and Type Field Description private static HashMap<String,String>fieldDescriptorToPrimitiveDeprecated.A map from field descriptor (sach as "I") to Java primitive type (such as "int").private static HashMap<@PrimitiveType String,@FieldDescriptor String>primitiveToFieldDescriptorDeprecated.A map from Java primitive type name (such as "int") to field descriptor (such as "I").
-
Constructor Summary
Constructors Constructor Description JvmUtil()Deprecated.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static StringarglistFromJvm(String arglist)Deprecated.Convert an argument list from JVML format to Java format.static StringarglistToJvm(String arglist)Deprecated.Convert a fully-qualified argument list from Java format to JVML format.static @ClassGetName StringbinaryNameToClassGetName(@BinaryName String bn)Deprecated.Convert from a BinaryName to the format ofClass.getName().static @FieldDescriptor StringbinaryNameToFieldDescriptor(@BinaryName String classname)Deprecated.Convert a binary name to a field descriptor.static @BinaryName StringfieldDescriptorToBinaryName(String classname)Deprecated.Convert a field descriptor to a binary name.static @ClassGetName StringfieldDescriptorToClassGetName(@FieldDescriptor String fd)Deprecated.Convert from a FieldDescriptor to the format ofClass.getName().static @FieldDescriptor StringprimitiveTypeNameToFieldDescriptor(String primitiveName)Deprecated.Convert a primitive Java type name (e.g., "int", "double", etc.) to a field descriptor (e.g., "I", "D", etc.).
-
-
-
Method Detail
-
binaryNameToFieldDescriptor
public static @FieldDescriptor String binaryNameToFieldDescriptor(@BinaryName String classname)
Deprecated.Convert a binary name to a field descriptor. For example, convert "java.lang.Object[]" to "[Ljava/lang/Object;" or "int" to "I" or "pkg.Outer$Inner" to "Lpkg/Outer$Inner;".There are no binary names for primitives or array types. Nonetheless, this method works for them. It converts "java.lang.Object[]" to "[Ljava/lang/Object;" or "int" to "I".
- Parameters:
classname- name of the class, in binary class name format- Returns:
- name of the class, in field descriptor format
-
primitiveTypeNameToFieldDescriptor
public static @FieldDescriptor String primitiveTypeNameToFieldDescriptor(String primitiveName)
Deprecated.Convert a primitive Java type name (e.g., "int", "double", etc.) to a field descriptor (e.g., "I", "D", etc.).- Parameters:
primitiveName- name of the type, in Java format- Returns:
- name of the type, in field descriptor format
- Throws:
IllegalArgumentException- if primitiveName is not a valid primitive type name
-
binaryNameToClassGetName
public static @ClassGetName String binaryNameToClassGetName(@BinaryName String bn)
Deprecated.Convert from a BinaryName to the format ofClass.getName().There are no binary names for primitives or array types. Nonetheless, this method works for them. It converts "java.lang.Object[]" to "[Ljava.lang.Object;" or "int" to "int".
- Parameters:
bn- the binary name to convert- Returns:
- the class name, in Class.getName format
-
fieldDescriptorToClassGetName
public static @ClassGetName String fieldDescriptorToClassGetName(@FieldDescriptor String fd)
Deprecated.Convert from a FieldDescriptor to the format ofClass.getName().- Parameters:
fd- the class, in field descriptor format- Returns:
- the class name, in Class.getName format
-
arglistToJvm
public static String arglistToJvm(String arglist)
Deprecated.Convert a fully-qualified argument list from Java format to JVML format. For example, convert "(java.lang.Integer[], int, java.lang.Integer[][])" to "([Ljava/lang/Integer;I[[Ljava/lang/Integer;)".- Parameters:
arglist- an argument list, in Java format- Returns:
- argument list, in JVML format
-
fieldDescriptorToBinaryName
public static @BinaryName String fieldDescriptorToBinaryName(String classname)
Deprecated.Convert a field descriptor to a binary name. For example, convert "[Ljava/lang/Object;" to "java.lang.Object[]" or "I" to "int".- Parameters:
classname- name of the type, in JVML format- Returns:
- name of the type, in Java format
-
arglistFromJvm
public static String arglistFromJvm(String arglist)
Deprecated.Convert an argument list from JVML format to Java format. For example, convert "([Ljava/lang/Integer;I[[Ljava/lang/Integer;)" to "(java.lang.Integer[], int, java.lang.Integer[][])".The argument is the first part of a method descriptor.
- Parameters:
arglist- an argument list, in JVML format- Returns:
- argument list, in Java format
-
-