Package org.jboss.classfilewriter.util
Class DescriptorUtils
java.lang.Object
org.jboss.classfilewriter.util.DescriptorUtils
Utility class for working with method descriptors
- Author:
- Stuart Douglas
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isPrimitive
(String descriptor) returns true if the descriptor represents a primitive typestatic boolean
returns true if the class represents a long or a doublestatic boolean
returns true if the descriptor represents a long or a doublestatic String
makeDescriptor
(Class<?> c) static String
makeDescriptor
(Constructor<?> c) static String
makeDescriptor
(String className) Changes a class name to the internal form suitable for use in a descriptor string.static String
static String
methodDescriptor
(String[] parameters, String returnType) static String[]
parameterDescriptors
(Class<?>[] parameters) static String[]
static String[]
parameterDescriptors
(String methodDescriptor) returns an array of String representations of the parameter types.static String
returnType
(String methodDescriptor) static String
validateDescriptor
(String descriptor) performs basic validation on a descriptor
-
Constructor Details
-
DescriptorUtils
public DescriptorUtils()
-
-
Method Details
-
makeDescriptor
Changes a class name to the internal form suitable for use in a descriptor string. e.g. java.lang.String => Ljava/lang/String; -
makeDescriptor
-
makeDescriptor
-
parameterDescriptors
returns an array of String representations of the parameter types. Primitives are returned as their native representations, while clases are returned in the internal descriptor form e.g. Ljava/lang/Integer; -
parameterDescriptors
-
parameterDescriptors
-
returnType
-
isPrimitive
returns true if the descriptor represents a primitive type -
isWide
returns true if the descriptor represents a long or a double -
isWide
returns true if the class represents a long or a double -
methodDescriptor
-
methodDescriptor
-
validateDescriptor
performs basic validation on a descriptor
-