Class StringReps

java.lang.Object
pascal.taie.language.classes.StringReps

public final class StringReps extends Object
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 Details

    • getClassNameOf

      public static String getClassNameOf(String signature)
    • getSignatureOf

      public static String getSignatureOf(JMethod method)
    • getMethodSignature

      public static String getMethodSignature(JClass declaringClass, String methodName, List<Type> parameterTypes, Type returnType)
    • getSignatureOf

      public static String getSignatureOf(JField field)
    • getFieldSignature

      public static String getFieldSignature(JClass declaringClass, String fieldName, Type fieldType)
    • getFieldNameOf

      public static String getFieldNameOf(String fieldSig)
    • getFieldTypeOf

      public static String getFieldTypeOf(String fieldSig)
    • getSubsignatureOf

      public static String getSubsignatureOf(JMethod method)
    • getSubsignatureOf

      public static String getSubsignatureOf(MethodRef methodRef)
    • getSubsignatureOf

      public static String getSubsignatureOf(String methodSig)
    • getDescriptorOf

      public static String getDescriptorOf(JMethod method)
    • getDescriptorOf

      public static String getDescriptorOf(MethodRef methodRef)
    • toDescriptor

      public static String toDescriptor(List<Type> parameterTypes, Type returnType)
    • toSubsignature

      public static String toSubsignature(String name, List<Type> parameterTypes, Type returnType)
    • isArrayType

      public static boolean isArrayType(String typeName)
      Returns:
      true if typeName represents array type.
    • getBaseTypeNameOf

      public static String getBaseTypeNameOf(String arrayTypeName)
      Given an array type name, returns the type name of base type of the array.
    • toTaieTypeDesc

      public static String toTaieTypeDesc(String desc)
      Converts type descriptor in bytecode to Tai-e's type descriptor. For example:
      • [I to int[].
      • [[I to int[][].
      • Ljava/lang/Object; to java.lang.Object.
      • [Ljava/lang/Object; to java.lang.Object[].
    • isJavaIdentifier

      public static boolean isJavaIdentifier(@Nullable String name)
      Returns:
      true if the given string is a valid Java identifier.
    • isJavaClassName

      public static boolean isJavaClassName(@Nullable String className)
      Returns:
      true if the given string is a valid fully-qualified name of a Java class.