info.magnolia.context
Class AbstractMapBasedContext
java.lang.Object
info.magnolia.context.AbstractContext
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 classes/interfaces inherited from interface java.util.Map |
Map.Entry<K,V> |
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 |
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 |
AbstractMapBasedContext
public AbstractMapBasedContext()
AbstractMapBasedContext
public AbstractMapBasedContext(Map<String,Object> map)
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 keyscope
- , 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 toscope
- 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-2012 Magnolia International Ltd.. All Rights Reserved.