|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.tree.DefaultMutableTreeNode org.keridwen.core.data.model.impl.DefaultNode<T>
public class DefaultNode<T>
Field Summary |
---|
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode |
---|
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject |
Constructor Summary | |
---|---|
DefaultNode(String name)
Creates an empty folder Node . |
|
DefaultNode(String name,
T contentToSet)
Creates a Node with the given name, initial content, NodeReader and NodeWriter . |
|
DefaultNode(String name,
URI anURI,
NodeReader<T> aReader,
NodeWriter aWriter)
Creates a Node with the given name, NodeReader and NodeWriter . |
Method Summary | |
---|---|
void |
clearContent()
Removes the content of the node. |
Node<?> |
getChildNodeByName(String nameToFind)
Gets the child Node with the given name. |
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 anURI)
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 anURI)
Saves the Node to the given URI |
void |
setContentLocal(boolean innerContent)
Indicates whether the content of the node is stored within the model or linked from outside. |
void |
setName(String name)
Sets the Node name. |
void |
setNodeReader(NodeReader<T> aReader)
Sets the NodeReader . |
void |
setNodeState(NodeState stateToSet)
Sets the Node state. |
void |
setNodeURI(URI uriToSet)
Sets the Node URI . |
void |
setNodeWriter(NodeWriter aWriter)
Sets the NodeWriter . |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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 |
Constructor Detail |
---|
public DefaultNode(String name, T contentToSet)
Node
with the given name, initial content, NodeReader
and NodeWriter
.
name
- the Node
namecontentToSet
- the initial content of the Node
public DefaultNode(String name, URI anURI, NodeReader<T> aReader, NodeWriter aWriter)
Node
with the given name, NodeReader
and NodeWriter
.
name
- the Node
nameanURI
- the Node
URI
aReader
- the NodeReader
to setaWriter
- the NodeWriter
to setpublic DefaultNode(String name)
Node
.
name
- the name of the Node
Method Detail |
---|
public void setName(String name)
Node
name.
name
- the name to setpublic String getName()
Node
Node
name.
getName
in interface Node<T>
Node
namepublic NodeInformation getNodeInformation()
Node
Node
.
getNodeInformation
in interface Node<T>
NodeInformation
containing metadatapublic void setNodeState(NodeState stateToSet)
Node
Node
state.
setNodeState
in interface Node<T>
stateToSet
- the NodeState
to set.public NodeState getNodeState()
Node
NodeState
. Its state tells if the node has been removed, is up to date, has been newly created
...
getNodeState
in interface Node<T>
NodeState
of the Node
public Iterator<Node<?>> iterator()
iterator
in interface Iterable<Node<?>>
iterator
in interface Node<T>
public T getContent()
Node
Node
.
getContent
in interface Node<T>
public void reload()
Node
Node
content
reload
in interface Node<T>
public void load(URI anURI)
Node
Node
content from the given URI
.
load
in interface Node<T>
public void saveNode()
Node
Node
to its current URI
saveNode
in interface Node<T>
public void saveNodeAs(URI anURI)
Node
Node
to the given URI
saveNodeAs
in interface Node<T>
public NodeReader<T> getNodeReader()
Node
NodeReader
.
getNodeReader
in interface Node<T>
NodeReader
public void setNodeWriter(NodeWriter aWriter)
Node
NodeWriter
.
setNodeWriter
in interface Node<T>
aWriter
- the NodeWriter
to setpublic void setNodeReader(NodeReader<T> aReader)
Node
NodeReader
.
setNodeReader
in interface Node<T>
aReader
- the NodeReader
to setpublic boolean isFolder()
Node
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
.
isFolder
in interface Node<T>
true
if the Node
is a folder.public URI getNodeURI()
Node
URI
where the Node
is saved.
getNodeURI
in interface Node<T>
Node
URI
public void setNodeURI(URI uriToSet)
Node
Node
URI
.
setNodeURI
in interface Node<T>
uriToSet
- the URI
to setpublic boolean isContentLocal()
Node
isContentLocal
in interface Node<T>
public void setContentLocal(boolean innerContent)
Node
setContentLocal
in interface Node<T>
innerContent
- the boolean value to setpublic nu.xom.Element getXmlElement()
Node
Node
.
getXmlElement
in interface Node<T>
Node
as a Xom Element
public Node<?> getChildNodeByName(String nameToFind)
Node
with the given name.
nameToFind
- the name of the child Node
to find
Node
found (if any, null
otherwisepublic String getDescription()
Node
String
description of the Node
getDescription
in interface Node<T>
String
description of the Node
public void clearContent()
Node
clearContent
in interface Node<T>
public boolean isContentLoaded()
Node
isContentLoaded
in interface Node<T>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |