net.sf.morph.context.contexts
Class MapContext

java.lang.Object
  extended by net.sf.morph.context.contexts.BaseContext
      extended by net.sf.morph.context.contexts.BaseHierarchicalContext
          extended by net.sf.morph.context.contexts.ReflectorHierarchicalContext
              extended by net.sf.morph.context.contexts.MapContext
All Implemented Interfaces:
java.util.Map, Context, DecoratedContext, DelegatingContext, HierarchicalContext

public class MapContext
extends ReflectorHierarchicalContext

A simple Context backed by a Map.

Since:
Nov 21, 2004
Author:
Matt Sgarlata

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Constructor Summary
MapContext()
          Creates a new, empty context.
MapContext(Context parentContext)
          Creates a new context with the given context as parent.
MapContext(Context parentContext, java.util.Map map)
          Creates a new context with the given parent context and initial values taken from the supplied Map.
MapContext(java.util.Map map)
          Creates a new context with the values taken from the supplied Map.
 
Method Summary
 
Methods inherited from class net.sf.morph.context.contexts.ReflectorHierarchicalContext
checkConfiguration, getBeanReflector, getDelegate, getHierarchicalImpl, getPropertyNamesHierarchicalImpl, setBeanReflector, setDelegate, setHierarchicalImpl
 
Methods inherited from class net.sf.morph.context.contexts.BaseHierarchicalContext
getImpl, getParentContext, getPropertyNamesImpl, setImpl, setParentContext
 
Methods inherited from class net.sf.morph.context.contexts.BaseContext
clear, containsKey, containsValue, entrySet, get, get, get, get, get, getContextMapBridge, getConverter, getLanguage, getLog, getPropertyNames, isEmpty, keySet, put, putAll, remove, set, set, setContextMapBridge, setConverter, setLanguage, setLog, size, values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.morph.context.HierarchicalContext
get, getParentContext, getPropertyNames, set, setParentContext
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

MapContext

public MapContext()
Creates a new, empty context.


MapContext

public MapContext(Context parentContext)
Creates a new context with the given context as parent.

Parameters:
parentContext - the parent context

MapContext

public MapContext(java.util.Map map)
Creates a new context with the values taken from the supplied Map. Only the map entries that have String keys will be exposed as properties.

Parameters:
map - the map used to populate this context with initial values

MapContext

public MapContext(Context parentContext,
                  java.util.Map map)
Creates a new context with the given parent context and initial values taken from the supplied Map. Only the map entries that have String keys will be exposed as properties.

Parameters:
parentContext - the parent context
map - the map used to populate this context with initial values


Copyright © 2004-2008.