org.apache.taglibs.rdc.scxml.env
Class ELContext

java.lang.Object
  extended by org.apache.taglibs.rdc.scxml.env.ELContext
All Implemented Interfaces:
javax.servlet.jsp.el.VariableResolver, Context
Direct Known Subclasses:
RootContext

public class ELContext
extends java.lang.Object
implements Context, javax.servlet.jsp.el.VariableResolver

EL Context for SCXML interpreter.

Author:
Jaroslav Gergic, Rahul Akolkar

Field Summary
protected static org.apache.commons.logging.Log log
           
protected  Context parent
           
protected  java.util.HashMap vars
           
 
Constructor Summary
ELContext()
          Constructor
ELContext(Context parent)
           
 
Method Summary
 java.lang.Object get(java.lang.String name)
          Get the value of this variable; delegating to parent
 Context getParent()
          Get the parent Context, may be null
 boolean has(java.lang.String name)
          Check if this variable exists, delegating to parent
 java.util.Iterator iterator()
          Get an Iterator over all variables in this Context
 void reset()
          Clear this Context
 java.lang.Object resolveVariable(java.lang.String pName)
          Resolves the specified variable.
 void set(java.lang.String name, java.lang.Object value)
          Assigns a new value to an existing variable or creates a new one.
 void setLocal(java.lang.String name, java.lang.Object value)
          Assigns a new value to an existing variable or creates a new one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log

parent

protected Context parent

vars

protected java.util.HashMap vars
Constructor Detail

ELContext

public ELContext()
Constructor


ELContext

public ELContext(Context parent)
Parameters:
parent - a parent ELContext, can be null
Method Detail

set

public void set(java.lang.String name,
                java.lang.Object value)
Assigns a new value to an existing variable or creates a new one. The method searches the chain of parent Contexts for variable existence.

Specified by:
set in interface Context
Parameters:
name - The variable name
value - The variable value
See Also:
Context.set(java.lang.String, java.lang.Object)

get

public java.lang.Object get(java.lang.String name)
Get the value of this variable; delegating to parent

Specified by:
get in interface Context
Parameters:
name - The name of the variable
Returns:
The value (or null)
See Also:
Context.get(java.lang.String)

has

public boolean has(java.lang.String name)
Check if this variable exists, delegating to parent

Specified by:
has in interface Context
Parameters:
name - The name of the variable
Returns:
Whether a variable with the name exists in this Context
See Also:
Context.has(java.lang.String)

iterator

public java.util.Iterator iterator()
Get an Iterator over all variables in this Context

Specified by:
iterator in interface Context
Returns:
Local entries iterator (Map.Entry) To get parent entries, call getParent().iterator().
See Also:
Context.iterator()

reset

public void reset()
Clear this Context

Specified by:
reset in interface Context
See Also:
Context.reset()

getParent

public Context getParent()
Get the parent Context, may be null

Specified by:
getParent in interface Context
Returns:
The parent Context in a chained Context environment
See Also:
Context.getParent()

setLocal

public void setLocal(java.lang.String name,
                     java.lang.Object value)
Assigns a new value to an existing variable or creates a new one. The method allows to shaddow a variable of the same name up the Context chain.

Specified by:
setLocal in interface Context
Parameters:
name - The variable name
value - The variable value
See Also:
Context.setLocal(java.lang.String, java.lang.Object)

resolveVariable

public java.lang.Object resolveVariable(java.lang.String pName)
                                 throws javax.servlet.jsp.el.ELException
Resolves the specified variable. Returns null if the variable is not found.

Specified by:
resolveVariable in interface javax.servlet.jsp.el.VariableResolver
Throws:
javax.servlet.jsp.el.ELException
See Also:
VariableResolver.resolveVariable(java.lang.String)


Copyright ? 2000-2004 The Apache Software Foundation. All Rights Reserved.