Interface Context
public interface Context
Container definition for providing contextual information on one specific level within an evaluation
process.
- Since:
- 4.0.17
-
Method Summary
Modifier and TypeMethodDescriptiongetDefinedVariableValue
(String variableName) Looks up a variable having the given name.getName()
Provides the given name of this context.Provides the parent context of this one.Provides a set of names of all locally defined variables.getVariableValue
(String variableName) Looks up a variable having the given name.removeVariable
(String variableName) Removes a variable from this local context, if supported.void
setParentContext
(Context superContext) Sets the parent context for this one.void
setVariableValue
(String variableName, @Nullable Object value) Set a variable value within this local context.
-
Method Details
-
getName
String getName()Provides the given name of this context.- Returns:
- The context's name.
- Since:
- 4.0.17
-
getVariableValue
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
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
Set a variable value within this local context.- Parameters:
variableName
- The variable's name.value
- The value to store.- Since:
- 4.0.17
-
removeVariable
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
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
Provides a set of names of all locally defined variables.- Returns:
- A set of names.
- Since:
- 4.0.17
-