soot.jimple.toolkits.invoke
Class AccessManager

java.lang.Object
  |
  +--soot.jimple.toolkits.invoke.AccessManager

public class AccessManager
extends java.lang.Object

Methods for checking Java scope and visibiliity requirements.


Constructor Summary
AccessManager()
           
 
Method Summary
static boolean ensureAccess(SootMethod container, ClassMember target, java.lang.String options)
          Modifies code so that an access to target is legal from code in container.
static boolean ensureAccess(SootMethod container, SootClass target, java.lang.String options)
          Modifies code so that an access to target is legal from code in container.
static boolean isAccessLegal(SootMethod container, ClassMember target)
          Returns true iff target is legally accessible from container.
static boolean isAccessLegal(SootMethod container, SootClass target)
          Returns true if an access to target is legal from code in container.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccessManager

public AccessManager()
Method Detail

isAccessLegal

public static boolean isAccessLegal(SootMethod container,
                                    ClassMember target)
Returns true iff target is legally accessible from container. Illegal access occurs when any of the following cases holds: 1. container is private, but container.declaringClass() != container.declaringClass(); or, 2. container is package-visible, and its package differs from that of container; or, 3. container is protected, and either: a. container doesn't belong to container.declaringClass, or any superclass of container;

isAccessLegal

public static boolean isAccessLegal(SootMethod container,
                                    SootClass target)
Returns true if an access to target is legal from code in container.

ensureAccess

public static boolean ensureAccess(SootMethod container,
                                   ClassMember target,
                                   java.lang.String options)
Modifies code so that an access to target is legal from code in container.

ensureAccess

public static boolean ensureAccess(SootMethod container,
                                   SootClass target,
                                   java.lang.String options)
Modifies code so that an access to target is legal from code in container.