Package org.jboss.classfilewriter.util
Class DescriptorUtils
java.lang.Object
org.jboss.classfilewriter.util.DescriptorUtils
Utility class for working with method descriptors
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisPrimitive(String descriptor) returns true if the descriptor represents a primitive typestatic booleanreturns true if the class represents a long or a doublestatic booleanreturns true if the descriptor represents a long or a doublestatic StringmakeDescriptor(Class<?> c) static StringmakeDescriptor(Constructor<?> c) static StringmakeDescriptor(String className) Changes a class name to the internal form suitable for use in a descriptor string.static Stringstatic StringmethodDescriptor(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 StringreturnType(String methodDescriptor) static StringvalidateDescriptor(String descriptor) performs basic validation on a descriptor
-
Field Details
-
VOID_CLASS_DESCRIPTOR
- See Also:
-
BYTE_CLASS_DESCRIPTOR
- See Also:
-
CHAR_CLASS_DESCRIPTOR
- See Also:
-
DOUBLE_CLASS_DESCRIPTOR
- See Also:
-
FLOAT_CLASS_DESCRIPTOR
- See Also:
-
INT_CLASS_DESCRIPTOR
- See Also:
-
LONG_CLASS_DESCRIPTOR
- See Also:
-
SHORT_CLASS_DESCRIPTOR
- See Also:
-
BOOLEAN_CLASS_DESCRIPTOR
- See Also:
-
-
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
-