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
Modifier and TypeFieldDescriptionprotected final ClassCache
protected final JavaIdentifierFactory
protected final List<AnalysisInputLocation>
protected boolean
-
Constructor Summary
ModifierConstructorDescriptionJavaView
(List<AnalysisInputLocation> inputLocations) JavaView
(List<AnalysisInputLocation> inputLocations, ClassCacheProvider cacheProvider) protected
JavaView
(List<AnalysisInputLocation> inputLocations, ClassCacheProvider cacheProvider, JavaIdentifierFactory idf) JavaView
(AnalysisInputLocation inputLocation) -
Method Summary
Modifier and TypeMethodDescriptionprotected Optional<JavaSootClass>
buildClassFrom
(AbstractClassSource classSource) getAnnotationClass
(ClassType type) int
Returns the number of classes that are currently stored in the cache.Resolves the class matching the providedClassType
.Resolves all classes that are part of the view and stores them in the cache.protected Optional<JavaSootClassSource>
getClassSource
(ClassType type) getField
(FieldSignature signature) Returns theIdentifierFactory
for this view.getMethod
(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
-