org.keridwen.core.data.model
Interface DataModel

All Superinterfaces:
TreeModel
All Known Implementing Classes:
DefaultDataModel

public interface DataModel
extends TreeModel


Method Summary
 void addModificationStateListener(ModificationStateListener listenerToAdd)
          Adds the given ModificationStateListener to the list of listeners.
 int addNode(Node<?> newChild, Node<?> parent)
          Adds the given child Node as the last child of the given parent Node.
 void addNodeReaderForPath(NodeReader<?> readerToAdd, String nodePath)
          Associates the given NodeReader to the provided node absolute path in the XML file.
 DataModelInformation getDataModelInformation()
          Gets the DataModel metadata
 ModificationState getModificationState()
          Gets the ModificationState of the DataModel.
 NodeReader<?> getNodeReader(String nodePath)
          Gets the NodeReader associated with the given file format.
 Node<?> getRootNode()
          Gets the DataModel root Node.
 void insertNodeInto(Node<?> newChild, Node<?> parent, int index)
          Inserts the given child Node in the given parent Node, at the given index.
 void loadModel(URI rootURI)
          Loads the DataModel from the given root Node URI.
 void removeModificationStateListener(ModificationStateListener listenerToRemove)
          Removes the given ModificationStateListener from the list of listeners.
 void removeReaderForPath(String nodePath)
          Removes the association between the given node path and its NodeReader.
 void saveModel()
          Saves the whole model.
 void saveModelAs(URI rootURI)
          Saves the DataModel, with the given URI as the root Node.
 void setModificationState(ModificationState newState)
          Sets the ModificationState of the DataModel to the given new state.
 void setRootNode(Node<?> rootNode)
          Sets the root Node of the DataModel.
 
Methods inherited from interface javax.swing.tree.TreeModel
addTreeModelListener, getChild, getChildCount, getIndexOfChild, getRoot, isLeaf, removeTreeModelListener, valueForPathChanged
 

Method Detail

getRootNode

Node<?> getRootNode()
Gets the DataModel root Node.

Returns:
the root Node of the DataModel

setRootNode

void setRootNode(Node<?> rootNode)
Sets the root Node of the DataModel.

Parameters:
rootNode - the root Node to set

getDataModelInformation

DataModelInformation getDataModelInformation()
Gets the DataModel metadata

Returns:
the DataModelInformation of the DataModel

insertNodeInto

void insertNodeInto(Node<?> newChild,
                    Node<?> parent,
                    int index)
Inserts the given child Node in the given parent Node, at the given index.

Parameters:
newChild - the child Node to add
parent - the parent Node in which to add the new Node
index - the index of insertion

addNode

int addNode(Node<?> newChild,
            Node<?> parent)
Adds the given child Node as the last child of the given parent Node.

Parameters:
newChild - the Node to add
parent - the Node in which to add the new Node
Returns:
the index of the inserted Node

saveModel

void saveModel()
Saves the whole model.


saveModelAs

void saveModelAs(URI rootURI)
Saves the DataModel, with the given URI as the root Node.

Parameters:
rootURI - the root Node URI

loadModel

void loadModel(URI rootURI)
Loads the DataModel from the given root Node URI.

Parameters:
rootURI - the root Node URI

getModificationState

ModificationState getModificationState()
Gets the ModificationState of the DataModel.

Returns:
the ModificationState of the DataModel

setModificationState

void setModificationState(ModificationState newState)
Sets the ModificationState of the DataModel to the given new state.

Parameters:
newState - the ModificationState to set.

addModificationStateListener

void addModificationStateListener(ModificationStateListener listenerToAdd)
Adds the given ModificationStateListener to the list of listeners.

Parameters:
listenerToAdd - the ModificationStateListener to add

removeModificationStateListener

void removeModificationStateListener(ModificationStateListener listenerToRemove)
Removes the given ModificationStateListener from the list of listeners.

Parameters:
listenerToRemove - the ModificationStateListener to remove

getNodeReader

NodeReader<?> getNodeReader(String nodePath)
Gets the NodeReader associated with the given file format.

Parameters:
nodePath - the file format of the node currently read
Returns:
the NodeReader for the given file format

addNodeReaderForPath

void addNodeReaderForPath(NodeReader<?> readerToAdd,
                          String nodePath)
Associates the given NodeReader to the provided node absolute path in the XML file.

Parameters:
readerToAdd - the NodeReader to add
nodePath - the absolute path of the node in the XML file

removeReaderForPath

void removeReaderForPath(String nodePath)
Removes the association between the given node path and its NodeReader.

Parameters:
nodePath - the absolute node path in the XML file


Copyright © 2010-2013 Artenum. All Rights Reserved.