public class SimpleContext extends Object implements Context, Serializable
Modifier and Type | Field and Description |
---|---|
protected SCXMLSystemContext |
systemContext |
NAMESPACES_KEY
Constructor and Description |
---|
SimpleContext()
Constructor.
|
SimpleContext(Context parent)
Constructor.
|
SimpleContext(Context parent,
Map<String,Object> initialVars)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Object |
get(String name)
Get the value of this variable; delegating to parent.
|
protected org.apache.commons.logging.Log |
getLog()
Get the log used by this
Context instance. |
Context |
getParent()
Get the parent Context, may be null.
|
SCXMLSystemContext |
getSystemContext()
Get the SCXMLSystemContext for this Context, should not be null unless this is the root Context
|
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 |
setLog(org.apache.commons.logging.Log log)
Set the log used by this
Context instance. |
protected void |
setVars(Map<String,Object> vars)
Set the variables map.
|
protected final SCXMLSystemContext systemContext
public SimpleContext()
public SimpleContext(Context parent)
parent
- A parent Context, can be nullpublic SimpleContext(Context parent, Map<String,Object> initialVars)
parent
- A parent Context, can be nullinitialVars
- A pre-populated initial variables mappublic void set(String name, Object value)
set
in interface Context
name
- The variable namevalue
- The variable valueContext.set(String, Object)
public Object get(String name)
get
in interface Context
name
- The variable nameContext.get(java.lang.String)
public boolean has(String name)
has
in interface Context
name
- The variable nameContext.has(java.lang.String)
public boolean hasLocal(String name)
hasLocal
in interface Context
name
- The variable nameContext.hasLocal(java.lang.String)
public void reset()
reset
in interface Context
Context.reset()
public Context getParent()
getParent
in interface Context
Context.getParent()
public final SCXMLSystemContext getSystemContext()
getSystemContext
in interface Context
public void setLocal(String name, Object value)
setLocal
in interface Context
name
- The variable namevalue
- The variable valueContext.setLocal(String, Object)
protected void setVars(Map<String,Object> vars)
vars
- The new Map of variables.public Map<String,Object> getVars()
getVars
in interface Context
Context.getParent()
protected void setLog(org.apache.commons.logging.Log log)
Context
instance.log
- The new log.protected org.apache.commons.logging.Log getLog()
Context
instance.Copyright © 2005–2015 The Apache Software Foundation. All rights reserved.