Package org.plumelib.bcelutil
Class JvmUtil
java.lang.Object
org.plumelib.bcelutil.JvmUtil
Deprecated.
Use org.plumelib.reflection.Signatures
Utility functions for working with the JVM.
Currently contains conversion utilities between Java and JVM string formats, for types and signatures.
-
Field Summary
FieldsModifier and TypeFieldDescriptionDeprecated.A map from field descriptor (sach as "I") to Java primitive type (such as "int").Deprecated.A map from Java primitive type name (such as "int") to field descriptor (such as "I"). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.).
-
Field Details
-
primitiveToFieldDescriptor
Deprecated.A map from Java primitive type name (such as "int") to field descriptor (such as "I"). -
fieldDescriptorToPrimitive
Deprecated.A map from field descriptor (sach as "I") to Java primitive type (such as "int").
-
-
Constructor Details
-
JvmUtil
public JvmUtil()Deprecated.
-
-
Method Details
-
binaryNameToFieldDescriptor
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
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
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
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
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
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
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
-