public abstract class Node extends Object implements Session, Serializable
Record,
Field,
ArrayValue,
SingleValue,
ValueNode,
Serialized Form| Modifier and Type | Class and Description |
|---|---|
static class |
Node.DuplicateNodeAction
DuplicateNodeAction lists all actions that can be taken automatically when a target field already exists during a record copy or lookup.
|
static class |
Node.NodeType
NodeType lists all concrete data node types used in Data Pipeline.
|
Session.SessionImpl| Modifier and Type | Field and Description |
|---|---|
protected Session.SessionImpl |
session |
| Constructor and Description |
|---|
Node() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
assertNotAncestorOf(Node parentNode) |
<T> boolean |
containsSessionProperty(Class<T> type)
Returns
true if a session property exists for the given type. |
<T> boolean |
containsSessionProperty(Class<T> type,
String name)
Returns
true if a session property exists for the given type and name combination. |
boolean |
containsSessionProperty(String name)
Returns
true if a session property exists with the given name. |
void |
copySessionPropertiesFrom(Session sourceSession)
Copies all session properties from the given source session into this one.
|
int |
getNodeDepth()
Returns this node's distance from its root node.
|
abstract Node.NodeType |
getNodeType()
Returns the concrete
Node.NodeType of this node. |
Field |
getParentField()
Returns the closest parent record's field that this node is the child of, otherwise null if one does not exist.
|
abstract Node |
getParentNode()
Returns the parent node that this node belongs to, or
null if this is a root node. |
Record |
getParentRecord()
Returns the closest parent record that this node is the child of, otherwise null if one does not exist.
|
<T> T |
getSessionProperty(Class<T> type)
Returns the session property value associated with the given type.
|
<T> T |
getSessionProperty(Class<T> type,
String name)
Returns the session property value associated with the given type and name combination.
|
<T> T |
getSessionProperty(String name)
Returns the session property value associated with the given name.
|
abstract boolean |
hasChildNodes()
Returns
true if this node contains any sub nodes. |
abstract boolean |
hasChildRecords()
Returns
true if this node contains any descendant, record nodes. |
boolean |
isAncestorOf(Node node)
Returns
true if the supplied node is a descendant of this one. |
boolean |
isChildNode()
Indicates if this record has a parent record (i.e.
|
abstract boolean |
isNotNull()
Returns
true if this node does not contain a null value. |
abstract boolean |
isNull()
Returns
true if this node contains a null value. |
boolean |
isValueNode()
Returns
true if this node is a ValueNode (Record, ArrayValue, or SingleValue). |
Set<String> |
keySet()
Returns the set of all session property keys.
|
protected abstract void |
removeChildNode(Node child) |
void |
removeSessionProperties()
Removes all session properties from this session.
|
<T> void |
setSessionProperty(Class<T> type,
Object value)
Sets a session property value keyed by type.
|
<T> void |
setSessionProperty(Class<T> type,
String name,
Object value)
Sets a session property value keyed by the given type and name combination.
|
void |
setSessionProperty(String name,
Object value)
Sets a session property value keyed by name.
|
abstract String |
toString()
Returns a human-readable string representation of this node and its contents.
|
protected transient Session.SessionImpl session
public abstract Node getParentNode()
null if this is a root node.nullprotected abstract void removeChildNode(Node child)
public abstract boolean isNull()
true if this node contains a null value. In concrete terms, only Field and SingleValue can contain nulls while not
being null themselves. Both Record and ArrayValue will return false even if they have no values or null only values.public abstract boolean isNotNull()
true if this node does not contain a null value. In concrete terms, only Field and SingleValue can contain nulls
while not being null themselves. Both Record and ArrayValue will return true even if they have no values or null only
values.public Field getParentField()
public Record getParentRecord()
getParentField(),
isChildNode(),
hasChildRecords(),
getNodeDepth(),
Field.getValueAsRecord(),
Field#getValueAsRecords()public abstract Node.NodeType getNodeType()
Node.NodeType of this node.nullpublic boolean isChildNode()
getParentField() can be used to retrieve the parent record's field that this
record is attached to.getParentField(),
getParentRecord(),
hasChildRecords(),
#getRecordDepth(),
Field.getValueAsRecord(),
Field#getValueAsRecords()public abstract boolean hasChildNodes()
true if this node contains any sub nodes.public abstract boolean hasChildRecords()
true if this node contains any descendant, record nodes.public int getNodeDepth()
public boolean isAncestorOf(Node node)
true if the supplied node is a descendant of this one.protected void assertNotAncestorOf(Node parentNode)
public boolean isValueNode()
true if this node is a ValueNode (Record, ArrayValue, or SingleValue).public abstract String toString()
public Set<String> keySet()
Returns the set of session property keys stored on this node. Returns an empty set if no session properties have been assigned.
public <T> boolean containsSessionProperty(Class<T> type, String name)
true if a session property exists for the given type and name combination.containsSessionProperty in interface SessionT - the type used as part of the property keytype - the class used as part of the property key, or null to match by name onlyname - the property name, or null to match by type onlytrue if the property existspublic <T> boolean containsSessionProperty(Class<T> type)
true if a session property exists for the given type.containsSessionProperty in interface SessionT - the type used as the property keytype - the class used as the property keytrue if the property existspublic boolean containsSessionProperty(String name)
true if a session property exists with the given name.containsSessionProperty in interface Sessionname - the property nametrue if the property existspublic void copySessionPropertiesFrom(Session sourceSession)
Copies all session properties from the given source session into this node's session.
If the source session is null or empty, this method does nothing.
copySessionPropertiesFrom in interface SessionsourceSession - the source session to copy from, may be nullpublic void removeSessionProperties()
Removes all session properties from this node by discarding the internal session store.
removeSessionProperties in interface Sessionpublic <T> T getSessionProperty(Class<T> type, String name)
getSessionProperty in interface SessionT - the expected value typetype - the class used as part of the property key, or null to match by name onlyname - the property name, or null to match by type onlynull if not foundpublic <T> T getSessionProperty(Class<T> type)
getSessionProperty in interface SessionT - the expected value typetype - the class used as the property keynull if not foundpublic <T> T getSessionProperty(String name)
getSessionProperty in interface SessionT - the expected value typename - the property namenull if not foundpublic <T> void setSessionProperty(Class<T> type, String name, Object value)
setSessionProperty in interface SessionT - the type used as part of the property keytype - the class used as part of the property key, or null to match by name onlyname - the property name, or null to match by type onlyvalue - the value to storepublic <T> void setSessionProperty(Class<T> type, Object value)
setSessionProperty in interface SessionT - the type used as the property keytype - the class used as the property keyvalue - the value to storepublic void setSessionProperty(String name, Object value)
setSessionProperty in interface Sessionname - the property namevalue - the value to storeCopyright (c) 2006-2026 North Concepts Inc. All Rights Reserved.