org.mmbase.bridge.util
Class NodeChanger

java.lang.Object
  extended byorg.mmbase.bridge.util.NodeWrapper
      extended byorg.mmbase.bridge.util.NodeChanger
All Implemented Interfaces:
Comparable, Node

public class NodeChanger
extends NodeWrapper

Wraps another Node, and adds 'isChangedByThis'.

Since:
MMBase-1.8
Version:
$Id: NodeChanger.java,v 1.1 2006/02/10 18:01:44 michiel Exp $
Author:
Michiel Meeuwissen

Field Summary
protected  Map originalValues
           
 
Fields inherited from class org.mmbase.bridge.util.NodeWrapper
node
 
Constructor Summary
NodeChanger(Node node)
           
 
Method Summary
 void cancelThis()
           
protected  void change(String fieldName)
           
 boolean isChangedByThis()
          The isChanged method reflects the isChanged status of the underlying core node.isChanged.
 void setBooleanValue(String fieldName, boolean value)
          Sets the value of the specified field using an boolean.
 void setByteValue(String fieldName, byte[] value)
          Sets the value of the specified field using a byte array.
 void setDateValue(String fieldName, Date value)
          Sets the value of the specified field using a Date.
 void setDoubleValue(String fieldName, double value)
          Sets the value of the specified field using a double.
 void setFloatValue(String fieldName, float value)
          Sets the value of the specified field using a float.
 void setInputStreamValue(String fieldName, InputStream value, long size)
          Sets the value of the specified field using a java.io.InputStream.
 void setIntValue(String fieldName, int value)
          Sets the value of the specified field using an int.
 void setListValue(String fieldName, List value)
          Sets the value of the specified field using a List.
 void setLongValue(String fieldName, long value)
          Sets the value of the specified field using a long.
 void setNodeValue(String fieldName, Node value)
          Sets the value of the specified field using an Node.
 void setObjectValue(String fieldName, Object value)
          Sets the value of the specified field using an object, but without dispatching to the right type first.
 void setStringValue(String fieldName, String value)
          Sets the value of the specified field using a String.
 void setValue(String fieldName, Object value)
          Sets the value of the specified field using an object, but delegated to the right set--Value depending on the type of the field.
 void setValueWithoutProcess(String fieldName, Object value)
          Like setValue, but skips any processing that MMBase would normally perform on a field.
 
Methods inherited from class org.mmbase.bridge.util.NodeWrapper
cancel, commit, compareTo, countRelatedNodes, countRelatedNodes, countRelations, countRelations, createAlias, createParameters, createRelation, delete, delete, deleteAlias, deleteRelations, deleteRelations, equals, getAliases, getBooleanValue, getByteValue, getChanged, getCloud, getContext, getDateValue, getDoubleValue, getFieldValue, getFieldValue, getFloatValue, getFunction, getFunctions, getFunctionValue, getInputStreamValue, getIntValue, getListValue, getLongValue, getNode, getNodeManager, getNodeValue, getNumber, getObjectValue, getPossibleContexts, getRelatedNodes, getRelatedNodes, getRelatedNodes, getRelatedNodes, getRelatedNodes, getRelations, getRelations, getRelations, getRelations, getRelations, getSize, getStringValue, getValue, getValueWithoutProcess, getXMLValue, getXMLValue, hashCode, hasRelations, isChanged, isChanged, isNew, isNodeManager, isNull, isRelation, isRelationManager, mayChangeContext, mayDelete, mayWrite, setContext, setXMLValue, toNodeManager, toRelation, toRelationManager, toString, validate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

originalValues

protected Map originalValues
Constructor Detail

NodeChanger

public NodeChanger(Node node)
Method Detail

change

protected void change(String fieldName)

setValue

public void setValue(String fieldName,
                     Object value)
Description copied from interface: Node
Sets the value of the specified field using an object, but delegated to the right set--Value depending on the type of the field. For example a field of type int can be set using an Integer. This change will not be visible to the cloud until the commit method is called.

Specified by:
setValue in interface Node
Overrides:
setValue in class NodeWrapper

setValueWithoutProcess

public void setValueWithoutProcess(String fieldName,
                                   Object value)
Description copied from interface: Node
Like setValue, but skips any processing that MMBase would normally perform on a field. You can use this to set data on fields that are 'system' defined, to prevent (among other things) infinite recursion. Use with care - in general processing of a field has a purpose!

Specified by:
setValueWithoutProcess in interface Node
Overrides:
setValueWithoutProcess in class NodeWrapper

setObjectValue

public void setObjectValue(String fieldName,
                           Object value)
Description copied from interface: Node
Sets the value of the specified field using an object, but without dispatching to the right type first.

Specified by:
setObjectValue in interface Node
Overrides:
setObjectValue in class NodeWrapper

setBooleanValue

public void setBooleanValue(String fieldName,
                            boolean value)
Description copied from interface: Node
Sets the value of the specified field using an boolean. This change will not be visible to the cloud until the commit method is called.

Specified by:
setBooleanValue in interface Node
Overrides:
setBooleanValue in class NodeWrapper

setNodeValue

public void setNodeValue(String fieldName,
                         Node value)
Description copied from interface: Node
Sets the value of the specified field using an Node. This change will not be visible to the cloud until the commit method is called.

Specified by:
setNodeValue in interface Node
Overrides:
setNodeValue in class NodeWrapper

setIntValue

public void setIntValue(String fieldName,
                        int value)
Description copied from interface: Node
Sets the value of the specified field using an int. This change will not be visible to the cloud until the commit method is called.

Specified by:
setIntValue in interface Node
Overrides:
setIntValue in class NodeWrapper

setFloatValue

public void setFloatValue(String fieldName,
                          float value)
Description copied from interface: Node
Sets the value of the specified field using a float. This change will not be visible to the cloud until the commit method is called.

Specified by:
setFloatValue in interface Node
Overrides:
setFloatValue in class NodeWrapper

setDoubleValue

public void setDoubleValue(String fieldName,
                           double value)
Description copied from interface: Node
Sets the value of the specified field using a double. This change will not be visible to the cloud until the commit method is called.

Specified by:
setDoubleValue in interface Node
Overrides:
setDoubleValue in class NodeWrapper

setByteValue

public void setByteValue(String fieldName,
                         byte[] value)
Description copied from interface: Node
Sets the value of the specified field using a byte array. This change will not be visible to the cloud until the commit method is called.

Specified by:
setByteValue in interface Node
Overrides:
setByteValue in class NodeWrapper

setInputStreamValue

public void setInputStreamValue(String fieldName,
                                InputStream value,
                                long size)
Description copied from interface: Node
Sets the value of the specified field using a java.io.InputStream.

Specified by:
setInputStreamValue in interface Node
Overrides:
setInputStreamValue in class NodeWrapper

setLongValue

public void setLongValue(String fieldName,
                         long value)
Description copied from interface: Node
Sets the value of the specified field using a long. This change will not be visible to the cloud until the commit method is called.

Specified by:
setLongValue in interface Node
Overrides:
setLongValue in class NodeWrapper

setStringValue

public void setStringValue(String fieldName,
                           String value)
Description copied from interface: Node
Sets the value of the specified field using a String. This change will not be visible to the cloud until the commit method is called.

Specified by:
setStringValue in interface Node
Overrides:
setStringValue in class NodeWrapper

setDateValue

public void setDateValue(String fieldName,
                         Date value)
Description copied from interface: Node
Sets the value of the specified field using a Date. This change will not be visible to the cloud until the commit method is called.

Specified by:
setDateValue in interface Node
Overrides:
setDateValue in class NodeWrapper

setListValue

public void setListValue(String fieldName,
                         List value)
Description copied from interface: Node
Sets the value of the specified field using a List. This change will not be visible to the cloud until the commit method is called.

Specified by:
setListValue in interface Node
Overrides:
setListValue in class NodeWrapper

isChangedByThis

public boolean isChangedByThis()
The isChanged method reflects the isChanged status of the underlying core node.isChanged. Before commiting the node, you may want to check if _you_ changed to node, and not some other thread. In that case you can first wrap your Node in a NodeChanger object.


cancelThis

public void cancelThis()


MMBase build 1.8.1.20060716