Package pascal.taie.language.classes
Class StringReps
java.lang.Object
pascal.taie.language.classes.StringReps
Utility class for compute string representations of various program
elements, such as class name, method descriptor, method signature, etc.
- Method
- Signature: <CLASS_NAME: RETURN_TYPE METHOD_NAME(PARAM_LIST)>
- Subsignature: RETURN_TYPE METHOD_NAME(PARAM_LIST)
- Field
- Signature: <CLASS_NAME: FIELD_TYPE FIELD_NAME>
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getBaseTypeNameOf
(String arrayTypeName) Given an array type name, returns the type name of base type of the array.static String
getClassNameOf
(String signature) static String
getDescriptorOf
(MethodRef methodRef) static String
getDescriptorOf
(JMethod method) static String
getFieldNameOf
(String fieldSig) static String
getFieldSignature
(JClass declaringClass, String fieldName, Type fieldType) static String
getFieldTypeOf
(String fieldSig) static String
getMethodSignature
(JClass declaringClass, String methodName, List<Type> parameterTypes, Type returnType) static String
getSignatureOf
(JField field) static String
getSignatureOf
(JMethod method) static String
getSubsignatureOf
(String methodSig) static String
getSubsignatureOf
(MethodRef methodRef) static String
getSubsignatureOf
(JMethod method) static boolean
isArrayType
(String typeName) static boolean
isJavaClassName
(String className) static boolean
isJavaIdentifier
(String name) static String
toDescriptor
(List<Type> parameterTypes, Type returnType) static String
toSubsignature
(String name, List<Type> parameterTypes, Type returnType) static String
toTaieTypeDesc
(String desc) Converts type descriptor in bytecode to Tai-e's type descriptor.
-
Method Details
-
getClassNameOf
-
getSignatureOf
-
getMethodSignature
-
getSignatureOf
-
getFieldSignature
-
getFieldNameOf
-
getFieldTypeOf
-
getSubsignatureOf
-
getSubsignatureOf
-
getSubsignatureOf
-
getDescriptorOf
-
getDescriptorOf
-
toDescriptor
-
toSubsignature
-
isArrayType
- Returns:
true
iftypeName
represents array type.
-
getBaseTypeNameOf
Given an array type name, returns the type name of base type of the array. -
toTaieTypeDesc
Converts type descriptor in bytecode to Tai-e's type descriptor. For example:[I
toint[]
.[[I
toint[][]
.Ljava/lang/Object;
tojava.lang.Object
.[Ljava/lang/Object;
tojava.lang.Object[]
.
-
isJavaIdentifier
- Returns:
true
if the given string is a valid Java identifier.
-
isJavaClassName
- Returns:
true
if the given string is a valid fully-qualified name of a Java class.
-