Package sootup.java.core.views
Class JavaView
java.lang.Object
sootup.core.views.AbstractView
sootup.java.core.views.JavaView
- All Implemented Interfaces:
View
- Direct Known Subclasses:
JavaModuleView
,MutableJavaView
The Class JavaView manages the Java classes of the application being analyzed. This view cannot
be altered after its creation.
- Author:
- Linghui Luo created on 31.07.2018, Jan Martin Persch
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final @NonNull ClassCache
protected final @NonNull JavaIdentifierFactory
protected final @NonNull List<AnalysisInputLocation>
protected boolean
-
Constructor Summary
ConstructorsModifierConstructorDescriptionJavaView
(@NonNull List<AnalysisInputLocation> inputLocations) JavaView
(@NonNull List<AnalysisInputLocation> inputLocations, @NonNull ClassCacheProvider cacheProvider) protected
JavaView
(@NonNull List<AnalysisInputLocation> inputLocations, @NonNull ClassCacheProvider cacheProvider, @NonNull JavaIdentifierFactory idf) JavaView
(@NonNull AnalysisInputLocation inputLocation) -
Method Summary
Modifier and TypeMethodDescriptionprotected @NonNull JavaSootClass
buildClassFrom
(AbstractClassSource classSource) @NonNull Optional<JavaAnnotationSootClass>
getAnnotationClass
(@NonNull ClassType type) int
Returns the number of classes that are currently stored in the cache.@NonNull Optional<JavaSootClass>
Resolves the class matching the providedClassType
.@NonNull Stream<JavaSootClass>
Resolves all classes that are part of the view and stores them in the cache.protected @NonNull Optional<JavaSootClassSource>
getClassSource
(@NonNull ClassType type) @NonNull Optional<JavaSootField>
getField
(@NonNull FieldSignature signature) @NonNull JavaIdentifierFactory
Returns theIdentifierFactory
for this view.@NonNull Optional<JavaSootMethod>
getMethod
(@NonNull MethodSignature signature) resolve and check for accessibility of the class from a given package * TODO: incorporate AccessUtil @NonNull public synchronized Optional<T> getClass( @NonNull PackageName entryPackage, @NonNull ClassType type) { Optional<T> aClass = getClass(type); if (aClass.isPresent() && AccessUtil.isAccessible(entryPackage, aClass.get()) ) { return Optional.empty(); } return aClass; }Methods inherited from class sootup.core.views.AbstractView
getTypeHierarchy
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface sootup.core.views.View
getClassOrThrow
-
Field Details
-
identifierFactory
-
inputLocations
-
cache
-
isFullyResolved
protected volatile boolean isFullyResolved
-
-
Constructor Details
-
JavaView
-
JavaView
-
JavaView
public JavaView(@NonNull List<AnalysisInputLocation> inputLocations, @NonNull ClassCacheProvider cacheProvider) -
JavaView
protected JavaView(@NonNull List<AnalysisInputLocation> inputLocations, @NonNull ClassCacheProvider cacheProvider, @NonNull JavaIdentifierFactory idf)
-
-
Method Details
-
getClasses
Resolves all classes that are part of the view and stores them in the cache. -
getClass
Resolves the class matching the providedClassType
.- Returns:
- A class with given signature.
-
getAnnotationClass
-
getMethod
Description copied from class:AbstractView
resolve and check for accessibility of the class from a given package * TODO: incorporate AccessUtil @NonNull public synchronized Optional<T> getClass( @NonNull PackageName entryPackage, @NonNull ClassType type) { Optional<T> aClass = getClass(type); if (aClass.isPresent() && AccessUtil.isAccessible(entryPackage, aClass.get()) ) { return Optional.empty(); } return aClass; }- Specified by:
getMethod
in interfaceView
- Overrides:
getMethod
in classAbstractView
-
getField
- Specified by:
getField
in interfaceView
- Overrides:
getField
in classAbstractView
-
getIdentifierFactory
Description copied from interface:View
Returns theIdentifierFactory
for this view. -
getCachedClassesCount
public int getCachedClassesCount()Returns the number of classes that are currently stored in the cache. -
getClassSource
-
buildClassFrom
-