Interface SootClass

All Superinterfaces:
HasPosition
All Known Implementing Classes:
JavaAnnotationSootClass, JavaSootClass

public interface SootClass extends HasPosition
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 Details

    • getClassSource

      @NonNull SootClassSource getClassSource()
    • getName

      @NonNull String getName()
    • getType

      ClassType getType()
    • getFields

      @NonNull Set<? extends SootField> getFields()
    • getMethods

      @NonNull Set<? extends SootMethod> getMethods()
    • getMethod

      @NonNull Optional<? extends SootMethod> getMethod(@NonNull MethodSubSignature subSignature)
      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

      @NonNull Optional<? extends SootField> getField(@NonNull FieldSubSignature subSignature)
      Attemtps to retrieve the field with the given FieldSubSignature.
    • getField

      @NonNull Optional<? extends SootField> getField(@NonNull String name)
      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

      @NonNull Set<? extends SootMethod> getMethodsByName(@NonNull String name)
      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

      Set<? extends ClassType> 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

      Optional<? extends ClassType> getOuterClass()
      This method returns the outer class.
    • getSuperclass

      Optional<? extends ClassType> 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 interface HasPosition
      Returns:
      a Position containing position information.
    • print

      String print()