Package org.jboss.byteman.rule.type
Class TypeHelper
- java.lang.Object
-
- org.jboss.byteman.rule.type.TypeHelper
-
public class TypeHelper extends java.lang.ObjectHelpoer class providing static methods for manipulating type and class names, field and method descriptor names etc
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String[]externalNameslist of typenames in external form corresponding to entries ni previous listprivate static java.lang.String[]internalNameslist of well known typenames as written in Java code
-
Constructor Summary
Constructors Constructor Description TypeHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanequalDescriptors(java.lang.String desc1, java.lang.String desc2)static java.lang.StringexternalizeClass(java.lang.String className)convert a classname from canonical form to the form used to represent it externally i.e.static java.lang.StringexternalizeDescriptor(java.lang.String desc)convert a method descriptor from canonical form to the form used to represent it externallystatic java.lang.StringexternalizeType(java.lang.String typeName)convert a type name from canonical form to the form used to represent it externally i.e.static java.lang.StringinternalizeClass(java.lang.String className)convert a classname from external form to canonical form i.e.static java.lang.StringinternalizeDescriptor(java.lang.String desc)convert a method descriptor from the form used to represent it externally to canonical formstatic java.lang.StringparseMethodDescriptor(java.lang.String targetMethod)split off the signature following the method name and return itstatic java.lang.StringparseMethodName(java.lang.String targetMethod)split off the method name preceding the signature and return it
-
-
-
Method Detail
-
equalDescriptors
public static boolean equalDescriptors(java.lang.String desc1, java.lang.String desc2)
-
externalizeClass
public static java.lang.String externalizeClass(java.lang.String className)
convert a classname from canonical form to the form used to represent it externally i.e. replace all dots with slashes- Parameters:
className- the canonical name- Returns:
- the external name
-
internalizeClass
public static java.lang.String internalizeClass(java.lang.String className)
convert a classname from external form to canonical form i.e. replace all slashes with dots- Parameters:
className- the external name- Returns:
- the canonical name
-
externalizeType
public static java.lang.String externalizeType(java.lang.String typeName)
convert a type name from canonical form to the form used to represent it externally i.e. replace primitive type names by the appropriate single letter types, class names by the externalized class name bracketed by 'L' and ';' and array names by the base type name preceded by '['.- Parameters:
typeName- the type name- Returns:
- the external name
-
externalizeDescriptor
public static java.lang.String externalizeDescriptor(java.lang.String desc)
convert a method descriptor from canonical form to the form used to represent it externally- Parameters:
desc- the method descriptor which must be trimmed of any surrounding white space- Returns:
- an externalised form for the descriptor
-
internalizeDescriptor
public static java.lang.String internalizeDescriptor(java.lang.String desc)
convert a method descriptor from the form used to represent it externally to canonical form- Parameters:
desc- the method descriptor which must be trimmed of any surrounding white space and start with "(". it must end either with ")" or with ") " followed by an exernalized return type- Returns:
- an internalised form for the descriptor, possibly followed by a space and externalized return type
-
parseMethodName
public static java.lang.String parseMethodName(java.lang.String targetMethod)
split off the method name preceding the signature and return it- Parameters:
targetMethod- - the unqualified method name, possibly including signature- Returns:
- the method name
-
parseMethodDescriptor
public static java.lang.String parseMethodDescriptor(java.lang.String targetMethod)
split off the signature following the method name and return it- Parameters:
targetMethod- - the unqualified method name, possibly including signature- Returns:
- the signature
-
-