Package sootup.core.model
Interface SootClass
- All Superinterfaces:
HasPosition
- All Known Implementing Classes:
JavaAnnotationSootClass
,JavaSootClass
Soot's counterpart of the source languages class concept. Soot representation of a Java class.
They are usually created by a Scene, but can also be constructed manually through the given
constructors.
SootClass represents a class/module lives in View
. It may have different
implementations, since we want to support multiple languages. A SootClass must be uniquely
identified by its Signature
- Author:
- Manuel Benz, Linghui Luo, Jan Martin Persch
-
Method Summary
Modifier and TypeMethodDescription@NonNull SootClassSource
Returns the field of this class with the given name.getField
(@NonNull FieldSubSignature subSignature) Attemtps to retrieve the field with the given FieldSubSignature.Returns a backed Chain of the interfaces that are directly implemented by this class.@NonNull Optional<? extends SootMethod>
Attempts to retrieve the method with the given name and parameters.@NonNull Optional<? extends SootMethod>
getMethod
(@NonNull MethodSubSignature subSignature) Attempts to retrieve the method with the given subSignature.@NonNull Set<? extends SootMethod>
@NonNull Set<? extends SootMethod>
getMethodsByName
(@NonNull String name) Attempts to retrieve the method with the given name.Returns the modifiers of this class in an immutable set.@NonNull String
getName()
This method returns the outer class.Line and column information of the corresponding code object that this represents.WARNING: interfaces in Java are subclasses of the java.lang.Object class!getType()
boolean
boolean
boolean
boolean
boolean
boolean
boolean
isEnum()
boolean
isFinal()
boolean
boolean
boolean
boolean
boolean
boolean
isPublic()
boolean
isStatic()
boolean
isSuper()
print()
-
Method Details
-
getClassSource
@NonNull SootClassSource getClassSource() -
getName
@NonNull String getName() -
getType
ClassType getType() -
getFields
-
getMethods
@NonNull Set<? extends SootMethod> getMethods() -
getMethod
Attempts to retrieve the method with the given subSignature. This method may throw an AmbiguousStateException if there are more than one method with the given subSignature. If no method with the given is found, null is returned. -
getField
Attemtps to retrieve the field with the given FieldSubSignature. -
getField
Returns the field of this class with the given name. Throws a ResolveException if there is more than one field with the given name. Returns null if no field with the given name exists. -
getMethod
@NonNull Optional<? extends SootMethod> getMethod(@NonNull String name, @NonNull Iterable<? extends Type> parameterTypes) Attempts to retrieve the method with the given name and parameters. This method may throw an ResolveException if there is more than one method with the given name and parameter. -
getMethodsByName
Attempts to retrieve the method with the given name. This method will return an empty Set if there is no method with the given name.- Parameters:
name
- the name of the method- Returns:
- a set of methods that have the given name
-
getModifiers
Set<ClassModifier> getModifiers()Returns the modifiers of this class in an immutable set. -
getInterfaces
Returns a backed Chain of the interfaces that are directly implemented by this class. Note that direct implementation corresponds to an "implements" keyword in the Java class file and that this class may still be implementing additional interfaces in the usual sense by being a subclass of a class which directly implements some interfaces. -
getOuterClass
This method returns the outer class. -
getSuperclass
WARNING: interfaces in Java are subclasses of the java.lang.Object class! Returns the superclass of this class. (see hasSuperclass()) -
isInterface
boolean isInterface() -
isEnum
boolean isEnum() -
isSuper
boolean isSuper() -
isConcrete
boolean isConcrete() -
isPublic
boolean isPublic() -
isApplicationClass
boolean isApplicationClass() -
isLibraryClass
boolean isLibraryClass() -
isPrivate
boolean isPrivate() -
isProtected
boolean isProtected() -
isAbstract
boolean isAbstract() -
isFinal
boolean isFinal() -
isStatic
boolean isStatic() -
isAnnotation
boolean isAnnotation() -
isInnerClass
boolean isInnerClass() -
hasSuperclass
boolean hasSuperclass() -
hasOuterClass
boolean hasOuterClass() -
getPosition
Position getPosition()Description copied from interface:HasPosition
Line and column information of the corresponding code object that this represents.- Specified by:
getPosition
in interfaceHasPosition
- Returns:
- a
Position
containing position information.
-
print
String print()
-