Class OTFCompileAnalysisInputLocation
java.lang.Object
sootup.java.bytecode.frontend.inputlocation.OTFCompileAnalysisInputLocation
- All Implemented Interfaces:
AnalysisInputLocation
e.g. to simplify creating testcases - no manual compilation step is required
-
Constructor Summary
ConstructorsConstructorDescriptionOTFCompileAnalysisInputLocation(@NonNull List<Path> dotJavaFiles, @NonNull SourceType srcType, @NonNull List<BodyInterceptor> bodyInterceptors) OTFCompileAnalysisInputLocation(String fileName, String compilationUnitsContent) for Java file contents as a String i.e. not as a File on the filesystemOTFCompileAnalysisInputLocation(String fileName, String compilationUnitsContent, @NonNull SourceType srcType, @NonNull List<BodyInterceptor> bodyInterceptors) OTFCompileAnalysisInputLocation(Path dotJavaFile) existing .java filesOTFCompileAnalysisInputLocation(List<Path> dotJavaFile) -
Method Summary
Modifier and TypeMethodDescription@NonNull List<BodyInterceptor>@NonNull Optional<? extends SootClassSource>getClassSource(@NonNull ClassType type, @NonNull View view) Create or find a class source for a given type.@NonNull Stream<? extends SootClassSource>getClassSources(@NonNull View view) Scan the input location and create ClassSources for every compilation / interpretation unit.@NonNull SourceTypeIf the AnalysisInputLocation is initialized with the SourceType then this method should return that specific SourceType.
-
Constructor Details
-
OTFCompileAnalysisInputLocation
for Java file contents as a String i.e. not as a File on the filesystem -
OTFCompileAnalysisInputLocation
public OTFCompileAnalysisInputLocation(String fileName, String compilationUnitsContent, @NonNull SourceType srcType, @NonNull List<BodyInterceptor> bodyInterceptors) -
OTFCompileAnalysisInputLocation
existing .java files -
OTFCompileAnalysisInputLocation
-
OTFCompileAnalysisInputLocation
public OTFCompileAnalysisInputLocation(@NonNull List<Path> dotJavaFiles, @NonNull SourceType srcType, @NonNull List<BodyInterceptor> bodyInterceptors)
-
-
Method Details
-
getClassSource
public @NonNull Optional<? extends SootClassSource> getClassSource(@NonNull ClassType type, @NonNull View view) Description copied from interface:AnalysisInputLocationCreate or find a class source for a given type.- Specified by:
getClassSourcein interfaceAnalysisInputLocation- Parameters:
type- The type of the class to be found.- Returns:
- The source entry for that class.
-
getClassSources
Description copied from interface:AnalysisInputLocationScan the input location and create ClassSources for every compilation / interpretation unit.- Specified by:
getClassSourcesin interfaceAnalysisInputLocation- Returns:
- an Autocloseable resource that must be closed!
-
getSourceType
Description copied from interface:AnalysisInputLocationIf the AnalysisInputLocation is initialized with the SourceType then this method should return that specific SourceType. This is the default implementation and it returns null when no source type is specified.- Specified by:
getSourceTypein interfaceAnalysisInputLocation- Returns:
- returns null as source type
-
getBodyInterceptors
- Specified by:
getBodyInterceptorsin interfaceAnalysisInputLocation
-