Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## jif.types.principal
Class Principal_c

    java.lang.Object
      polyglot.ext.jl.types.TypeObject_c
          jif.types.principal.Principal_c

All Implemented Interfaces:
  java.io.Serializable, java.lang.Cloneable, Param, Principal, polyglot.types.TypeObject, polyglot.util.Copy

Direct Known Subclasses:
  DynamicPrincipal_c, ExternalPrincipal_c, ParamPrincipal_c, UnknownPrincipal_c

    public abstract class Principal_c

extends polyglot.ext.jl.types.TypeObject_c
implements Principal

An abstract implementation of the `Principal` interface.

See Also:
  Serialized Form

Field Summary

Fields inherited from class polyglot.ext.jl.types.TypeObject_c
`position, ts`

Constructor Summary
`Principal_c(JifTypeSystem ts, polyglot.util.Position pos)`
`Principal_c(JifTypeSystem ts, polyglot.util.Position pos, PrincipalToJavaExpr toJava)`

Method Summary
`abstract boolean` | `equalsImpl(polyglot.types.TypeObject o)`
`abstract int` | `hashCode()`
`abstract boolean` | `isCanonical()`
`abstract boolean` | `isRuntimeRepresentable()`
`PathMap` | `labelCheck(JifContext A)` Label check the principal, which will determine how much information may be gained if the principal is evaluated at runtime.
`Principal` | `subst(LabelSubstitution substitution)`
`java.util.List` | `throwTypes(polyglot.types.TypeSystem ts)` If the principal is runtime representable, when it is evaluated at runtime it may throw exceptions.
`polyglot.ast.Expr` | `toJava(JifToJavaRewriter rw)`

Methods inherited from class polyglot.ext.jl.types.TypeObject_c
`copy, equals, position, typeSystem`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface polyglot.types.TypeObject
`position, typeSystem`

Methods inherited from interface polyglot.util.Copy
`copy`

Constructor Detail

### Principal_c

    public Principal_c(JifTypeSystem ts,
                       polyglot.util.Position pos)

### Principal_c

    public Principal_c(JifTypeSystem ts,
                       polyglot.util.Position pos,
                       PrincipalToJavaExpr toJava)

Method Detail

### toJava

    public polyglot.ast.Expr toJava(JifToJavaRewriter rw)
                             throws polyglot.types.SemanticException

  Specified by:
    `toJava` in interface `Principal`
  Throws:
    `polyglot.types.SemanticException`

### isCanonical

    public abstract boolean isCanonical()

  Specified by:
    `isCanonical` in interface `Param`
  Specified by:
    `isCanonical` in interface `polyglot.types.TypeObject`

### isRuntimeRepresentable

    public abstract boolean isRuntimeRepresentable()

  Specified by:
    `isRuntimeRepresentable` in interface `Param`

### equalsImpl

    public abstract boolean equalsImpl(polyglot.types.TypeObject o)

  Specified by:
    `equalsImpl` in interface `polyglot.types.TypeObject`
  Overrides:
    `equalsImpl` in class `polyglot.ext.jl.types.TypeObject_c`

### hashCode

    public abstract int hashCode()

  Overrides:
    `hashCode` in class `polyglot.ext.jl.types.TypeObject_c`

### throwTypes

    public java.util.List throwTypes(polyglot.types.TypeSystem ts)

  Description copied from interface: `Principal`
  If the principal is runtime representable, when it is evaluated at runtime it may throw exceptions. This method returns a list of the exceptions that the runtime evaluation of the principal may produce. If the principal cannot be evaluated at runtime, an empty list should be returned.

  Specified by:
    `throwTypes` in interface `Principal`

### subst

    public Principal subst(LabelSubstitution substitution)
                    throws polyglot.types.SemanticException

  Specified by:
    `subst` in interface `Principal`
  Parameters:
    `substitution` - The `LabelSubstitution` to apply to this principal
  Returns:
    the result of applying labelSubst to this principal.
  Throws:
    `polyglot.types.SemanticException`

### labelCheck

    public PathMap labelCheck(JifContext A)

  Description copied from interface: `Principal`
  Label check the principal, which will determine how much information may be gained if the principal is evaluated at runtime. For example, given the dynamic principal p, where p is a local variable, evaluation of this label at runtime will reveal as much information as the label of p. For example, the following code is illegal, as the runtime evaluation of the principal reveals too much information

       boolean{Alice:} secret = ...;
       final principal{Alice:} p = secret?Bob:Chuck;
       boolean{} leak = false;
       if (p actsfor Bob) { // evaluation of p reveals
                            // information at level {Alice:}
           leak = true;
              }

  Specified by:
    `labelCheck` in interface `Principal`
  See Also:
    `Jif.labelCheck(LabelChecker)`, `Label.labelCheck(JifContext)`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD