|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface XNodeCollection
XNodeCollection is a simple interface for a collection of XNodes, with methods also supporting a hierarchy of XNodeCollections.
The XNode API (the package org.purl.xnode.*, both its source code and documentation), are released under the Apache 2.0 License. For more details, check the LICENSE file contained with the distribution, or see The Ceryle Project for more information. It is distributed with no warranty.
It shares an isomorphism with most of the XNode API methods, since this is generally meant to be implemented as a class that extends the XNode API, using the XNode to store the collection-level metadata, as XNodeCollection then becomes a registry API. The methods classed as "XNode methods" are meant to return the values of their like-named XNode methods.
| Field Summary | |
|---|---|
static String |
ROOT_ID
The String constant used as the ID/name of the root Collection. |
| Method Summary | |
|---|---|
boolean |
addCollection(XNodeCollection collection)
Add a child XNodeCollection collection to this XNodeCollection. |
boolean |
addXNode(XNode xnode,
boolean overwrite)
Adds the XNode xnode to this XNodeCollection. |
boolean |
close()
Close the underlying database containing this XNodeCollection's data. |
XNodeCollection |
getCollection(String cid)
Return a child XNodeCollection of this XNodeCollection, or null if unavailable. |
List |
getCollectionIndex()
Returns a List containing the IDs of child XNodeCollections. |
Node |
getContent()
Return a DOM Node containing this XNodeCollection's embedded content (exclusive of the XNode envelope), null if not set. |
String |
getCreated()
Return the creation date of this XNodeCollection as a String. |
String |
getID()
Return the ID of this XNodeCollection as a String. |
List |
getIndex()
Returns a List containing this XNodeCollection's index of XNode IDs. |
int |
getIndexCount()
Returns the number of XNodes in this XNodeCollection. |
String |
getModified()
Return the modification date of this XNode as a String. |
XNodeCollection |
getParentCollection()
Return the parent XNodeCollection of this XNodeCollection, or null if no parent XNodeCollection exists. |
Set |
getProperties()
Return a Set containing all named properties of this XNodeCollection, null if none have been set. |
Object |
getProperty(String name)
Return the named property name as an Object, null if it has not been set. |
XNode |
getXNode(String nid)
Retrieves the XNode with ID nid from this XNodeCollection, returning null if it does not exist. |
boolean |
hasCollection(String cid)
Returns true if a child XNodeCollection with ID cid exists as a child XNodeCollection of this XNodeCollection, false otherwise. |
boolean |
hasXNode(String nid)
Returns true if the XNode ID nid exists as a key in this XNodeCollection. |
boolean |
removeCollection(String cid)
Remove a child XNodeCollection with ID cid from this XNodeCollection. |
boolean |
removeXNode(String nid)
Removes the XNode with ID nid from this XNodeCollection. |
void |
setCreated(String timestamp)
Set the creation date of this XNodeCollection to the String timestamp. |
void |
setID(String cid)
Set the ID of this XNodeCollection to the String cid. |
void |
setModified(String timestamp)
Set the modification date of this XNodeCollection to the String timestamp. |
void |
setProperty(String name,
Object value)
Set the named property name to the Object value. |
String |
toString()
Return a String representation of this XNodeCollection. |
| Field Detail |
|---|
static final String ROOT_ID
| Method Detail |
|---|
void setID(String cid)
throws XNodeException
cid - the XNodeCollection ID.
XNodeException - if already set, or is not an XML Name.String getID()
void setCreated(String timestamp)
throws XNodeException
timestamp - the creation timestamp as a String.
XNodeException - if already set.String getCreated()
void setModified(String timestamp)
throws XNodeException
timestamp - the modification timestamp as a String.
XNodeException - if an error occurs (such as the timestamp
being in an unrecognizable format).String getModified()
See Note.
void setProperty(String name,
Object value)
throws XNodeException,
NullPointerException
The provided value must be a String or a DOM Node, otherwise an XNodeException is thrown.
name - the property name.value - the property value, a String or DOM Node.
XNodeException - if the property value is invalid.
NullPointerException - if either name or value parameter is null.
Object getProperty(String name)
throws NullPointerException
Modified from XNode 1.0
name - the property name.
NullPointerException - if the name parameter is null.Set getProperties()
Node getContent()
throws XNodeException
XNodeException
List getCollectionIndex()
throws XNodeException
XNodeException - if an error occurs while indexing the root XNodeCollection.XNodeCollection getParentCollection()
boolean hasCollection(String cid)
cid - the ID of the child XNodeCollection.
XNodeCollection getCollection(String cid)
throws XNodeException
cid - the ID of the child XNodeCollection.
XNodeException - if an error occurs while getting the XNodeCollection.
boolean addCollection(XNodeCollection collection)
throws XNodeException
collection - the XNodeCollection to be added.
XNodeException - if an error occurs while adding the XNodeCollection.
boolean removeCollection(String cid)
throws XNodeException
cid - the ID of the XNodeCollection to be removed.
XNodeException - if an error occurs during removal of the XNodeCollection.
List getIndex()
throws XNodeException
XNodeException - if an error occurs obtaining the index.
int getIndexCount()
throws XNodeException
XNodeException - if an error occurs obtaining the index.
boolean addXNode(XNode xnode,
boolean overwrite)
throws XNodeException
xnode - the XNode to add to the XNodeCollection.
XNodeException - if the XNode could not be written, or if a matching
XNode ID exists and overwrite is false.
boolean hasXNode(String nid)
throws XNodeException
nid - the ID of the XNode to be queried.
XNodeException - if an error occurs during retrieval.
XNode getXNode(String nid)
throws XNodeException
nid - the ID of the XNode to be retrieved.
XNodeException - if an error occurs during retrieval.
boolean removeXNode(String nid)
throws XNodeException
nid - the ID of the XNode to remove from the XNodeCollection.
XNodeException - if the String is not a valid ID.
boolean close()
throws XNodeException
XNodeException - if an error occurs during closing of the Database.String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||