Package helma.objectmodel
Class TransientNode
java.lang.Object
helma.objectmodel.TransientNode
- All Implemented Interfaces:
IPathElement
,INode
,INodeState
,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:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTransientNode
(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 TypeMethodDescriptionAdd a child node to this node.Add a child node to this node at the given positionvoid
Reset the cache node for this node.int
Returns the position of the child or -1.long
created()
Get the node's creation timestamp.createNode
(int where) createNode
(String nm) Create a new named property with a node valuecreateNode
(String nm, int where) Create a new unnamed child node at the given position.static String
Get a property with the given name.boolean
getBoolean
(String propname) Get a boolean property with the given name.Get the cache node for this node.getChildElement
(String name) Retrieve a child element of this object by name.Get a date property with the given name.Get the node'sDbMapping
.Return the name to be used to get this element from its parentdouble
Get a float property with the given name.getFullName
(INode root) getID()
Get the node's ID.long
getInteger
(String propname) Get an integer property with the given name.getJavaObject
(String propname) Get a Java object property with the given name.getName()
Get the node's name.Get a node property with the given name.Get the node's parent node.Return the parent element of this object.getPath()
Get the node's path.Return the node's prototype name.int
getState()
Get the node's state flag.Get a string property with the given name.getSubnode
(String name) Get a named child node with the given name or id.getSubnodeAt
(int index) GEt an unnamed child node at the given positionGet the node's explicit subnode select clause if one was set, or nullGet an enumeration of this node's unnamed child nodesboolean
Returns true if this node is an unnamed node.long
Get the node's last modification timestamp.int
Get the number the node's direct child nodes.property-relatedprotected 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
Set the property with the given name to the given date value.void
setDbMapping
(DbMapping dbmap) Set the node'sDbMapping
.void
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
Set the node's name.void
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
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 subnodestoString()
void
Unset the property with the given name..
-
Field Details
-
propMap
-
nodeMap
-
nodes
-
parent
-
created
protected long created -
lastmodified
protected long lastmodified -
id
-
name
-
anonymous
protected boolean anonymous
-
-
Constructor Details
-
TransientNode
Creates a new TransientNode object. -
TransientNode
Make a new TransientNode object with a given name
-
-
Method Details
-
generateID
-
setDbMapping
Description copied from interface:INode
Set the node'sDbMapping
.- Specified by:
setDbMapping
in interfaceINode
-
getDbMapping
Description copied from interface:INode
Get the node'sDbMapping
.- Specified by:
getDbMapping
in interfaceINode
-
getID
Description copied from interface:INode
Get the node's ID. -
isAnonymous
public boolean isAnonymous()Description copied from interface:INode
Returns true if this node is an unnamed node.- Specified by:
isAnonymous
in interfaceINode
-
getName
Description copied from interface:INode
Get the node's name. -
getElementName
Description copied from interface:IPathElement
Return the name to be used to get this element from its parent- Specified by:
getElementName
in interfaceIPathElement
-
getState
public int getState()Description copied from interface:INode
Get the node's state flag.- Specified by:
getState
in interfaceINode
- 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 interfaceINode
- Parameters:
s
- one of the constants defined in theINodeState
interface.
-
getPath
Description copied from interface:INode
Get the node's path. -
getFullName
-
setName
Description copied from interface:INode
Set the node's name. -
getPrototype
Description copied from interface:INode
Return the node's prototype name.- Specified by:
getPrototype
in interfaceINode
- Specified by:
getPrototype
in interfaceIPathElement
-
setPrototype
Description copied from interface:INode
Set the node's prototype name.- Specified by:
setPrototype
in interfaceINode
-
getParent
Description copied from interface:INode
Get the node's parent node. -
setSubnodeRelation
Description copied from interface:INode
Set an explicit select clause for the node's subnodes- Specified by:
setSubnodeRelation
in interfaceINode
-
getSubnodeRelation
Description copied from interface:INode
Get the node's explicit subnode select clause if one was set, or null- Specified by:
getSubnodeRelation
in interfaceINode
-
numberOfNodes
public int numberOfNodes()Description copied from interface:INode
Get the number the node's direct child nodes.- Specified by:
numberOfNodes
in interfaceINode
-
addNode
Description copied from interface:INode
Add a child node to this node. -
addNode
Description copied from interface:INode
Add a child node to this node at the given position -
createNode
-
createNode
-
createNode
Description copied from interface:INode
Create a new named property with a node value- Specified by:
createNode
in interfaceINode
-
createNode
Description copied from interface:INode
Create a new unnamed child node at the given position.- Specified by:
createNode
in interfaceINode
-
getParentElement
Description copied from interface:IPathElement
Return the parent element of this object.- Specified by:
getParentElement
in interfaceIPathElement
-
getChildElement
Description copied from interface:IPathElement
Retrieve a child element of this object by name.- Specified by:
getChildElement
in interfaceIPathElement
-
getSubnode
Description copied from interface:INode
Get a named child node with the given name or id.- Specified by:
getSubnode
in interfaceINode
-
getSubnodeAt
Description copied from interface:INode
GEt an unnamed child node at the given position- Specified by:
getSubnodeAt
in interfaceINode
-
contains
Description copied from interface:INode
Returns the position of the child or -1. -
remove
public boolean remove()Description copied from interface:INode
Remove this node from the database. -
removeNode
Description copied from interface:INode
Remove the given node from this node's child nodes.- Specified by:
removeNode
in interfaceINode
-
releaseNode
"Physically" remove a subnode from the subnodes table. the logical stuff necessary for keeping data consistent is done elsewhere (in removeNode). -
getSubnodes
Description copied from interface:INode
Get an enumeration of this node's unnamed child nodes- Specified by:
getSubnodes
in interfaceINode
- Returns:
- ...
-
properties
property-related- Specified by:
properties
in interfaceINode
-
get
Description copied from interface:INode
Get a property with the given name. -
getString
-
getString
Description copied from interface:INode
Get a string property with the given name. -
getInteger
Description copied from interface:INode
Get an integer property with the given name.- Specified by:
getInteger
in interfaceINode
-
getFloat
Description copied from interface:INode
Get a float property with the given name. -
getDate
Description copied from interface:INode
Get a date property with the given name. -
getBoolean
Description copied from interface:INode
Get a boolean property with the given name.- Specified by:
getBoolean
in interfaceINode
-
getNode
Description copied from interface:INode
Get a node property with the given name. -
getJavaObject
Description copied from interface:INode
Get a Java object property with the given name.- Specified by:
getJavaObject
in interfaceINode
-
setString
Description copied from interface:INode
Set the property with the given name to the given string value. -
setInteger
Description copied from interface:INode
Set the property with the given name to the given integer value.- Specified by:
setInteger
in interfaceINode
-
setFloat
Description copied from interface:INode
Set the property with the given name to the given float value. -
setBoolean
Description copied from interface:INode
Set the property with the given name to the given boolean value.- Specified by:
setBoolean
in interfaceINode
-
setDate
Description copied from interface:INode
Set the property with the given name to the given date value. -
setJavaObject
Description copied from interface:INode
Set the property with the given name to the given Java object value.- Specified by:
setJavaObject
in interfaceINode
-
setNode
Description copied from interface:INode
Set the property with the given name to the given node value. -
unset
Description copied from interface:INode
Unset the property with the given name.. -
lastModified
public long lastModified()Description copied from interface:INode
Get the node's last modification timestamp.- Specified by:
lastModified
in interfaceINode
-
created
public long created()Description copied from interface:INode
Get the node's creation timestamp. -
toString
-
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 interfaceINode
-
clearCacheNode
public void clearCacheNode()Reset the cache node for this node.- Specified by:
clearCacheNode
in interfaceINode
-