org.mmbase.applications.xmlimporter
Class TmpObject

java.lang.Object
  extended byorg.mmbase.applications.xmlimporter.TmpObject

public class TmpObject
extends Object

A TmpObject represents a temporary object in a transaction. TmpObject instances can only be created by methods of Transaction, and have no meaning outside the context of the transaction in which they are created.

Since:
MMBase-1.5
Version:
$Id: TmpObject.java,v 1.8 2005/10/06 14:14:41 michiel Exp $
Author:
Rob van Maris: Finalist IT Group

Method Summary
 void copyDestinationOf(TmpObject tmpObj)
          Copies destination of relation in temporary cloud to this object.
 void copySourceOf(TmpObject tmpObj)
          Copies source of relation in temporary cloud to this object.
 boolean getDisposeWhenNotReferenced()
          DisposeWhenNotReferenced accessor.
 Object getField(String name)
          Gets field of the temporary node.
 String getId()
          Id accessor.
 String getKey()
          Key accessor.
 int getMMBaseId()
          MMBaseId accessor (for access objects).
 MMObjectNode getNode()
          Gets the temporary node corresponding to this object.
 Vector getRelationsInPersistentCloud()
          Gets the relations of this object in the persistent cloud.
 boolean isAccessObject()
          Tests if this object is an accessed object (representing an object that already exists in the persistent cloud) or an input object.
 boolean isDestinationOf(TmpObject tempRel)
          Tests if this node is the destination node of a relation.
 boolean isRelation()
          Tests if this object is a relation.
 boolean isSourceOf(TmpObject tempRel)
          Tests if this node is the source node of a relation.
 void setDestination(TmpObject tmpObj)
          Sets destination for relation in temporary cloud.
 void setField(String name, Object value)
          Sets field of the temporary node represented by this TmpObject instance.
 void setSource(TmpObject tmpObj)
          Sets source for relation in temporary cloud.
 String toString()
          ToString() method, displays most important fields.
 String toXML()
          Displays XML representation of this object, such as the XML code necessary to create this object in a transaction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getField

public Object getField(String name)
Gets field of the temporary node.

Parameters:
name - The field.
Returns:
The value of the field.

setField

public void setField(String name,
                     Object value)
Sets field of the temporary node represented by this TmpObject instance. If the value is a String and the type of the field is TYPE_BYTE, the string is decoded to bytes using Base64.

Parameters:
name - The field name.
value - The field value.

getRelationsInPersistentCloud

public Vector getRelationsInPersistentCloud()
Gets the relations of this object in the persistent cloud. Note that the relations returned are always of builder type 'InsRel', even if they are really from a derived builder such as AuthRel.

Returns:
All relations in the persistent cloud of the object in the persistent cloud represented by this TmpObject instance.

getNode

public MMObjectNode getNode()
Gets the temporary node corresponding to this object.

Returns:
The temporary node.

getKey

public String getKey()
Key accessor.

Returns:
The key used internally by TemporaryNodeManager and TransactionManager.

getId

public String getId()
Id accessor.

Returns:
The id specified by the user.

isAccessObject

public boolean isAccessObject()
Tests if this object is an accessed object (representing an object that already exists in the persistent cloud) or an input object.

Returns:
true if this is an access object, false otherwise.

getMMBaseId

public int getMMBaseId()
MMBaseId accessor (for access objects).

Returns:
The MMBase id, null if this is not an access object.

isRelation

public boolean isRelation()
Tests if this object is a relation.

Returns:
true if this is a relation, false otherwise.

getDisposeWhenNotReferenced

public boolean getDisposeWhenNotReferenced()
DisposeWhenNotReferenced accessor.

Returns:
disposeWhenNotReferenced flag: true if this object is to be dropped when it has no relations on commit, false otherwise.

isSourceOf

public boolean isSourceOf(TmpObject tempRel)
Tests if this node is the source node of a relation.

Parameters:
tempRel - Temporary relation node.
Returns:
true if the relation node has this node as source.

isDestinationOf

public boolean isDestinationOf(TmpObject tempRel)
Tests if this node is the destination node of a relation.

Parameters:
tempRel - Temporary relation node.
Returns:
true if the relation node has this node as destination.

setSource

public void setSource(TmpObject tmpObj)
Sets source for relation in temporary cloud. Requires this object to be a relation.

Parameters:
tmpObj - The temporary object to set as source.

setDestination

public void setDestination(TmpObject tmpObj)
Sets destination for relation in temporary cloud. Requires this object to be a relation.

Parameters:
tmpObj - The temporary object to set as destination.

copySourceOf

public void copySourceOf(TmpObject tmpObj)
Copies source of relation in temporary cloud to this object. Requires this object to be a relation.

Parameters:
tmpObj - The temporary object to copy the source of.

copyDestinationOf

public void copyDestinationOf(TmpObject tmpObj)
Copies destination of relation in temporary cloud to this object. Requires this object to be a relation.

Parameters:
tmpObj - The temporary object to copy the destination of.

toString

public String toString()
ToString() method, displays most important fields.

Returns:
String representation of this object.

toXML

public String toXML()
Displays XML representation of this object, such as the XML code necessary to create this object in a transaction.

Returns:
XML representation of this object.


MMBase build 1.8.1.20060716