org.araneaframework.core
Class StandardEnvironment

java.lang.Object
  extended byorg.araneaframework.core.BaseEnvironment
      extended byorg.araneaframework.core.StandardEnvironment
All Implemented Interfaces:
Environment, Serializable

public class StandardEnvironment
extends BaseEnvironment

A simple Environment implementation.

Author:
"Toomas Römer"
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.araneaframework.Environment
ENVIRONMENT_KEY
 
Constructor Summary
StandardEnvironment(Environment env, Map entries)
          Constructs an object with the env parent Environment and with the entries data.
StandardEnvironment(Environment env, Object key, Object value)
          Constructs an object with the env parent Environment and entries data containing <key, value>.
 
Method Summary
 Object getEntry(Object key)
          Returns the corresponding value of this Envrionment's entries.
 Map getEntryMap()
          Returns the map with the entries in this Environment.
 String toString()
           
 
Methods inherited from class org.araneaframework.core.BaseEnvironment
requireEntry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StandardEnvironment

public StandardEnvironment(Environment env,
                           Map entries)
Constructs an object with the env parent Environment and with the entries data.

Parameters:
env - the parent environment
entries - a map of the entries in the Environment

StandardEnvironment

public StandardEnvironment(Environment env,
                           Object key,
                           Object value)
Constructs an object with the env parent Environment and entries data containing <key, value>.

Parameters:
env - the parent environment
key - a key of the value in the map of the Environment entries.
value - a value corresponding to given key in the map of the Environment entries.
Method Detail

getEntryMap

public Map getEntryMap()
Returns the map with the entries in this Environment. An entry is a key value pair.

Returns:
a map with the entries.

getEntry

public Object getEntry(Object key)
Returns the corresponding value of this Envrionment's entries. If none is found from the entries then the entry is returned from the parent environment. If a value to the key does not exist, AraneaNoSuchEnvironmentEntryException is thrown.

Parameters:
key - the key of the entry
Returns:
the Object under the key provided
Throws:
AraneaNoSuchEnvironmentEntryException

toString

public String toString()