Tabnine Logo
SootClass.isInterface
Code IndexAdd Tabnine to your IDE (free)

How to use
isInterface
method
in
soot.SootClass

Best Java code snippets using soot.SootClass.isInterface (Showing top 20 results out of 315)

origin: Sable/soot

public boolean isClass() {
 if (type instanceof ArrayType || type instanceof NullType
   || (type instanceof RefType && !((RefType) type).getSootClass().isInterface())) {
  return true;
 }
 return false;
}
origin: Sable/soot

/** Returns true if this class is not an interface and not abstract. */
public boolean isConcrete() {
 return !isInterface() && !isAbstract();
}
origin: Sable/soot

/** Returns a list of direct subinterfaces of c, including itself. */
public List<SootClass> getDirectSubinterfacesOfIncluding(SootClass c) {
 c.checkLevel(SootClass.HIERARCHY);
 if (!c.isInterface()) {
  throw new RuntimeException("interface needed!");
 }
 checkState();
 List<SootClass> l = new ArrayList<SootClass>();
 l.addAll(interfaceToDirSubinterfaces.get(c));
 l.add(c);
 return Collections.unmodifiableList(l);
}
origin: Sable/soot

/** Returns a list of subclasses of c, including itself. */
public List<SootClass> getSubclassesOfIncluding(SootClass c) {
 c.checkLevel(SootClass.HIERARCHY);
 if (c.isInterface()) {
  throw new RuntimeException("class needed!");
 }
 List<SootClass> l = new ArrayList<SootClass>();
 l.addAll(getSubclassesOf(c));
 l.add(c);
 return Collections.unmodifiableList(l);
}
origin: Sable/soot

/** Returns a list of superinterfaces of c, including itself. */
public List<SootClass> getSuperinterfacesOfIncluding(SootClass c) {
 c.checkLevel(SootClass.HIERARCHY);
 if (!c.isInterface()) {
  throw new RuntimeException("interface needed!");
 }
 List<SootClass> l = new ArrayList<SootClass>();
 l.addAll(getSuperinterfacesOf(c));
 l.add(c);
 return Collections.unmodifiableList(l);
}
origin: Sable/soot

/** Returns a list of direct subclasses of c, including c. */
public List<SootClass> getDirectSubclassesOfIncluding(SootClass c) {
 c.checkLevel(SootClass.HIERARCHY);
 if (c.isInterface()) {
  throw new RuntimeException("class needed!");
 }
 checkState();
 List<SootClass> l = new ArrayList<SootClass>();
 l.addAll(classToDirSubclasses.get(c));
 l.add(c);
 return Collections.unmodifiableList(l);
}
origin: Sable/soot

/** Returns a list of direct implementers of c, excluding itself. */
public List<SootClass> getDirectImplementersOf(SootClass i) {
 i.checkLevel(SootClass.HIERARCHY);
 if (!i.isInterface()) {
  throw new RuntimeException("interface needed; got " + i);
 }
 checkState();
 return Collections.unmodifiableList(interfaceToDirImplementers.get(i));
}
origin: Sable/soot

/** Returns a list of direct subclasses of c, excluding c. */
public List<SootClass> getDirectSubclassesOf(SootClass c) {
 c.checkLevel(SootClass.HIERARCHY);
 if (c.isInterface()) {
  throw new RuntimeException("class needed!");
 }
 checkState();
 return Collections.unmodifiableList(classToDirSubclasses.get(c));
}
origin: Sable/soot

/** Returns a list of direct subinterfaces of c. */
public List<SootClass> getDirectSubinterfacesOf(SootClass c) {
 c.checkLevel(SootClass.HIERARCHY);
 if (!c.isInterface()) {
  throw new RuntimeException("interface needed!");
 }
 checkState();
 return interfaceToDirSubinterfaces.get(c);
}
origin: Sable/soot

private Set<SootClass> getChildrenOfIncluding(Collection<SootClass> classes) {
 return Stream
   .concat(classes.stream().filter(c -> !c.getName().equals("java.lang.Object"))
     .map(c -> c.isInterface() ? Scene.v().getActiveHierarchy().getImplementersOf(c)
       : Scene.v().getActiveHierarchy().getSubclassesOf(c))
     .flatMap(Collection::stream), classes.stream())
   .collect(toSet());
}
origin: Sable/soot

@Override
public void validate(SootClass sc, List<ValidationException> exceptions) {
 if (sc.isInterface() && sc.isEnum()) {
  exceptions.add(new ValidationException(sc, "Class is both an interface and an enum"));
 }
 if (sc.isSynchronized()) {
  exceptions.add(new ValidationException(sc, "Classes cannot be synchronized"));
 }
}
origin: Sable/soot

/** Returns a list of implementers of c, excluding itself. */
public List<SootClass> getImplementersOf(SootClass i) {
 i.checkLevel(SootClass.HIERARCHY);
 if (!i.isInterface()) {
  throw new RuntimeException("interface needed; got " + i);
 }
 checkState();
 ArraySet<SootClass> set = new ArraySet<SootClass>();
 for (SootClass c : getSubinterfacesOfIncluding(i)) {
  set.addAll(getDirectImplementersOf(c));
 }
 ArrayList<SootClass> l = new ArrayList<SootClass>();
 l.addAll(set);
 return Collections.unmodifiableList(l);
}
origin: Sable/soot

private static List<SootClass> getVisibleApplicationClasses(SootMethod visibleBy) {
 final List<SootClass> result = new ArrayList<>();
 final Iterator<SootClass> applicationClassesIterator = Scene.v().getApplicationClasses().snapshotIterator();
 while (applicationClassesIterator.hasNext()) {
  final SootClass applicationClass = applicationClassesIterator.next();
  if (applicationClass.isConcrete() && !applicationClass.isInterface() && applicationClass.isPublic()
    && Scene.v().getActiveHierarchy().isVisible(applicationClass, visibleBy)) {
   result.add(applicationClass);
  }
 }
 return result;
}
origin: Sable/soot

private List<SootClass> getParentsOfIncluding(SootClass applicationClass) {
 // result contains of interfaces that implements passed applicationClass
 final List<SootClass> result = HierarchyUtils.getAllInterfacesOf(applicationClass);
 // add implementing interfaces
 result.addAll(applicationClass.getInterfaces());
 // add extending class if any
 if (!applicationClass.isInterface() && applicationClass.hasSuperclass()) {
  result.add(applicationClass.getSuperclass());
 }
 // and superclasses (superinterfaces) of passed applicationClass
 result.addAll(
   applicationClass.isInterface() ? Scene.v().getActiveHierarchy().getSuperinterfacesOfIncluding(applicationClass)
     : Scene.v().getActiveHierarchy().getSuperclassesOfIncluding(applicationClass));
 return result;
}
origin: Sable/soot

public JInterfaceInvokeExpr(Value base, SootMethodRef methodRef, List<? extends Value> args) {
 super(Jimple.v().newLocalBox(base), methodRef, new ValueBox[args.size()]);
 // Check that the method's class is resolved enough
 // CheckLevel returns without doing anything because we can be not 'done' resolving
 methodRef.declaringClass().checkLevelIgnoreResolving(SootClass.HIERARCHY);
 // now check if the class is valid
 if (!methodRef.declaringClass().isInterface() && !methodRef.declaringClass().isPhantom()) {
  throw new RuntimeException("Trying to create interface invoke expression for non-interface type: "
    + methodRef.declaringClass() + " Use JVirtualInvokeExpr or JSpecialInvokeExpr instead!");
 }
 for (int i = 0; i < args.size(); i++) {
  this.argBoxes[i] = Jimple.v().newImmediateBox(args.get(i));
 }
}
origin: Sable/soot

@Override
public void caseVirtualInvokeInst(VirtualInvokeInst i) {
 SootMethodRef m = i.getMethodRef();
 mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, slashify(m.declaringClass().getName()), m.name(), toTypeDesc(m),
   m.declaringClass().isInterface());
}
origin: Sable/soot

@Override
public void caseSpecialInvokeInst(SpecialInvokeInst i) {
 SootMethodRef m = i.getMethodRef();
 mv.visitMethodInsn(Opcodes.INVOKESPECIAL, slashify(m.declaringClass().getName()), m.name(), toTypeDesc(m),
   m.declaringClass().isInterface());
}
origin: Sable/soot

private boolean isSuitableClassToAddFieldConstant(SootClass sc, Constant constant) {
 if (sc.isInterface()) {
  return false;
 }
 if (constant instanceof ClassConstant) {
  ClassConstant classConstant = (ClassConstant) constant;
  RefType type = (RefType) classConstant.toSootType();
  SootClass classFromConstant = type.getSootClass();
  Hierarchy hierarchy = Scene.v().getActiveHierarchy();
  return hierarchy.isVisible(sc, classFromConstant);
 }
 return true;
}
origin: Sable/soot

@Override
public void caseStaticInvokeInst(StaticInvokeInst i) {
 SootMethodRef m = i.getMethodRef();
 mv.visitMethodInsn(Opcodes.INVOKESTATIC, slashify(m.declaringClass().getName()), m.name(), toTypeDesc(m),
   m.declaringClass().isInterface() && !m.isStatic());
}
origin: Sable/soot

public boolean isExceptionPointer(Node v) {
 if (v.getType() instanceof RefType) {
  SootClass sc = ((RefType) v.getType()).getSootClass();
  if (!sc.isInterface()
    && Scene.v().getActiveHierarchy().isClassSubclassOfIncluding(sc, Constants.exeception_type.getSootClass())) {
   return true;
  }
 }
 return false;
}
sootSootClassisInterface

Javadoc

Convenience method; returns true if this class is an interface.

Popular methods of SootClass

  • getMethods
  • getName
    Returns the name of this class.
  • setApplicationClass
    Makes this class an application class.
  • getFields
    Returns a backed Chain of fields.
  • getInterfaces
    Returns a backed Chain of the interfaces that are directly implemented by this class. (see getInterf
  • getSuperclass
    WARNING: interfaces are subclasses of the java.lang.Object class! Returns the superclass of this cla
  • hasSuperclass
    WARNING: interfaces are subclasses of the java.lang.Object class! Does this class have a superclass?
  • resolvingLevel
  • addMethod
    Adds the given method to this class.
  • declaresMethod
    Does this class declare a method with the given subsignature?
  • getMethod
  • getType
    Returns the RefType corresponding to this class.
  • getMethod,
  • getType,
  • isApplicationClass,
  • isLibraryClass,
  • addField,
  • isAbstract,
  • isPhantom,
  • <init>,
  • declaresField

Popular in Java

  • Finding current android device location
  • addToBackStack (FragmentTransaction)
  • getSharedPreferences (Context)
  • getApplicationContext (Context)
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Notification (javax.management)
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now