16 package org.zorbaxquery.api.xqj;
18 import java.util.ArrayList;
19 import java.util.Collection;
20 import javax.xml.xquery.XQException;
21 import org.zorbaxquery.api.ItemSequence;
22 import org.zorbaxquery.api.XmlDataManager;
23 import org.zorbaxquery.api.Zorba;
34 private boolean closed =
false;
35 private XmlDataManager dm;
39 private Collection<ZorbaXQSequence> sequences =
new ArrayList<ZorbaXQSequence>();
42 dm = zorba.getXmlDataManager();
51 public void close() throws XQException {
52 if (lDocumentManager!=null) {
53 lDocumentManager.close();
55 if (lCollectionManager!=null) {
56 lCollectionManager.close();
58 if (lW3CollectionManager!=null) {
59 lW3CollectionManager.close();
81 isClosedXQException();
82 if (lDocumentManager==null) {
85 return lDocumentManager;
96 isClosedXQException();
97 if (lCollectionManager==null) {
100 return lCollectionManager;
111 isClosedXQException();
112 if (lW3CollectionManager==null) {
115 return lW3CollectionManager;
122 isClosedXQException();
123 ItemSequence zSequence =
new ItemSequence(dm.parseXMLtoItem(xmlText));
125 sequences.add(result);
129 private void isClosedXQException() throws XQException {
131 throw new XQException(
"XmlDataManager is closed");
ZorbaXQCollectionManager getCollectionManager()
Returns a CollectionManager responsible for all collections.
ZorbaXQDocumentManager getDocumentManager()
This class defines a set of functions for managing persistent collections.
void close()
Close the XmlDataManager and release all the resources associated with this item. ...
boolean isClosed()
Checks if the ZorbaXQXmlDataManager is closed.
ZorbaXQCollectionManager getW3CCollectionManager()
Returns a CollectionManager responsible for collections identified by a URI.
ZorbaXQXmlDataManager(Zorba zorba)
This interface represents a sequence of items as defined in the XDM.
ZorbaXQSequence parseXML(String xmlText)
Parse an XML document and return an ZorbaXQSequence.
Using the ZorbaXQXmlDataManager one can manage documents and collections.