info.magnolia.context
Class AbstractMapBasedContext

java.lang.Object
  extended by info.magnolia.context.AbstractContext
      extended by info.magnolia.context.AbstractMapBasedContext
All Implemented Interfaces:
Serializable, Map, org.apache.commons.chain.Context
Direct Known Subclasses:
SimpleContext

public abstract class AbstractMapBasedContext
extends AbstractContext

This is a simple Map based implementation. Ignores scopes!

Version:
$Revision: 41137 $ ($Author: gjoseph $)
Author:
Philipp Bracher
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
 
Fields inherited from class info.magnolia.context.AbstractContext
locale
 
Fields inherited from interface info.magnolia.context.Context
APPLICATION_SCOPE, ATTRIBUTE_COMMENT, ATTRIBUTE_EXCEPTION, ATTRIBUTE_MESSAGE, ATTRIBUTE_PATH, ATTRIBUTE_RECURSIVE, ATTRIBUTE_REPOSITORY, ATTRIBUTE_UUID, ATTRIBUTE_VERSION, ATTRIBUTE_VERSION_MAP, LOCAL_SCOPE, SESSION_SCOPE
 
Constructor Summary
AbstractMapBasedContext()
           
AbstractMapBasedContext(Map<String,Object> map)
           
 
Method Summary
 Object getAttribute(String name, int scope)
          Use the Map.get().
 Map<String,Object> getAttributes()
          Returns the inner map.
 Map<String,Object> getAttributes(int scope)
          Ignore scope and return the inner map.
 Map<String,Object> getMap()
           
 void removeAttribute(String name, int scope)
          use the Map.remove().
 void setAttribute(String name, Object value, int scope)
          Use the Map.put().
 void setMap(Map<String,Object> map)
           
 
Methods inherited from class info.magnolia.context.AbstractContext
clear, containsKey, containsValue, entrySet, get, getAccessManager, getAccessManager, getAttribute, getAttributeStrategy, getHierarchyManager, getHierarchyManager, getLocale, getMessages, getMessages, getQueryManager, getQueryManager, getRepositoryStrategy, getUser, isEmpty, keySet, put, putAll, release, remove, setAttributeStrategy, setLocale, setRepositoryStrategy, size, values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

AbstractMapBasedContext

public AbstractMapBasedContext()

AbstractMapBasedContext

public AbstractMapBasedContext(Map<String,Object> map)
Method Detail

setAttribute

public void setAttribute(String name,
                         Object value,
                         int scope)
Use the Map.put().

Overrides:
setAttribute in class AbstractContext
Parameters:
name - is used as a key
scope - , highest level of scope from which this attribute is visible

getAttribute

public Object getAttribute(String name,
                           int scope)
Use the Map.get().

Overrides:
getAttribute in class AbstractContext
Parameters:
name - to which value is associated to
scope - the scope (request, session, application)
Returns:
attribute value

removeAttribute

public void removeAttribute(String name,
                            int scope)
use the Map.remove().

Overrides:
removeAttribute in class AbstractContext

getAttributes

public Map<String,Object> getAttributes(int scope)
Ignore scope and return the inner map.

Overrides:
getAttributes in class AbstractContext
Returns:
the map

getAttributes

public Map<String,Object> getAttributes()
Returns the inner map.

Overrides:
getAttributes in class AbstractContext
Returns:
the map

getMap

public Map<String,Object> getMap()

setMap

public void setMap(Map<String,Object> map)


Copyright © 2003-2011 Magnolia International Ltd.. All Rights Reserved.