Class SootClass

All Implemented Interfaces:
HasPosition
Direct Known Subclasses:
JavaSootClass

public class SootClass extends AbstractClass implements 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.
Author:
Manuel Benz, Linghui Luo, Jan Martin Persch
  • Field Details

  • Constructor Details

  • Method Details

    • getMethods

      @Nonnull public Set<? extends SootMethod> getMethods()
      Gets the methods of this SootClass in an immutable set.
      Specified by:
      getMethods in class AbstractClass
    • getFields

      @Nonnull public Set<? extends SootField> getFields()
      Gets the fields of this SootClass in an immutable set.
      Specified by:
      getFields in class AbstractClass
    • getModifiers

      @Nonnull public Set<ClassModifier> getModifiers()
      Returns the modifiers of this class in an immutable set.
    • getInterfaces

      public 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.
    • implementsInterface

      public boolean implementsInterface(@Nonnull ClassType classSignature)
      Does this class directly implement the given interface? (see getInterfaceCount())
    • hasSuperclass

      public boolean hasSuperclass()
      WARNING: interfaces are subclasses of the java.lang.Object class! Does this class have a superclass? False implies that this is the java.lang.Object class. Note that interfaces are subclasses of the java.lang.Object class.
    • getSuperclass

      public Optional<? extends ClassType> getSuperclass()
      WARNING: interfaces in Java are subclasses of the java.lang.Object class! Returns the superclass of this class. (see hasSuperclass())
    • hasOuterClass

      public boolean hasOuterClass()
    • getOuterClass

      @Nonnull public Optional<? extends ClassType> getOuterClass()
      This method returns the outer class.
    • isInnerClass

      public boolean isInnerClass()
    • getType

      @Nonnull public ClassType getType()
      Returns the ClassSignature of this class.
      Specified by:
      getType in class AbstractClass
    • isInterface

      public boolean isInterface()
      Convenience method; returns true if this class is an interface.
    • isEnum

      public boolean isEnum()
      Convenience method; returns true if this class is an enumeration.
    • isSuper

      public boolean isSuper()
      Convenience method; returns true if this class is synchronized.
    • isConcrete

      public boolean isConcrete()
      Returns true if this class is not an interface and not abstract.
    • isPublic

      public boolean isPublic()
      Convenience method; returns true if this class is public.
    • toString

      @Nonnull public String toString()
      Returns the name of this class.
      Overrides:
      toString in class Object
    • print

      @Nonnull public String print()
      Returns the serialized Jimple of this SootClass as String
    • isApplicationClass

      public boolean isApplicationClass()
      Returns true if this class is an application class.
    • isLibraryClass

      public boolean isLibraryClass()
      Returns true if this class is a library class.
    • isPrivate

      public boolean isPrivate()
      Convenience method returning true if this class is private.
    • isProtected

      public boolean isProtected()
      Convenience method returning true if this class is protected.
    • isAbstract

      public boolean isAbstract()
      Convenience method returning true if this class is abstract.
    • isFinal

      public boolean isFinal()
      Convenience method returning true if this class is final.
    • isStatic

      public boolean isStatic()
      Convenience method returning true if this class is static.
    • isAnnotation

      public boolean isAnnotation()
    • getPosition

      @Nonnull public 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.
    • getClassSource

      @Nonnull public SootClassSource getClassSource()
      Overrides:
      getClassSource in class AbstractClass
    • getName

      @Nonnull public String getName()
      Specified by:
      getName in class AbstractClass
    • withClassSource

      @Nonnull public SootClass withClassSource(@Nonnull SootClassSource classSource)
    • withSourceType

      @Nonnull public SootClass withSourceType(@Nonnull SourceType sourceType)