disciple.core
Class DefaultRepository

java.lang.Object
  |
  +--disciple.core.Repository
        |
        +--disciple.core.DefaultRepository
All Implemented Interfaces:
Service

public class DefaultRepository
extends Repository


Field Summary
 
Fields inherited from class disciple.core.Repository
controller_
 
Constructor Summary
DefaultRepository()
           
 
Method Summary
 void addAttributeListener(AttributeListener listener)
          Adds an attributer listener to listen for changes to all attributes of all nodes.
 void addAttributeListener(org.w3c.dom.Element node, AttributeListener listener)
          Adds an attributer listener to listen for changes to all attributes of only one specific node.
 void addDocumentListener(DocumentListener listener)
           
 void addElementListener(ElementListener listener)
           
 void addNode(Path path, org.w3c.dom.Node node)
          Adds an element as a child of the node pointed by path
 org.w3c.dom.Document getDocument(java.lang.String name)
          Gets a document from the repository
 java.util.Hashtable getDocuments()
          Gets all documents from the repository
 org.w3c.dom.Node getNode(Path path)
          Returns the element pointed by path
 boolean isEmpty()
           
 int numOfDocs()
           
 void removeAttribute(Path path, java.lang.String attribute)
          Removes an attribute from the element pointed by path
 void removeAttributeListener(AttributeListener listener)
           
 void removeAttributeListener(org.w3c.dom.Element model, AttributeListener listener)
           
 void removeDocument(java.lang.String name)
          Removes a document from the repository
 void removeDocumentListener(DocumentListener listener)
           
 void removeElementListener(ElementListener listener)
           
 void removeNode(org.w3c.dom.Node node)
          Removes an element from the repository
 void setAttribute(Path path, java.lang.String attribute, java.lang.String value)
          Sets an attribute to the element pointed by path
 void setDocument(java.lang.String name, org.w3c.dom.Document document)
           
 void setNodeValue(org.w3c.dom.Node node, java.lang.String value)
          Sets the node value of the given node
 void setNodeValue(Path path, java.lang.String value)
          Sets the node value of the element pointed by path
 
Methods inherited from class disciple.core.Repository
getController, setController
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultRepository

public DefaultRepository()
Method Detail

getDocument

public org.w3c.dom.Document getDocument(java.lang.String name)
Gets a document from the repository

Overrides:
getDocument in class Repository
Parameters:
name - of the document
Returns:
Document if a document with name exists. Otherwise, null.

getDocuments

public java.util.Hashtable getDocuments()
Gets all documents from the repository

Returns:
Hashtable Table containing all documents

setDocument

public void setDocument(java.lang.String name,
                        org.w3c.dom.Document document)
Overrides:
setDocument in class Repository
Parameters:
name - - the name of the document
document - - the document to be inserted
Rose:
3CF3F29B005C

removeDocument

public void removeDocument(java.lang.String name)
Removes a document from the repository

Overrides:
removeDocument in class Repository
Parameters:
name - - name of the document
Rose:
3CF4ED3300FD

addNode

public void addNode(Path path,
                    org.w3c.dom.Node node)
Adds an element as a child of the node pointed by path

Overrides:
addNode in class Repository
Parameters:
path - - path pointing to the element

removeNode

public void removeNode(org.w3c.dom.Node node)
Removes an element from the repository

Overrides:
removeNode in class Repository

setAttribute

public void setAttribute(Path path,
                         java.lang.String attribute,
                         java.lang.String value)
Sets an attribute to the element pointed by path

Overrides:
setAttribute in class Repository
Parameters:
path - - path pointing to the element
attribute - - name of the attribute
value - - value of the attribute

removeAttribute

public void removeAttribute(Path path,
                            java.lang.String attribute)
Removes an attribute from the element pointed by path

Overrides:
removeAttribute in class Repository
Parameters:
path - - path pointing to the element
attribute - - attribute to be removed

setNodeValue

public void setNodeValue(Path path,
                         java.lang.String value)
Sets the node value of the element pointed by path

Specified by:
setNodeValue in class Repository
Parameters:
path - - path pointing to the element
value - - value of the node

setNodeValue

public void setNodeValue(org.w3c.dom.Node node,
                         java.lang.String value)
Sets the node value of the given node

Specified by:
setNodeValue in class Repository
Parameters:
node - the node
value - - value of the node

getNode

public org.w3c.dom.Node getNode(Path path)
Returns the element pointed by path

Overrides:
getNode in class Repository
Parameters:
path - - path of the element
Returns:
Element pointed by path

addDocumentListener

public void addDocumentListener(DocumentListener listener)
Overrides:
addDocumentListener in class Repository
Parameters:
listener -
Rose:
3CF4FAA400FB

addElementListener

public void addElementListener(ElementListener listener)
Overrides:
addElementListener in class Repository
Parameters:
listener -
Rose:
3CF4FABC0145

addAttributeListener

public void addAttributeListener(AttributeListener listener)
Adds an attributer listener to listen for changes to all attributes of all nodes.

Overrides:
addAttributeListener in class Repository
Parameters:
listener - the listener object

addAttributeListener

public void addAttributeListener(org.w3c.dom.Element node,
                                 AttributeListener listener)
Adds an attributer listener to listen for changes to all attributes of only one specific node.

Overrides:
addAttributeListener in class Repository
Parameters:
node - the parent node of the attributes
listener - the listener object
Rose:
3CF4FACD03A2

removeDocumentListener

public void removeDocumentListener(DocumentListener listener)
Overrides:
removeDocumentListener in class Repository
Parameters:
listener -
Rose:
3CF4FAEC02FD

removeElementListener

public void removeElementListener(ElementListener listener)
Overrides:
removeElementListener in class Repository
Parameters:
listener -
Rose:
3CF4FAFA01BC

removeAttributeListener

public void removeAttributeListener(AttributeListener listener)
Overrides:
removeAttributeListener in class Repository
Parameters:
listener -

removeAttributeListener

public void removeAttributeListener(org.w3c.dom.Element model,
                                    AttributeListener listener)
Overrides:
removeAttributeListener in class Repository
Parameters:
listener -
Rose:
3CF4FB060138

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in class Repository
Returns:
true if this repository is empty; false otherwise.

numOfDocs

public int numOfDocs()
Specified by:
numOfDocs in class Repository


Copyright (c) 2003 Rutgers, The State University of New Jersey