Class JavaModuleIdentifierFactory

java.lang.Object
sootup.java.core.JavaIdentifierFactory
sootup.java.core.JavaModuleIdentifierFactory
All Implemented Interfaces:
IdentifierFactory

public class JavaModuleIdentifierFactory extends JavaIdentifierFactory
  • Field Details

  • Constructor Details

    • JavaModuleIdentifierFactory

      public JavaModuleIdentifierFactory()
  • Method Details

    • getInstance

      public static JavaModuleIdentifierFactory getInstance()
    • getInstance

      public static JavaModuleIdentifierFactory getInstance(@NonNull String module)
    • getInstance

      public static JavaModuleIdentifierFactory getInstance(@NonNull ModuleSignature moduleSignature)
    • isMainSubSignature

      public boolean isMainSubSignature(@NonNull MethodSubSignature methodSubSignature)
      Specified by:
      isMainSubSignature in interface IdentifierFactory
      Overrides:
      isMainSubSignature in class JavaIdentifierFactory
    • getClassType

      public ModuleJavaClassType getClassType(String className, String packageName)
      Description copied from class: JavaIdentifierFactory
      Always creates a new ClassSignature. In opposite to PackageSignatures, ClassSignatures are not cached because the are unique per class, and thus reusing them does not make sense.
      Specified by:
      getClassType in interface IdentifierFactory
      Overrides:
      getClassType in class JavaIdentifierFactory
      Parameters:
      className - the simple class name
      packageName - the Java package name; must not be null use empty string for the default package PackageName.DEFAULT_PACKAGE the Java package name
      Returns:
      a ClassSignature for a Java class
    • getClassType

      public ModuleJavaClassType getClassType(String fullyQualyfiedClassNameWithModule)
      Description copied from class: JavaIdentifierFactory
      Always creates a new ClassSignature.
      Specified by:
      getClassType in interface IdentifierFactory
      Overrides:
      getClassType in class JavaIdentifierFactory
      Parameters:
      fullyQualyfiedClassNameWithModule - the fully-qualified name of the class
      Returns:
      a ClassSignature for a Java Class
    • getClassType

      public ModuleJavaClassType getClassType(@NonNull String className, @NonNull String packageName, @NonNull String moduleName)
      Always creates a new ClassSignature. In opposite to PackageSignatures and ModuleSignatures, ClassSignatures are not cached because the are unique per class, and thus reusing them does not make sense.
      Parameters:
      className - the simple name of the class
      packageName - the declaring package
      moduleName - the declaring module
      Returns:
      a ClassSignature for a Java 9 class
      Throws:
      NullPointerException - if the given module name or package name is null. Use the empty string to denote the unnamed module or the default package.
    • getClassType

      public ModuleJavaClassType getClassType(@NonNull String className, @NonNull String packageName, @NonNull ModuleSignature moduleSignature)
    • getModuleSignature

      public static ModuleSignature getModuleSignature(@NonNull String moduleName)
      Returns a unique ModuleSignature. The method looks up a cache if it already contains a signature with the given module name. If the cache lookup fails a new signature is created. Returns a unique ModuleSignature. The method looks up a cache if it already contains a signature with the given module name. If the cache lookup fails a new signature is created.
      Parameters:
      moduleName - the module name; Must not be null. Use the empty string for the unnamed module
      Returns:
      a ModuleSignature
      Throws:
      NullPointerException - if the given module name is null. Use the empty string to denote the unnamed module.
    • getPackageName

      public ModulePackageName getPackageName(@NonNull String packageName)
      Description copied from class: JavaIdentifierFactory
      Returns a unique PackageName. The method looks up a cache if it already contains a signature with the given package name. If the cache lookup fails a new signature is created.
      Specified by:
      getPackageName in interface IdentifierFactory
      Overrides:
      getPackageName in class JavaIdentifierFactory
      Parameters:
      packageName - the Java package name; must not be null use empty string for the default package PackageName.DEFAULT_PACKAGE
      Returns:
      a PackageName
    • getPackageName

      public ModulePackageName getPackageName(@NonNull String packageName, @NonNull String moduleName)
      Returns a unique PackageName. The methodRef looks up a cache if it already contains a signature with the given package and module name. If the cache lookup fails a new signature is created.
      Parameters:
      packageName - the package name; must not be null use empty string for the default package
      moduleName - the module containing the package; must not be null use empty string for the unnamed module ModuleSignature.UNNAMED_MODULE
      Returns:
      a ModulePackageName
      Throws:
      NullPointerException - if the given module name or package name is null. Use the empty string to denote the unnamed module or the default package.
    • getPackageName

      public ModulePackageName getPackageName(@NonNull String packageName, @NonNull ModuleSignature moduleSignature)