info.magnolia.ui.framework.message
Class Node2MapUtil

java.lang.Object
  extended by info.magnolia.ui.framework.message.Node2MapUtil

public class Node2MapUtil
extends Object

Utility class to allow storing Map content to Node.


Constructor Summary
Node2MapUtil()
           
 
Method Summary
static javax.jcr.Node map2node(javax.jcr.Node node, Map<String,Object> map)
          Stores the content of map to the node.
static Map<String,Object> node2map(javax.jcr.Node node)
          Reads the node properties and subnodes, and creates a corresponding Map object, where the keys are the property/subnode names, and values are the property values, resp.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Node2MapUtil

public Node2MapUtil()
Method Detail

map2node

public static javax.jcr.Node map2node(javax.jcr.Node node,
                                      Map<String,Object> map)
                               throws IllegalArgumentException,
                                      javax.jcr.RepositoryException
Stores the content of map to the node. The primitive values are stored as properties and Map<String,Object> values are stored as a subnode. Any other type will cause the IllegalArgumentException to be thrown. See the PropertyUtil for more details on how the values are stored.

Throws:
IllegalArgumentException
javax.jcr.RepositoryException

node2map

public static Map<String,Object> node2map(javax.jcr.Node node)
                                   throws info.magnolia.jcr.node2bean.Node2BeanException,
                                          javax.jcr.RepositoryException
Reads the node properties and subnodes, and creates a corresponding Map object, where the keys are the property/subnode names, and values are the property values, resp. Map<String, Object> for subnodes. Uses Node2BeanProcessor to do the work.

Throws:
info.magnolia.jcr.node2bean.Node2BeanException
javax.jcr.RepositoryException


Copyright © 2013 Magnolia International Ltd.. All Rights Reserved.