jif.types.principal

## Class DynamicPrincipal_c

- java.lang.Object
- - polyglot.types.TypeObject_c
  - - jif.types.Param_c
    - - jif.types.principal.Principal_c
      - - jif.types.principal.DynamicPrincipal_c

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, ActsForParam, Param, DynamicPrincipal, Principal, polyglot.types.TypeObject, polyglot.util.Copy<polyglot.types.TypeObject>

      public class DynamicPrincipal_c
      extends Principal_c
      implements DynamicPrincipal

  An implementation of the `DynamicPrincipal` interface.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface polyglot.util.Copy

      `polyglot.util.Copy.Util`

  - ### Field Summary

    - ### Fields inherited from class jif.types.principal.Principal_c

      `variables`

    - ### Fields inherited from class polyglot.types.TypeObject_c

      `position, ts`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DynamicPrincipal_c(AccessPath path, JifTypeSystem ts, polyglot.util.Position pos, PrincipalToJavaExpr toJava)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equalsImpl(polyglot.types.TypeObject o)`
    `int` | `hashCode()`
    `boolean` | `isCanonical()`
    `boolean` | `isRuntimeRepresentable()`
    `PathMap` | `labelCheck(JifContext A, LabelChecker lc)` Label check the principal, which will determine how much information may be gained if the principal is evaluated at runtime.
    `AccessPath` | `path()`
    `Principal` | `subst(LabelSubstitution substitution)`
    `java.util.List<polyglot.types.Type>` | `throwTypes(polyglot.types.TypeSystem ts)` If the principal is runtime representable, when it is evaluated at runtime it may throw exceptions.
    `java.lang.String` | `toString()`

    - ### Methods inherited from class jif.types.principal.Principal_c

      `hasVariables, isBottomPrincipal, isTopPrincipal, simplify, toJava, variables`

    - ### Methods inherited from class jif.types.Param_c

      `typeSystem`

    - ### Methods inherited from class polyglot.types.TypeObject_c

      `copy, equals, position`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface jif.types.principal.Principal

      `hasVariables, isBottomPrincipal, isTopPrincipal, simplify, variables`

    - ### Methods inherited from interface jif.types.ActsForParam

      `toJava`

    - ### Methods inherited from interface jif.types.Param

      `typeSystem`

    - ### Methods inherited from interface polyglot.types.TypeObject

      `position`

    - ### Methods inherited from interface polyglot.util.Copy

      `copy`

- - ### Constructor Detail

    - #### DynamicPrincipal_c

          public DynamicPrincipal_c(AccessPath path,
                                    JifTypeSystem ts,
                                    polyglot.util.Position pos,
                                    PrincipalToJavaExpr toJava)

  - ### Method Detail

    - #### path

          public AccessPath path()

      Specified by:
        `path` in interface `DynamicPrincipal`

    - #### isRuntimeRepresentable

          public boolean isRuntimeRepresentable()

      Specified by:
        `isRuntimeRepresentable` in interface `Param`
      Specified by:
        `isRuntimeRepresentable` in class `Principal_c`

    - #### isCanonical

          public boolean isCanonical()

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

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### equalsImpl

          public boolean equalsImpl(polyglot.types.TypeObject o)

      Specified by:
        `equalsImpl` in interface `polyglot.types.TypeObject`
      Specified by:
        `equalsImpl` in class `Principal_c`

    - #### hashCode

          public int hashCode()

      Specified by:
        `hashCode` in class `Principal_c`

    - #### throwTypes

          public java.util.List<polyglot.types.Type> 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`
      Overrides:
        `throwTypes` in class `Principal_c`

    - #### subst

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

      Specified by:
        `subst` in interface `ActsForParam`
      Specified by:
        `subst` in interface `Principal`
      Overrides:
        `subst` in class `Principal_c`
      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,
                                    LabelChecker lc)

      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`
      Overrides:
        `labelCheck` in class `Principal_c`
      See Also:
        `JifExt.labelCheck(LabelChecker)`, `Label.labelCheck(JifContext, LabelChecker)`