|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectorg.mmbase.bridge.util.AbstractNode
org.mmbase.bridge.util.MapNode<V>
public class MapNode<V>
A bridge Node based on a Map. It can come in handy sometimes to be able to present any Map as an MMBase Node. E.g. because then it can be accessed in MMBase taglib using
mm:field tags. Don't confuse this with NodeMap.
| Field Summary | |
|---|---|
(package private) boolean |
implicitCreate
|
protected NodeManager |
nodeManager
This is normally, but not always, a VirtualBuilder. |
protected Map<String,V> |
originals
|
protected Map<String,Long> |
sizes
|
protected Map<String,V> |
values
|
protected Map<String,V> |
wrapper
|
| Fields inherited from interface org.mmbase.bridge.Node |
|---|
CLOUD_COMMITNODE_KEY |
| Constructor Summary | |
|---|---|
MapNode(Map<String,V> v)
This allows you to create a Node object even without having a Cloud object. |
|
MapNode(Map<String,V> v,
Cloud cloud)
|
|
MapNode(Map<String,V> v,
Cloud cloud,
boolean implicitCreate)
A node with a 'virtual' nodemanager will be constructed. |
|
MapNode(Map<String,V> v,
NodeManager nm)
This constructor explicitely specifies the node manager of the Node. |
|
| Method Summary | |
|---|---|
void |
cancel()
Cancel changes to a node This fails if the current node is not in edit mode. |
void |
commit()
Commit the node to the database. |
int |
countRelatedNodes(NodeManager otherNodeManager,
String role,
String direction)
|
int |
countRelatedNodes(String type)
Returns the number of related nodes that have a specific node manager. |
Relation |
createRelation(Node destinationNode,
RelationManager relationManager)
Adds a relation between this node and a specified node to the cloud. |
protected static NodeManager |
createVirtualNodeManager(Cloud cloud,
Map map,
boolean implicitCreate)
|
void |
delete(boolean deleteRelations)
Removes the Node. |
void |
deleteRelations(String type)
Removes all relation nodes with a certain relation manager that are attached to this node. |
protected void |
edit(int i)
|
StringList |
getAliases()
Returns all aliases for this node. |
Cloud |
getCloud()
Returns the cloud this node belongs to. |
NodeManager |
getNodeManager()
Returns the node manager for this node. |
int |
getNumber()
Returns the unique number for this node. |
NodeList |
getRelatedNodes(NodeManager nodeManager,
String role,
String searchDir)
Returns all related nodes that have a specific node manager and role. |
RelationList |
getRelations(String role,
NodeManager nodeManager,
String searchDir)
|
RelationList |
getRelations(String role,
String nodeManager)
Returns all relation nodes attached to this node that have a specific role, or refer a node from a specific nodemanager |
long |
getSize(String fieldName)
Returns the 'size' (e.g. |
Object |
getValueWithoutProcess(String fieldName)
Like getObjectValue, but skips any processing that MMBase would normally perform on a field. |
boolean |
hasRelations()
Checks whether this node has any relations. |
boolean |
isChanged()
Whether field values were changed since the last commit. |
boolean |
isChanged(String fieldName)
Whether a certain field's value was changed since the last commit. |
boolean |
isNew()
Whether this Node is new (not yet committed). |
boolean |
isNull(String fieldName)
Whether the value for the specified field is null. |
boolean |
mayChangeContext()
Check context-change rights on this node. |
boolean |
mayWrite()
Check write rights on this node. |
void |
setNodeManager(NodeManager nm)
Sets the node manager of this node. |
protected void |
setSize(String fieldName,
long size)
|
void |
setValueWithoutChecks(String fieldName,
Object value)
|
void |
setValueWithoutProcess(String fieldName,
Object value)
Like setObjectValue, but without processing, this is called by the other set-values. |
String |
toString()
Converts the node to a string |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.lang.Comparable |
|---|
compareTo |
| Field Detail |
|---|
protected transient NodeManager nodeManager
protected final Map<String,V> values
protected final Map<String,Long> sizes
protected final Map<String,V> wrapper
protected final Map<String,V> originals
boolean implicitCreate
| Constructor Detail |
|---|
public MapNode(Map<String,V> v,
NodeManager nm)
public MapNode(Map<String,V> v,
Cloud cloud,
boolean implicitCreate)
public MapNode(Map<String,V> v,
Cloud cloud)
public MapNode(Map<String,V> v)
| Method Detail |
|---|
protected static NodeManager createVirtualNodeManager(Cloud cloud,
Map map,
boolean implicitCreate)
public Cloud getCloud()
Node
getCloud in interface Nodepublic NodeManager getNodeManager()
Node
getNodeManager in interface Nodepublic int getNumber()
Node
getNumber in interface NodegetNumber in class AbstractNodeNode.createAlias(String alias)public boolean isNew()
Node
isNew in interface NodeisNew in class AbstractNodetrue when newpublic boolean isChanged(String fieldName)
Node
isChanged in interface NodeisChanged in class AbstractNodefieldName - the name of the field
true when field's value was changedpublic boolean isChanged()
Node
isChanged in interface NodeisChanged in class AbstractNodetrue when changedprotected void edit(int i)
public Object getValueWithoutProcess(String fieldName)
Node
getValueWithoutProcess in interface NodefieldName - name of field
public void setValueWithoutProcess(String fieldName,
Object value)
AbstractNode
setValueWithoutProcess in interface NodesetValueWithoutProcess in class AbstractNodefieldName - name of fieldvalue - new value of the field
public void setValueWithoutChecks(String fieldName,
Object value)
setValueWithoutChecks in class AbstractNodepublic boolean isNull(String fieldName)
Nodenull. This avoids acquiring the
complete value if you only want to check if for emptiness.
isNull in interface NodeisNull in class AbstractNodefieldName - the name of the field
true when value is null
protected void setSize(String fieldName,
long size)
setSize in class AbstractNodepublic long getSize(String fieldName)
Node
getSize in interface NodefieldName - the name of the field
public void commit()
Node
commit in interface Nodecommit in class AbstractNodepublic void cancel()
Node
cancel in interface Nodecancel in class AbstractNodepublic void delete(boolean deleteRelations)
Node
delete in interface Nodedelete in class AbstractNodedeleteRelations - a boolean. If true, then first all
existing relations with this node will be removed.public String toString()
Node
toString in interface NodetoString in class Object
public void deleteRelations(String type)
throws NotFoundException
Node
deleteRelations in interface NodedeleteRelations in class AbstractNodetype - the name of the relation manager the removed
relation nodes should have
NotFoundException
public RelationList getRelations(String role,
NodeManager nodeManager,
String searchDir)
throws NotFoundException
getRelations in interface NodegetRelations in class AbstractNoderole - forward role of a relationnodeManager - node manager on the other side of the relationsearchDir - the direction of the relation
NotFoundException
public RelationList getRelations(String role,
String nodeManager)
throws NotFoundException
Node
getRelations in interface NodegetRelations in class AbstractNoderole - the name of the role the returned
relation nodes should havenodeManager - the name of the nodemanager for the nodes the returned
relation nodes should have a relation to
NotFoundExceptionpublic boolean hasRelations()
Node
hasRelations in interface NodehasRelations in class AbstractNodetrue if the node has relations
public int countRelatedNodes(NodeManager otherNodeManager,
String role,
String direction)
countRelatedNodes in interface NodecountRelatedNodes in class AbstractNodeotherNodeManager - the node manager the nodes should haverole - the role of the relationdirection - the direction of the relation
public NodeList getRelatedNodes(NodeManager nodeManager,
String role,
String searchDir)
Node
getRelatedNodes in interface NodegetRelatedNodes in class AbstractNodenodeManager - the node manager the returned nodes should haverole - the role of the relationsearchDir - the direction of the relation
public int countRelatedNodes(String type)
Node
countRelatedNodes in interface NodecountRelatedNodes in class AbstractNodetype - the name of the node manager the counted nodes
should have
public StringList getAliases()
Node
getAliases in interface NodegetAliases in class AbstractNode
public Relation createRelation(Node destinationNode,
RelationManager relationManager)
Node
createRelation in interface NodecreateRelation in class AbstractNodedestinationNode - the node to which you want to relate this noderelationManager - the relation manager you want to use
public boolean mayWrite()
Node
mayWrite in interface NodemayWrite in class AbstractNodepublic boolean mayChangeContext()
Node
mayChangeContext in interface NodemayChangeContext in class AbstractNodepublic void setNodeManager(NodeManager nm)
Node
setNodeManager in interface NodesetNodeManager in class AbstractNode
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||