info.magnolia.cms.util
Class NodeMapWrapper

java.lang.Object
  extended by info.magnolia.cms.core.ContentHandler
      extended by info.magnolia.cms.core.AbstractContent
          extended by info.magnolia.cms.util.ContentWrapper
              extended by info.magnolia.cms.util.NodeMapWrapper
All Implemented Interfaces:
Content, Cloneable, Map

public class NodeMapWrapper
extends ContentWrapper
implements Map

Wrapper for a content Node which exposes a Map interface, used to access its content using jstl.


Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Nested classes/interfaces inherited from interface info.magnolia.cms.core.Content
Content.ContentFilter
 
Constructor Summary
NodeMapWrapper(Content node, String handle)
          Instantiates a new NodeMapWrapper for the given node.
 
Method Summary
 void clear()
           
 boolean containsKey(Object key)
           
 boolean containsValue(Object value)
           
 Set entrySet()
           
 Object get(Object key)
          Shortcut for Content.getNodeData(name).getString() or Content.getNodeData(name).getName().
protected  boolean hasProperty(Object key)
           
 boolean isEmpty()
           
 Set<String> keySet()
           
 Object put(Object arg0, Object arg1)
           
 void putAll(Map t)
           
 Object remove(Object key)
           
 int size()
           
 Collection<String> values()
           
protected  Content wrap(Content node)
          Override if a wrapper wants to wrap returned content objects.
 
Methods inherited from class info.magnolia.cms.util.ContentWrapper
addMixin, addVersion, addVersion, createContent, delete, deleteNodeData, getAllVersions, getAncestor, getAncestors, getBaseVersion, getChildByName, getChildren, getContent, getHandle, getHierarchyManager, getIndex, getItemType, getJCRNode, getLevel, getLock, getMetaData, getMixinNodeTypes, getName, getNodeDataCollection, getNodeType, getNodeTypeName, getParent, getTemplate, getTitle, getUUID, getVersionedContent, getVersionedContent, getVersionHistory, getWorkspace, getWrappedContent, hasContent, hasMetaData, hasMixin, holdsLock, isGranted, isLocked, isModified, isNodeData, isNodeType, lock, lock, newNodeDataInstance, orderBefore, refresh, removeMixin, removeVersionHistory, restore, restore, restore, restoreByLabel, save, setWrappedContent, toString, unlock, updateMetaData, wrap, wrapContentNodes, wrapNodeDatas
 
Methods inherited from class info.magnolia.cms.core.AbstractContent
createContent, createContent, createNodeData, createNodeData, createNodeData, createNodeData, createNodeData, delete, getBinaryNodeDatas, getChildren, getChildren, getChildren, getChildren, getChildren, getChildren, getNodeData, getNodeDataCollection, hasChildren, hasChildren, hasNodeData, setNodeData, setNodeData, setNodeData, setNodeData, setNodeData, setNodeData, setNodeData, setNodeData, setNodeData, setNodeData
 
Methods inherited from class info.magnolia.cms.core.ContentHandler
clone, getAccessManager, setAccessManager
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 
Methods inherited from interface info.magnolia.cms.core.Content
getAccessManager
 

Constructor Detail

NodeMapWrapper

public NodeMapWrapper(Content node,
                      String handle)
Instantiates a new NodeMapWrapper for the given node.

Parameters:
node - Content node
handle - Parent page handle or other prefix for links.
Method Detail

wrap

protected Content wrap(Content node)
Description copied from class: ContentWrapper
Override if a wrapper wants to wrap returned content objects. This method is called by getContent(), getParent(), ... The default implementation does nothing.

Overrides:
wrap in class ContentWrapper

size

public int size()
Specified by:
size in interface Map
See Also:
Map.size()

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Map
See Also:
Map.isEmpty()

containsKey

public boolean containsKey(Object key)
Specified by:
containsKey in interface Map
See Also:
Map.containsKey(java.lang.Object)

containsValue

public boolean containsValue(Object value)
Specified by:
containsValue in interface Map
See Also:
Map.containsValue(java.lang.Object)

get

public Object get(Object key)
Shortcut for Content.getNodeData(name).getString() or Content.getNodeData(name).getName().

Specified by:
get in interface Map
See Also:
Map.get(Object)

hasProperty

protected boolean hasProperty(Object key)

put

public Object put(Object arg0,
                  Object arg1)
Specified by:
put in interface Map
See Also:
Map.put(java.lang.Object, java.lang.Object)

remove

public Object remove(Object key)
Specified by:
remove in interface Map
See Also:
Map.remove(java.lang.Object)

putAll

public void putAll(Map t)
Specified by:
putAll in interface Map
See Also:
Map.putAll(java.util.Map)

clear

public void clear()
Specified by:
clear in interface Map
See Also:
Map.clear()

keySet

public Set<String> keySet()
Specified by:
keySet in interface Map
See Also:
Map.keySet()

values

public Collection<String> values()
Specified by:
values in interface Map
See Also:
Map.values()

entrySet

public Set entrySet()
Specified by:
entrySet in interface Map
See Also:
Map.entrySet()


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