org.erights.e.elib.prim
Class SafeJ

java.lang.Object
  |
  +--org.erights.e.elib.prim.SafeJ

public final class SafeJ
extends Object

Untamed:


Field Summary
static SafeJ ALL
          Enabled:
private static String[] ALWAYS_REMOVE
           
private static ConstMap AlwaysRemove
           
private static FlexSet ApprovedClasses
           
private static String[] ApprovedClassList
          For classes for which there's no safej file.
private  String myBaseName
           
private  boolean myInheritFlag
           
private  ConstMap myOptMap
           
static SafeJ NONE
          Enabled:
private static IdentityCacheTable SAFEJ_CACHE
           
 
Constructor Summary
SafeJ(String baseName, ConstMap optMap, boolean inheritFlag)
          Enabled:
 
Method Summary
static boolean approve(Class clazz, boolean safe)
          Enabled: Is clazz approved at this safety level?
 SafeJ forInheritance()
          Enabled:
 String getBaseName()
          Enabled: Only for debugging purposes.
 boolean getInheritFlag()
          Enabled: Is this SafeJ object being used to check addition or inheritance?
 ConstMap getOptMap()
          Enabled: An optional mapping from flat signatures to interned strings representing an enumeration of cases of what to do this methods matching that signature.
static Term getOptSafeJTerm(String fqn)
          Enabled:
(package private) static SafeJ getSafeJ(Class clazz, Class optSugar, boolean staticFlag)
           
(package private) static Object getStaticValue(Class clazz, String fieldName, Object instead)
          Gets the value of clazz's static public field named 'fieldName'.
 SafeJ or(SafeJ other)
          Enabled:
 boolean shouldAllow(String flatSig)
          Enabled: @see #getOptMap()
 String toString()
          Suppressed:
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ApprovedClassList

private static final String[] ApprovedClassList
For classes for which there's no safej file.

XXX What happens if a class has a safej file and is listed here as well?


ApprovedClasses

private static final FlexSet ApprovedClasses

ALWAYS_REMOVE

private static final String[] ALWAYS_REMOVE

AlwaysRemove

private static final ConstMap AlwaysRemove

SAFEJ_CACHE

private static final IdentityCacheTable SAFEJ_CACHE

NONE

public static final SafeJ NONE
Enabled:


ALL

public static final SafeJ ALL
Enabled:


myBaseName

private final String myBaseName

myOptMap

private final ConstMap myOptMap

myInheritFlag

private final boolean myInheritFlag
Constructor Detail

SafeJ

public SafeJ(String baseName,
             ConstMap optMap,
             boolean inheritFlag)
Enabled:

Method Detail

getOptSafeJTerm

public static Term getOptSafeJTerm(String fqn)
Enabled:


approve

public static boolean approve(Class clazz,
                              boolean safe)
Enabled: Is clazz approved at this safety level?

If approved when safe==true this means a StaticMaker on clazz follows capability discipline and provides no authority, and so can be imported with <import:...>.

If approved when safe==false, then a StaticMaker on clazz can be imported with <unsafe:...>, even once we enforce the invisibility of untamed classes.


getSafeJ

static SafeJ getSafeJ(Class clazz,
                      Class optSugar,
                      boolean staticFlag)

getStaticValue

static Object getStaticValue(Class clazz,
                             String fieldName,
                             Object instead)
Gets the value of clazz's static public field named 'fieldName'.

If there is no such field, return 'instead' instead.


toString

public String toString()
Suppressed:

Overrides:
toString in class Object
Returns:
a string representation of the object.

getBaseName

public String getBaseName()
Enabled: Only for debugging purposes.


getOptMap

public ConstMap getOptMap()
Enabled: An optional mapping from flat signatures to interned strings representing an enumeration of cases of what to do this methods matching that signature.

XXX Some of the warnings above are not yet implemented, and will require enhancements to this API in order to support.


getInheritFlag

public boolean getInheritFlag()
Enabled: Is this SafeJ object being used to check addition or inheritance?


shouldAllow

public boolean shouldAllow(String flatSig)
Enabled: @see #getOptMap()


or

public SafeJ or(SafeJ other)
Enabled:


forInheritance

public SafeJ forInheritance()
Enabled:



comments?