public class MinimalContext extends SimpleContext
This context disables any access to the parent context (other than through getParent()) and ignores setting any local data.
The MinimalContext requires a none MinimalContext based parent Context for creation. If the parent context is of type MinimalContext, its parent will be used as the parent of the new MinimalContext instance
systemContext
NAMESPACES_KEY
Constructor and Description |
---|
MinimalContext(Context parent) |
Modifier and Type | Method and Description |
---|---|
Object |
get(String name)
Get the value of this variable; delegating to parent.
|
Map<String,Object> |
getVars()
Get the Map of all local variables in this Context.
|
boolean |
has(String name)
Check if this variable exists, delegating to parent.
|
boolean |
hasLocal(String name)
Check if this variable exists, only checking this Context
|
void |
reset()
Clear this Context.
|
void |
set(String name,
Object value)
Assigns a new value to an existing variable or creates a new one.
|
void |
setLocal(String name,
Object value)
Assigns a new value to an existing variable or creates a new one.
|
protected void |
setVars(Map<String,Object> vars)
Set the variables map.
|
getLog, getParent, getSystemContext, setLog
public MinimalContext(Context parent)
public void set(String name, Object value)
SimpleContext
set
in interface Context
set
in class SimpleContext
name
- The variable namevalue
- The variable valueContext.set(String, Object)
public Object get(String name)
SimpleContext
get
in interface Context
get
in class SimpleContext
name
- The variable nameContext.get(java.lang.String)
public boolean has(String name)
SimpleContext
has
in interface Context
has
in class SimpleContext
name
- The variable nameContext.has(java.lang.String)
public boolean hasLocal(String name)
SimpleContext
hasLocal
in interface Context
hasLocal
in class SimpleContext
name
- The variable nameContext.hasLocal(java.lang.String)
public void reset()
SimpleContext
reset
in interface Context
reset
in class SimpleContext
Context.reset()
public void setLocal(String name, Object value)
SimpleContext
setLocal
in interface Context
setLocal
in class SimpleContext
name
- The variable namevalue
- The variable valueContext.setLocal(String, Object)
protected void setVars(Map<String,Object> vars)
SimpleContext
setVars
in class SimpleContext
vars
- The new Map of variables.public Map<String,Object> getVars()
SimpleContext
getVars
in interface Context
getVars
in class SimpleContext
Context.getParent()
Copyright © 2005–2015 The Apache Software Foundation. All rights reserved.