|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.ozoneDB.xml.util.XMLContainer
This class is the central part of the ozone/XML API. Basically it provides a persistent container for a XML document, which is stored in an ozone database.
Field Summary | |
static boolean |
debug
|
Constructor Summary | |
protected |
XMLContainer(org.ozoneDB.OzoneInterface _db,
XMLContainerHelper _helper)
|
Method Summary | |
void |
delete()
Deletes the container (and the associated document) from the database. |
protected org.infozone.tools.xml.queries.XObject |
executeXPath(OzoneXPathQuery _query)
|
protected void |
executeXUpdate(OzoneXUpdateQuery _query)
|
org.w3c.dom.Document |
extractDOM(org.w3c.dom.Document _domFactory)
|
org.w3c.dom.NodeList |
extractDOM(org.w3c.dom.Document _domFactory,
org.w3c.dom.NodeList _pNodes,
org.w3c.dom.Node _appendTo,
int _depth)
|
org.w3c.dom.Node |
extractDOM(org.w3c.dom.Document _domFactory,
org.w3c.dom.Node _pNode,
org.w3c.dom.Node _appendTo)
|
org.w3c.dom.Node |
extractDOM(org.w3c.dom.Document _domFactory,
org.w3c.dom.Node _pNode,
org.w3c.dom.Node _appendTo,
int _depth)
Extracts a given DOM node and all its descendants. |
void |
extractSAX(org.xml.sax.ContentHandler _contentHandler)
|
void |
extractSAX(org.xml.sax.ContentHandler _contentHandler,
org.w3c.dom.Node _pNode)
|
void |
extractSAX(org.xml.sax.ContentHandler _contentHandler,
org.w3c.dom.Node _pNode,
int _depth)
Extracts a given DOM node and all its descendants. |
static XMLContainer |
forName(org.ozoneDB.OzoneInterface _db,
java.lang.String _docName)
Returns the XMLContainer representing the document with the given name. |
static XMLContainer |
forNode(org.ozoneDB.OzoneInterface _db,
org.w3c.dom.Node _pNode)
Returns the XMLContainer representing the document the given node belongs to. |
org.w3c.dom.Document |
getPDocument()
Get the underlying persistent document that this container is working on. |
static XMLContainer |
newContainer(org.ozoneDB.OzoneInterface _db,
java.lang.String _docName)
Creates a new container with the given name. |
OzoneXPathQuery |
newXPathQuery()
Create a new XPath query. |
OzoneXUpdateQuery |
newXUpdateQuery()
Create a new XUpdate query. |
void |
processChunk(SAXChunkProducer _producer)
This method is for internal use only. |
void |
readExternal(java.io.ObjectInput _in)
|
void |
setName(java.lang.String _name)
Changes the name of this container. |
void |
storeDOM(org.w3c.dom.Document _tNode)
Stores a transient DOM tree database. |
void |
storeDOM(org.w3c.dom.Node _pNode,
org.w3c.dom.Node _tNode)
Stores a transient node into the database. |
org.xml.sax.ContentHandler |
storeSAX()
Stores a DOM tree represented by SAX events in the datasabase. |
org.xml.sax.ContentHandler |
storeSAX(org.w3c.dom.Node _pNode)
Stores XML represented by SAX events into the database. |
void |
writeExternal(java.io.ObjectOutput _out)
|
java.lang.String |
xpathForNode(org.w3c.dom.Node _pnode)
Determines the absolute XPath for the given node. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final boolean debug
Constructor Detail |
protected XMLContainer(org.ozoneDB.OzoneInterface _db, XMLContainerHelper _helper)
Method Detail |
public static XMLContainer newContainer(org.ozoneDB.OzoneInterface _db, java.lang.String _docName) throws java.lang.Exception
_db
- The database where the container will be stored._docName
- The name of the container (and the document).
java.lang.Exception
public static XMLContainer forName(org.ozoneDB.OzoneInterface _db, java.lang.String _docName) throws java.lang.Exception
_db
- The database where the container is stored._docName
- The name under which the container has been stored.
java.lang.Exception
public static XMLContainer forNode(org.ozoneDB.OzoneInterface _db, org.w3c.dom.Node _pNode) throws java.lang.Exception
_db
- The database where the container is stored._pNode
- A node of the document the container represents.
java.lang.Exception
public void setName(java.lang.String _name) throws java.lang.Exception
_name
- The new name of this container or null to remove the
current name.
java.lang.Exception
public void delete() throws java.lang.Exception
java.lang.Exception
public org.w3c.dom.Document getPDocument() throws java.lang.Exception
java.lang.Exception
public void storeDOM(org.w3c.dom.Document _tNode) throws java.lang.Exception
java.lang.Exception
storeDOM(Node, Node)
public void storeDOM(org.w3c.dom.Node _pNode, org.w3c.dom.Node _tNode) throws java.lang.Exception
Before calling this method the current thread must have joined an
explicit Transaction
. This is an
exception to the normal case, where an implicit transaction (handled by
Ozone) is more appropriate.
SAX method
should be used, because the performance
of SAX storage is much better.
_pNode
- The persistent node where the stored node will be appended to.
Null replaces the current document.
java.lang.IllegalStateException
- if the underlying document has already been deleted.
java.lang.IllegalArgumentException
- if _tnode was null.
java.lang.Exception
ExternalTransaction
,
ExternalDatabase.newTransaction()
public org.xml.sax.ContentHandler storeSAX() throws java.lang.Exception
java.lang.Exception
storeSAX(Node)
public org.xml.sax.ContentHandler storeSAX(org.w3c.dom.Node _pNode) throws java.lang.Exception
The entire storage process must be enclosed by an
explicit Transaction
. This is an
exception to the normal case, where an implicit transaction (handled by
Ozone) is more appropriate. The storage process starts with the call to this
method and ends with the last event send to the content handler. The SAX
events must be properly terminated, i.e. there must be an end event for
for every start event, otherwise the correct storage can't be guaranteed.
_pNode
- The persistent node where the stored data will be appended to.
java.lang.IllegalStateException
- if the underlying document has already been deleted.
java.lang.Exception
ExternalTransaction
,
ExternalDatabase.newTransaction()
public void processChunk(SAXChunkProducer _producer) throws java.lang.Exception
processChunk
in interface SAXChunkProducerDelegate
java.lang.Exception
public org.w3c.dom.Document extractDOM(org.w3c.dom.Document _domFactory) throws java.lang.Exception
java.lang.Exception
extractDOM(Document, Node, Node , int)
public org.w3c.dom.Node extractDOM(org.w3c.dom.Document _domFactory, org.w3c.dom.Node _pNode, org.w3c.dom.Node _appendTo) throws java.lang.Exception
java.lang.Exception
extractDOM(Document, Node, Node , int)
public org.w3c.dom.Node extractDOM(org.w3c.dom.Document _domFactory, org.w3c.dom.Node _pNode, org.w3c.dom.Node _appendTo, int _depth) throws java.lang.Exception
Before calling this method the current thread must have joined an
explicit Transaction
. This is an
exception to the normal case, where an implicit transaction (handled by
Ozone) is more appropriate.
SAX method
should be used, because the
performance of SAX retrieval is much better.
_domFactory
- The DOM Document that is used to create the extracted DOM nodes._pNode
- The persistent DOM node_appendTo
- The transient DOM node where the extracted content will
will be appended to._depth
- The number of hierarchy steps that should be extracted or
null if the entire hierarchy should be extracted.
java.lang.Exception
public org.w3c.dom.NodeList extractDOM(org.w3c.dom.Document _domFactory, org.w3c.dom.NodeList _pNodes, org.w3c.dom.Node _appendTo, int _depth) throws java.lang.Exception
java.lang.Exception
public void extractSAX(org.xml.sax.ContentHandler _contentHandler) throws java.lang.Exception
java.lang.Exception
extractSAX(ContentHandler, Node, int)
public void extractSAX(org.xml.sax.ContentHandler _contentHandler, org.w3c.dom.Node _pNode) throws java.lang.Exception
java.lang.Exception
extractSAX(ContentHandler, Node , int )
public void extractSAX(org.xml.sax.ContentHandler _contentHandler, org.w3c.dom.Node _pNode, int _depth) throws java.lang.Exception
Before calling this method the current thread must have joined an
explicit Transaction
. This is an
exception to the normal case, where an implicit transaction (handled by
Ozone) is more appropriate.
_contentHandler
- The ContentHandler that will receive the generated
SAX events._pNode
- The persistent DOM node that is the starting point, or null
if the entire document should be extracted._depth
- The number of hierarchy steps that should be extracted or
null if the entire hierarchy should be extracted.
java.lang.Exception
public OzoneXUpdateQuery newXUpdateQuery()
OzoneXUpdateQuery
public OzoneXPathQuery newXPathQuery()
OzoneXPathQuery
protected void executeXUpdate(OzoneXUpdateQuery _query) throws java.lang.Exception
java.lang.Exception
protected org.infozone.tools.xml.queries.XObject executeXPath(OzoneXPathQuery _query) throws java.lang.Exception
java.lang.Exception
public java.lang.String xpathForNode(org.w3c.dom.Node _pnode)
public void writeExternal(java.io.ObjectOutput _out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput _in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |