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, java.lang.Cloneable, java.util.Map
Direct Known Subclasses:
SetNode.NodeMapWrapper

public class NodeMapWrapper
extends ContentWrapper
implements java.util.Map

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

Version:
$Revision: 2161 $ ($Author: fgiust $)
Author:
fguist

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Nested classes/interfaces inherited from interface info.magnolia.cms.core.Content
Content.ContentFilter
 
Field Summary
 
Fields inherited from class info.magnolia.cms.core.ContentHandler
hierarchyManager
 
Constructor Summary
NodeMapWrapper(Content node, java.lang.String handle)
          Instantiates a new NodeMapWrapper for the given node.
 
Method Summary
 void clear()
           
 boolean containsKey(java.lang.Object key)
           
 boolean containsValue(java.lang.Object value)
           
 java.util.Set entrySet()
           
 java.lang.Object get(java.lang.Object key)
          Shortcut for Content.getNodeData(name).getString() or Content.getNodeData(name).getName().
protected  boolean hasProperty(java.lang.Object key)
           
 boolean isEmpty()
           
 java.util.Set keySet()
           
 java.lang.Object put(java.lang.Object arg0, java.lang.Object arg1)
           
 void putAll(java.util.Map t)
           
 java.lang.Object remove(java.lang.Object key)
           
 int size()
           
 java.util.Collection 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, setHierarchyManager
 
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,
                      java.lang.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 java.util.Map
See Also:
Map.size()

isEmpty

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

containsKey

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

containsValue

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

get

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

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

hasProperty

protected boolean hasProperty(java.lang.Object key)

put

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

remove

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

putAll

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

clear

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

keySet

public java.util.Set keySet()
Specified by:
keySet in interface java.util.Map
See Also:
Map.keySet()

values

public java.util.Collection values()
Specified by:
values in interface java.util.Map
See Also:
Map.values()

entrySet

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


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