org.mmbase.bridge.util
Class MapNodeManager

java.lang.Object
  extended by org.mmbase.bridge.util.AbstractNode
      extended by org.mmbase.bridge.util.AbstractNodeManager
          extended by org.mmbase.bridge.util.MapNodeManager
All Implemented Interfaces:
Comparable<Node>, Node, NodeManager

public class MapNodeManager
extends AbstractNodeManager

A bridge NodeManager based on a Map of node values. The type of the values in the mapped is used to infer the 'fieldTypes'. This happens lazily.

Since:
MMBase-1.9
Version:
$Id: MapNodeManager.java 41862 2010-04-13 09:32:29Z michiel $
Author:
Michiel Meeuwissen

Field Summary
protected  Map<String,?> map
           
 
Fields inherited from class org.mmbase.bridge.util.AbstractNodeManager
cloud, values
 
Fields inherited from interface org.mmbase.bridge.NodeManager
GUI_PLURAL, GUI_SINGULAR, ORDER_CREATE, ORDER_EDIT, ORDER_LIST, ORDER_NONE, ORDER_SEARCH
 
Fields inherited from interface org.mmbase.bridge.Node
CLOUD_COMMITNODE_KEY
 
Constructor Summary
MapNodeManager(Cloud cloud, Map<String,?> m)
           
MapNodeManager(Cloud cloud, Map<String,?> m, boolean create)
           
 
Method Summary
protected  void check()
           
 Field getField(String fieldName)
          Returns the field with the specified name.
protected  Map<String,Field> getFieldTypes()
           
 boolean hasField(String fieldName)
          Tests whether the field with the specified name exists in this nodemanager.
 String toString()
          Converts the node to a string
 
Methods inherited from class org.mmbase.bridge.util.AbstractNodeManager
createFieldList, createNode, createNodeList, createQuery, createRelationList, edit, getAllowedRelations, getAllowedRelations, getAllowedRelations, getCloud, getDescendants, getDescription, getDescription, getFields, getFields, getFunctions, getGUIName, getGUIName, getGUIName, getInfo, getInfo, getList, getList, getList, getList, getName, getNodeManager, getParent, getProperties, getProperty, getSize, getValueWithoutProcess, isNodeManager, mayCreateNode, setNodeManager, setSize, setValueWithoutChecks, toNodeManager
 
Methods inherited from class org.mmbase.bridge.util.AbstractNode
cancel, checkWrite, commit, compareTo, countRelatedNodes, countRelatedNodes, countRelations, countRelations, createAlias, createFunctionValue, createParameters, createRelation, delete, delete, deleteAlias, deleteRelations, deleteRelations, equals, getAliases, getBooleanValue, getByteValue, getChanged, getContext, getDateValue, getDecimalValue, getDoubleValue, getFieldValue, getFieldValue, getFloatValue, getFunction, getFunctionMap, getFunctionValue, getInputStreamValue, getIntValue, getListValue, getLongValue, getNodeFunction, getNodeValue, getNumber, getObjectValue, getPossibleContexts, getRelatedNodes, getRelatedNodes, getRelatedNodes, getRelatedNodes, getRelatedNodes, getRelations, getRelations, getRelations, getRelations, getRelations, getStringValue, getValue, getXMLValue, getXMLValue, hashCode, hasRelations, isChanged, isChanged, isNew, isNull, isRelation, isRelationManager, mayChangeContext, mayDelete, mayWrite, processNull, setBooleanValue, setByteValue, setContext, setDateValue, setDecimalValue, setDoubleValue, setFloatValue, setInputStreamValue, setIntValue, setListValue, setLongValue, setNodeValue, setObjectValue, setStringValue, setValue, setValueWithoutProcess, setXMLValue, toNodeNumber, toRelation, toRelationManager, validate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mmbase.bridge.Node
cancel, commit, countRelatedNodes, countRelatedNodes, countRelations, countRelations, createAlias, createParameters, createRelation, delete, delete, deleteAlias, deleteRelations, deleteRelations, getAliases, getBooleanValue, getByteValue, getChanged, getContext, getDateValue, getDecimalValue, getDoubleValue, getFieldValue, getFieldValue, getFloatValue, getFunction, getFunctionValue, getInputStreamValue, getIntValue, getListValue, getLongValue, getNodeValue, getNumber, getObjectValue, getPossibleContexts, getRelatedNodes, getRelatedNodes, getRelatedNodes, getRelatedNodes, getRelatedNodes, getRelations, getRelations, getRelations, getRelations, getRelations, getStringValue, getValue, getXMLValue, getXMLValue, hasRelations, isChanged, isChanged, isNew, isNull, isRelation, isRelationManager, mayChangeContext, mayDelete, mayWrite, setBooleanValue, setByteValue, setContext, setDateValue, setDecimalValue, setDoubleValue, setFloatValue, setInputStreamValue, setIntValue, setListValue, setLongValue, setNodeValue, setObjectValue, setStringValue, setValue, setValueWithoutProcess, setXMLValue, toRelation, toRelationManager, validate
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

map

protected final Map<String,?> map
Constructor Detail

MapNodeManager

public MapNodeManager(Cloud cloud,
                      Map<String,?> m,
                      boolean create)

MapNodeManager

public MapNodeManager(Cloud cloud,
                      Map<String,?> m)
Method Detail

check

protected void check()

getFieldTypes

protected Map<String,Field> getFieldTypes()
Specified by:
getFieldTypes in class AbstractNodeManager

hasField

public boolean hasField(String fieldName)
Description copied from interface: NodeManager
Tests whether the field with the specified name exists in this nodemanager.

Specified by:
hasField in interface NodeManager
Overrides:
hasField in class AbstractNodeManager
Parameters:
fieldName - the name of the field to be returned
Returns:
true if the field with the requested name exists

getField

public Field getField(String fieldName)
               throws NotFoundException
Description copied from interface: NodeManager
Returns the field with the specified name.

Specified by:
getField in interface NodeManager
Overrides:
getField in class AbstractNodeManager
Parameters:
fieldName - the name of the field to be returned
Returns:
the field with the requested name
Throws:
NotFoundException - is the field does not exist

toString

public String toString()
Description copied from interface: Node
Converts the node to a string

Specified by:
toString in interface Node
Overrides:
toString in class AbstractNodeManager
Returns:
string representation of a node


MMBase 2.0-SNAPSHOT - null