Package helma.objectmodel

# Class TransientNode

java.lang.Object
helma.objectmodel.TransientNode

All Implemented Interfaces:
  `IPathElement`, `INode`, `INodeState`, `Serializable`

public class TransientNode extends Object implements INode, Serializable
A transient implementation of INode. An instance of this class can't be made persistent by reachability from a persistent node. To make a persistent-capable object, class helma.objectmodel.db.Node has to be used.

See Also:
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`protected boolean`
`anonymous`
`protected long`
`created`
`protected String`
`id`
`protected long`
`lastmodified`
`protected String`
`name`
`protected Hashtable`
`nodeMap`
`protected Vector`
`nodes`
`protected TransientNode`
`parent`
`protected Hashtable`
`propMap`

### Fields inherited from interface helma.objectmodel.INodeState

`CLEAN, DELETED, INVALID, MODIFIED, NEW, TRANSIENT, VIRTUAL`

## Constructor Summary

Constructors
Constructor
Description
`TransientNode(Application app)`
Creates a new TransientNode object.
`TransientNode(Application app, String n)`
Make a new TransientNode object with a given name

## Method Summary

Modifier and Type
Method
Description
`INode`
`addNode(INode elem)`
Add a child node to this node.
`INode`
`addNode(INode elem, int where)`
Add a child node to this node at the given position
`void`
`clearCacheNode()`
Reset the cache node for this node.
`int`
`contains(INode n)`
Returns the position of the child or -1.
`long`
`created()`
Get the node's creation timestamp.
`INode`
`createNode()`
`INode`
`createNode(int where)`
`INode`
`createNode(String nm)`
Create a new named property with a node value
`INode`
`createNode(String nm, int where)`
Create a new unnamed child node at the given position.
`static String`
`generateID()`
`IProperty`
`get(String propname)`
Get a property with the given name.
`boolean`
`getBoolean(String propname)`
Get a boolean property with the given name.
`INode`
`getCacheNode()`
Get the cache node for this node.
`IPathElement`
`getChildElement(String name)`
Retrieve a child element of this object by name.
`Date`
`getDate(String propname)`
Get a date property with the given name.
`DbMapping`
`getDbMapping()`
Get the node's `DbMapping`.
`String`
`getElementName()`
Return the name to be used to get this element from its parent
`double`
`getFloat(String propname)`
Get a float property with the given name.
`String`
`getFullName(INode root)`
`String`
`getID()`
Get the node's ID.
`long`
`getInteger(String propname)`
Get an integer property with the given name.
`Object`
`getJavaObject(String propname)`
Get a Java object property with the given name.
`String`
`getName()`
Get the node's name.
`INode`
`getNode(String propname)`
Get a node property with the given name.
`INode`
`getParent()`
Get the node's parent node.
`IPathElement`
`getParentElement()`
Return the parent element of this object.
`String`
`getPath()`
Get the node's path.
`String`
`getPrototype()`
Return the node's prototype name.
`int`
`getState()`
Get the node's state flag.
`String`
`getString(String propname)`
Get a string property with the given name.
`String`
`getString(String propname, String defaultValue)`
`INode`
`getSubnode(String name)`
Get a named child node with the given name or id.
`INode`
`getSubnodeAt(int index)`
GEt an unnamed child node at the given position
`String`
`getSubnodeRelation()`
Get the node's explicit subnode select clause if one was set, or null
`Enumeration`
`getSubnodes()`
Get an enumeration of this node's unnamed child nodes
`boolean`
`isAnonymous()`
Returns true if this node is an unnamed node.
`long`
`lastModified()`
Get the node's last modification timestamp.
`int`
`numberOfNodes()`
Get the number the node's direct child nodes.
`Enumeration`
`properties()`
property-related
`protected void`
`releaseNode(INode node)`
"Physically" remove a subnode from the subnodes table.
`boolean`
`remove()`
Remove this node from the database.
`void`
`removeNode(INode node)`
Remove the given node from this node's child nodes.
`void`
`setBoolean(String propname, boolean value)`
Set the property with the given name to the given boolean value.
`void`
`setDate(String propname, Date value)`
Set the property with the given name to the given date value.
`void`
`setDbMapping(DbMapping dbmap)`
Set the node's `DbMapping`.
`void`
`setFloat(String propname, double value)`
Set the property with the given name to the given float value.
`void`
`setInteger(String propname, long value)`
Set the property with the given name to the given integer value.
`void`
`setJavaObject(String propname, Object value)`
Set the property with the given name to the given Java object value.
`void`
`setName(String name)`
Set the node's name.
`void`
`setNode(String propname, INode value)`
Set the property with the given name to the given node value.
`void`
`setPrototype(String proto)`
Set the node's prototype name.
`void`
`setState(int s)`
Set the node's state flag.
`void`
`setString(String propname, String value)`
Set the property with the given name to the given string value.
`void`
`setSubnodeRelation(String rel)`
Set an explicit select clause for the node's subnodes
`String`
`toString()`
`void`
`unset(String propname)`
Unset the property with the given name..

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### propMap

protected Hashtable propMap

### nodeMap

protected Hashtable nodeMap

### nodes

protected Vector nodes

### parent

protected TransientNode parent

### created

protected long created

### lastmodified

protected long lastmodified

### id

protected String id

### name

protected String name

### anonymous

protected boolean anonymous

## Constructor Details

### TransientNode

public TransientNode(Application app)
Creates a new TransientNode object.

### TransientNode

public TransientNode(Application app, String n)
Make a new TransientNode object with a given name

## Method Details

### generateID

public static String generateID()

### setDbMapping

public void setDbMapping(DbMapping dbmap)
Description copied from interface: `INode`
Set the node's `DbMapping`.

Specified by:
  `setDbMapping` in interface `INode`

### getDbMapping

public DbMapping getDbMapping()
Description copied from interface: `INode`
Get the node's `DbMapping`.

Specified by:
  `getDbMapping` in interface `INode`

### getID

public String getID()
Description copied from interface: `INode`
Get the node's ID.

Specified by:
  `getID` in interface `INode`

### isAnonymous

public boolean isAnonymous()
Description copied from interface: `INode`
Returns true if this node is an unnamed node.

Specified by:
  `isAnonymous` in interface `INode`

### getName

public String getName()
Description copied from interface: `INode`
Get the node's name.

Specified by:
  `getName` in interface `INode`

### getElementName

public String getElementName()
Description copied from interface: `IPathElement`
Return the name to be used to get this element from its parent

Specified by:
  `getElementName` in interface `IPathElement`

### getState

public int getState()
Description copied from interface: `INode`
Get the node's state flag.

Specified by:
  `getState` in interface `INode`
Returns:
  one of the constants defined in the `INodeState` interface.

### setState

public void setState(int s)
Description copied from interface: `INode`
Set the node's state flag.

Specified by:
  `setState` in interface `INode`
Parameters:
  `s` - one of the constants defined in the `INodeState` interface.

### getPath

public String getPath()
Description copied from interface: `INode`
Get the node's path.

Specified by:
  `getPath` in interface `INode`

### getFullName

public String getFullName(INode root)

### setName

public void setName(String name)
Description copied from interface: `INode`
Set the node's name.

Specified by:
  `setName` in interface `INode`

### getPrototype

public String getPrototype()
Description copied from interface: `INode`
Return the node's prototype name.

Specified by:
  `getPrototype` in interface `INode`
Specified by:
  `getPrototype` in interface `IPathElement`

### setPrototype

public void setPrototype(String proto)
Description copied from interface: `INode`
Set the node's prototype name.

Specified by:
  `setPrototype` in interface `INode`

### getParent

public INode getParent()
Description copied from interface: `INode`
Get the node's parent node.

Specified by:
  `getParent` in interface `INode`

### setSubnodeRelation

public void setSubnodeRelation(String rel)
Description copied from interface: `INode`
Set an explicit select clause for the node's subnodes

Specified by:
  `setSubnodeRelation` in interface `INode`

### getSubnodeRelation

public String getSubnodeRelation()
Description copied from interface: `INode`
Get the node's explicit subnode select clause if one was set, or null

Specified by:
  `getSubnodeRelation` in interface `INode`

### numberOfNodes

public int numberOfNodes()
Description copied from interface: `INode`
Get the number the node's direct child nodes.

Specified by:
  `numberOfNodes` in interface `INode`

### addNode

public INode addNode(INode elem)
Description copied from interface: `INode`
Add a child node to this node.

Specified by:
  `addNode` in interface `INode`

### addNode

public INode addNode(INode elem, int where)
Description copied from interface: `INode`
Add a child node to this node at the given position

Specified by:
  `addNode` in interface `INode`

### createNode

public INode createNode()

### createNode

public INode createNode(int where)

### createNode

public INode createNode(String nm)
Description copied from interface: `INode`
Create a new named property with a node value

Specified by:
  `createNode` in interface `INode`

### createNode

public INode createNode(String nm, int where)
Description copied from interface: `INode`
Create a new unnamed child node at the given position.

Specified by:
  `createNode` in interface `INode`

### getParentElement

public IPathElement getParentElement()
Description copied from interface: `IPathElement`
Return the parent element of this object.

Specified by:
  `getParentElement` in interface `IPathElement`

### getChildElement

public IPathElement getChildElement(String name)
Description copied from interface: `IPathElement`
Retrieve a child element of this object by name.

Specified by:
  `getChildElement` in interface `IPathElement`

### getSubnode

public INode getSubnode(String name)
Description copied from interface: `INode`
Get a named child node with the given name or id.

Specified by:
  `getSubnode` in interface `INode`

### getSubnodeAt

public INode getSubnodeAt(int index)
Description copied from interface: `INode`
GEt an unnamed child node at the given position

Specified by:
  `getSubnodeAt` in interface `INode`

### contains

public int contains(INode n)
Description copied from interface: `INode`
Returns the position of the child or -1.

Specified by:
  `contains` in interface `INode`

### remove

public boolean remove()
Description copied from interface: `INode`
Remove this node from the database.

Specified by:
  `remove` in interface `INode`

### removeNode

public void removeNode(INode node)
Description copied from interface: `INode`
Remove the given node from this node's child nodes.

Specified by:
  `removeNode` in interface `INode`

### releaseNode

protected void releaseNode(INode node)
"Physically" remove a subnode from the subnodes table. the logical stuff necessary for keeping data consistent is done elsewhere (in removeNode).

### getSubnodes

public Enumeration getSubnodes()
Description copied from interface: `INode`
Get an enumeration of this node's unnamed child nodes

Specified by:
  `getSubnodes` in interface `INode`
Returns:
  ...

### properties

public Enumeration properties()
property-related

Specified by:
  `properties` in interface `INode`

### get

public IProperty get(String propname)
Description copied from interface: `INode`
Get a property with the given name.

Specified by:
  `get` in interface `INode`

### getString

public String getString(String propname, String defaultValue)

### getString

public String getString(String propname)
Description copied from interface: `INode`
Get a string property with the given name.

Specified by:
  `getString` in interface `INode`

### getInteger

public long getInteger(String propname)
Description copied from interface: `INode`
Get an integer property with the given name.

Specified by:
  `getInteger` in interface `INode`

### getFloat

public double getFloat(String propname)
Description copied from interface: `INode`
Get a float property with the given name.

Specified by:
  `getFloat` in interface `INode`

### getDate

public Date getDate(String propname)
Description copied from interface: `INode`
Get a date property with the given name.

Specified by:
  `getDate` in interface `INode`

### getBoolean

public boolean getBoolean(String propname)
Description copied from interface: `INode`
Get a boolean property with the given name.

Specified by:
  `getBoolean` in interface `INode`

### getNode

public INode getNode(String propname)
Description copied from interface: `INode`
Get a node property with the given name.

Specified by:
  `getNode` in interface `INode`

### getJavaObject

public Object getJavaObject(String propname)
Description copied from interface: `INode`
Get a Java object property with the given name.

Specified by:
  `getJavaObject` in interface `INode`

### setString

public void setString(String propname, String value)
Description copied from interface: `INode`
Set the property with the given name to the given string value.

Specified by:
  `setString` in interface `INode`

### setInteger

public void setInteger(String propname, long value)
Description copied from interface: `INode`
Set the property with the given name to the given integer value.

Specified by:
  `setInteger` in interface `INode`

### setFloat

public void setFloat(String propname, double value)
Description copied from interface: `INode`
Set the property with the given name to the given float value.

Specified by:
  `setFloat` in interface `INode`

### setBoolean

public void setBoolean(String propname, boolean value)
Description copied from interface: `INode`
Set the property with the given name to the given boolean value.

Specified by:
  `setBoolean` in interface `INode`

### setDate

public void setDate(String propname, Date value)
Description copied from interface: `INode`
Set the property with the given name to the given date value.

Specified by:
  `setDate` in interface `INode`

### setJavaObject

public void setJavaObject(String propname, Object value)
Description copied from interface: `INode`
Set the property with the given name to the given Java object value.

Specified by:
  `setJavaObject` in interface `INode`

### setNode

public void setNode(String propname, INode value)
Description copied from interface: `INode`
Set the property with the given name to the given node value.

Specified by:
  `setNode` in interface `INode`

### unset

public void unset(String propname)
Description copied from interface: `INode`
Unset the property with the given name..

Specified by:
  `unset` in interface `INode`

### lastModified

public long lastModified()
Description copied from interface: `INode`
Get the node's last modification timestamp.

Specified by:
  `lastModified` in interface `INode`

### created

public long created()
Description copied from interface: `INode`
Get the node's creation timestamp.

Specified by:
  `created` in interface `INode`

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### getCacheNode

public INode getCacheNode()
Get the cache node for this node. This can be used to store transient cache data per node from Javascript.

Specified by:
  `getCacheNode` in interface `INode`

### clearCacheNode

public void clearCacheNode()
Reset the cache node for this node.

Specified by:
  `clearCacheNode` in interface `INode`