Interface Context


public interface Context
Container definition for providing contextual information on one specific level within an evaluation process.
Since:
4.0.17
  • Method Details

    • getName

      String getName()
      Provides the given name of this context.
      Returns:
      The context's name.
      Since:
      4.0.17
    • getVariableValue

      Object getVariableValue(String variableName)
      Looks up a variable having the given name. The look up will also visit all parent levels of context until it finds the variable or ends up at the top of contexts.
      Parameters:
      variableName - The variable's name.
      Returns:
      The value stored for the named variable, which may be undefined.
      Since:
      4.0.17
    • getDefinedVariableValue

      Object getDefinedVariableValue(String variableName)
      Looks up a variable having the given name. Only considers the local context.
      Parameters:
      variableName - The variable's name.
      Returns:
      The value stored for the named variable, which may be undefined.
      Since:
      4.0.17
    • setVariableValue

      void setVariableValue(String variableName, @Nullable @Nullable Object value)
      Set a variable value within this local context.
      Parameters:
      variableName - The variable's name.
      value - The value to store.
      Since:
      4.0.17
    • removeVariable

      Object removeVariable(String variableName)
      Removes a variable from this local context, if supported.
      Parameters:
      variableName - The variable's name.
      Returns:
      The stored value.
      Throws:
      UnsupportedOperationException - if the context does not support removing variables.
      Since:
      4.0.17
    • setParentContext

      void setParentContext(Context superContext)
      Sets the parent context for this one.
      Parameters:
      superContext - The parent context.
      Since:
      4.0.17
    • getParentContext

      Context getParentContext()
      Provides the parent context of this one.
      Returns:
      The parent context.
      Since:
      4.0.17
    • getVariableNames

      Set<String> getVariableNames()
      Provides a set of names of all locally defined variables.
      Returns:
      A set of names.
      Since:
      4.0.17