Class ModuleFinder
java.lang.Object
sootup.java.bytecode.frontend.inputlocation.ModuleFinder
Discovers all modules in a given module path. For automatic modules, names are generated.
Supports exploded modules, modular jars, and automatic modules as defined in the official
documentation:
- Author:
- Andreas Dann on 28.06.18
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionModuleFinder(@NonNull Path modulePath) ModuleFinder(@NonNull Path modulePath, @NonNull FileSystem fileSystem, @NonNull SourceType sourceType, @NonNull List<BodyInterceptor> bodyInterceptors) Helper Class to discover modules in a given module path.ModuleFinder(@NonNull Path modulePath, @NonNull SourceType sourceType, @NonNull List<BodyInterceptor> bodyInterceptors) -
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull StringcreateModuleNameForAutomaticModule(@NonNull Path path) Creates a name for an automatic module based on the name of a jar file.boolean@NonNull Collection<ModuleSignature>getAllModules(@NonNull IdentifierFactory identifierFactory) Discover all modules in the module path.@Nullable AnalysisInputLocationgetModule(@NonNull ModuleSignature moduleName, @NonNull IdentifierFactory identifierFactory) Returns the input location that manages the module.@NonNull Optional<JavaModuleInfo>getModuleInfo(ModuleSignature sig, @NonNull IdentifierFactory identifierFactory) @NonNull Set<ModuleSignature>getModules(@NonNull IdentifierFactory identifierFactory) inthashCode()boolean
-
Constructor Details
-
ModuleFinder
public ModuleFinder(@NonNull Path modulePath, @NonNull FileSystem fileSystem, @NonNull SourceType sourceType, @NonNull List<BodyInterceptor> bodyInterceptors) Helper Class to discover modules in a given module path.- Parameters:
modulePath- the module pathsourceType-
-
ModuleFinder
public ModuleFinder(@NonNull Path modulePath, @NonNull SourceType sourceType, @NonNull List<BodyInterceptor> bodyInterceptors) -
ModuleFinder
-
-
Method Details
-
hasMoreToResolve
public boolean hasMoreToResolve() -
getModuleInfo
public @NonNull Optional<JavaModuleInfo> getModuleInfo(ModuleSignature sig, @NonNull IdentifierFactory identifierFactory) -
getModules
-
getModule
public @Nullable AnalysisInputLocation getModule(@NonNull ModuleSignature moduleName, @NonNull IdentifierFactory identifierFactory) Returns the input location that manages the module.- Parameters:
moduleName- the module nameidentifierFactory- the factory that creates the signatures of discovered modules- Returns:
- the input location that resolves classes contained in the module
-
getAllModules
public @NonNull Collection<ModuleSignature> getAllModules(@NonNull IdentifierFactory identifierFactory) Discover all modules in the module path.- Parameters:
identifierFactory- the factory that creates the signatures of discovered modules- Returns:
- the names of all modules found
-
createModuleNameForAutomaticModule
Creates a name for an automatic module based on the name of a jar file. The implementation is consistent with parsing module names in the JDK 9.- Parameters:
path- to the jar file- Returns:
- the name of the automatic module
-
hashCode
public int hashCode() -
equals
-