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:
JavaEagerView,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 ClassCacheprotected final @NonNull JavaIdentifierFactoryprotected final @NonNull List<AnalysisInputLocation>protected boolean -
Constructor Summary
ConstructorsModifierConstructorDescriptionJavaView(@NonNull List<AnalysisInputLocation> inputLocations) JavaView(@NonNull List<AnalysisInputLocation> inputLocations, @NonNull ClassCacheProvider cacheProvider) protectedJavaView(@NonNull List<AnalysisInputLocation> inputLocations, @NonNull ClassCacheProvider cacheProvider, @NonNull JavaIdentifierFactory idf) JavaView(@NonNull AnalysisInputLocation inputLocation) -
Method Summary
Modifier and TypeMethodDescriptionprotected @NonNull JavaSootClassbuildClassFrom(JavaSootClassSource classSource) intReturns 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 JavaIdentifierFactoryReturns theIdentifierFactoryfor 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
getTypeHierarchyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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.
-
getMethod
Description copied from class:AbstractViewresolve 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:
getMethodin interfaceView- Overrides:
getMethodin classAbstractView
-
getField
- Specified by:
getFieldin interfaceView- Overrides:
getFieldin classAbstractView
-
getIdentifierFactory
Description copied from interface:ViewReturns theIdentifierFactoryfor this view. -
getCachedClassesCount
public int getCachedClassesCount()Returns the number of classes that are currently stored in the cache. -
getClassSource
-
buildClassFrom
-