org.keridwen.core.data.model
Interface Node<T>

All Superinterfaces:
Iterable<Node<?>>, MutableTreeNode, TreeNode
All Known Implementing Classes:
DefaultNode

public interface Node<T>
extends Iterable<Node<?>>, MutableTreeNode

Mutable node for Keridwen tree-based DataModel.


Method Summary
 void clearContent()
          Removes the content of the node.
 T getContent()
          Gets the content of the Node.
 String getDescription()
          Gets the String description of the Node
 String getName()
          Gets the Node name.
 NodeInformation getNodeInformation()
          Gets metadata information about the Node.
 NodeReader<T> getNodeReader()
          Gets the NodeReader.
 NodeState getNodeState()
          Gets the NodeState.
 URI getNodeURI()
          Gets the URI where the Node is saved.
 nu.xom.Element getXmlElement()
          Gets the XML description of the Node.
 boolean isContentLoaded()
          Indicates whether the content of the node has been loaded in memory or not.
 boolean isContentLocal()
          Indicates whether the content of the node is stored within the model or linked from outside.
 boolean isFolder()
          Indicates if this Node is a folder Node or a leaf Node.
 Iterator<Node<?>> iterator()
           
 void load(URI nodeURI)
          Loads the Node content from the given URI.
 void reload()
          Reloads the Node content
 void saveNode()
          Saves the Node to its current URI
 void saveNodeAs(URI nodeURI)
          Saves the Node to the given URI
 void setContentLocal(boolean isContentLocal)
          Indicates whether the content of the node is stored within the model or linked from outside.
 void setNodeReader(NodeReader<T> nodeReader)
          Sets the NodeReader.
 void setNodeState(NodeState stateToSet)
          Sets the Node state.
 void setNodeURI(URI uriToSet)
          Sets the Node URI.
 void setNodeWriter(NodeWriter nodeWriter)
          Sets the NodeWriter.
 
Methods inherited from interface javax.swing.tree.MutableTreeNode
insert, remove, remove, removeFromParent, setParent, setUserObject
 
Methods inherited from interface javax.swing.tree.TreeNode
children, getAllowsChildren, getChildAt, getChildCount, getIndex, getParent, isLeaf
 

Method Detail

getName

String getName()
Gets the Node name.

Returns:
the Node name

getNodeInformation

NodeInformation getNodeInformation()
Gets metadata information about the Node.

Returns:
the NodeInformation containing metadata

setNodeState

void setNodeState(NodeState stateToSet)
Sets the Node state.

Parameters:
stateToSet - the NodeState to set.

getNodeState

NodeState getNodeState()
Gets the NodeState. Its state tells if the node has been removed, is up to date, has been newly created ...

Returns:
the NodeState of the Node

isFolder

boolean isFolder()
Indicates if this Node is a folder Node or a leaf Node. A folder Node does not have any content associated to it. It this does not have a NodeReader nor a NodeWriter.

Returns:
true if the Node is a folder.

isContentLocal

boolean isContentLocal()
Indicates whether the content of the node is stored within the model or linked from outside.

Returns:
true if the content of the node is stored within the model

setContentLocal

void setContentLocal(boolean isContentLocal)
Indicates whether the content of the node is stored within the model or linked from outside.

Parameters:
isContentLocal - the boolean value to set

getContent

T getContent()
Gets the content of the Node.

Returns:
the node content

clearContent

void clearContent()
Removes the content of the node.


reload

void reload()
Reloads the Node content


load

void load(URI nodeURI)
Loads the Node content from the given URI.


saveNode

void saveNode()
Saves the Node to its current URI


saveNodeAs

void saveNodeAs(URI nodeURI)
Saves the Node to the given URI

Parameters:
nodeURI -

setNodeWriter

void setNodeWriter(NodeWriter nodeWriter)
Sets the NodeWriter.

Parameters:
nodeWriter - the NodeWriter to set

getXmlElement

nu.xom.Element getXmlElement()
Gets the XML description of the Node.

Returns:
the XML description of the Node as a Xom Element

getNodeReader

NodeReader<T> getNodeReader()
Gets the NodeReader.

Returns:
the NodeReader

setNodeReader

void setNodeReader(NodeReader<T> nodeReader)
Sets the NodeReader.

Parameters:
nodeReader - the NodeReader to set

getNodeURI

URI getNodeURI()
Gets the URI where the Node is saved.

Returns:
the Node URI

setNodeURI

void setNodeURI(URI uriToSet)
Sets the Node URI.

Parameters:
uriToSet - the URI to set

iterator

Iterator<Node<?>> iterator()
Specified by:
iterator in interface Iterable<Node<?>>

getDescription

String getDescription()
Gets the String description of the Node

Returns:
the String description of the Node

isContentLoaded

boolean isContentLoaded()
Indicates whether the content of the node has been loaded in memory or not.

Returns:
true if the content has been loaded in memory


Copyright © 2010-2013 Artenum. All Rights Reserved.