类 TypeHelper
java.lang.Object
com.alibaba.bytekit.utils.TypeHelper
Helpoer class providing static methods for manipulating type and class names,
field and method descriptor names etc
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static booleanequalDescriptors(String desc1, String desc2) static StringexternalizeClass(String className) convert a classname from canonical form to the form used to represent it externally i.e. replace all dots with slashesstatic StringexternalizeDescriptor(String desc) convert a method descriptor from canonical form to the form used to represent it externallystatic StringexternalizeType(String typeName) convert a type name from canonical form to the form used to represent it externally i.e.static StringinternalizeClass(String className) convert a classname from external form to canonical form i.e. replace all slashes with dotsstatic StringinternalizeDescriptor(String desc) convert a method descriptor from the form used to represent it externally to canonical formstatic StringparseMethodDescriptor(String targetMethod) split off the signature following the method name and return itstatic StringparseMethodName(String targetMethod) split off the method name preceding the signature and return it
-
构造器详细资料
-
TypeHelper
public TypeHelper()
-
-
方法详细资料
-
equalDescriptors
-
externalizeClass
convert a classname from canonical form to the form used to represent it externally i.e. replace all dots with slashes- 参数:
className- the canonical name- 返回:
- the external name
-
internalizeClass
convert a classname from external form to canonical form i.e. replace all slashes with dots- 参数:
className- the external name- 返回:
- the canonical name
-
externalizeType
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 '['.- 参数:
typeName- the type name- 返回:
- the external name
-
externalizeDescriptor
convert a method descriptor from canonical form to the form used to represent it externally- 参数:
desc- the method descriptor which must be trimmed of any surrounding white space- 返回:
- an externalised form for the descriptor
-
internalizeDescriptor
convert a method descriptor from the form used to represent it externally to canonical form- 参数:
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- 返回:
- an internalised form for the descriptor, possibly followed by a space and externalized return type
-
parseMethodName
split off the method name preceding the signature and return it- 参数:
targetMethod- - the unqualified method name, possibly including signature- 返回:
- the method name
-
parseMethodDescriptor
split off the signature following the method name and return it- 参数:
targetMethod- - the unqualified method name, possibly including signature- 返回:
- the signature
-