16 package org.zorbaxquery.api.xqj;
18 import java.util.ArrayList;
19 import java.util.Collection;
20 import javax.xml.xquery.XQException;
21 import javax.xml.xquery.XQItem;
22 import javax.xml.xquery.XQSequence;
23 import org.zorbaxquery.api.StaticCollectionManager;
33 private boolean closed =
false;
34 private StaticCollectionManager collectionManager = null;
35 private Collection<XQSequence> sequences =
new ArrayList<XQSequence>();
36 private Collection<ZorbaXQCollection> collections =
new ArrayList<ZorbaXQCollection>();
39 collectionManager = cm;
42 public void close() throws XQException {
43 for (XQSequence exp : sequences ){
63 isClosedXQException();
65 sequences.add(result);
75 isClosedXQException();
76 collectionManager.createCollection(((org.zorbaxquery.api.xqj.ZorbaXQItem)aName).getZorbaItem());
85 isClosedXQException();
86 collectionManager.deleteCollection(((org.zorbaxquery.api.xqj.ZorbaXQItem)aName).getZorbaItem());
96 isClosedXQException();
98 collections.add(result);
111 isClosedXQException();
112 return collectionManager.isAvailableCollection( ((org.zorbaxquery.api.xqj.ZorbaXQItem)aName).getZorbaItem() );
115 private void isClosedXQException() throws XQException {
117 throw new XQException(
"CollectionManager is closed");
ZorbaXQCollection getCollection(XQItem aName)
Returns a instance of the Collection class which can be used to modify and retrieve the contents of t...
A Collection is a persistent sequence of node items.
XQSequence availableCollections()
This function returns a sequence of names of the collections that are available.
void createCollection(XQItem aName)
This function creates the collection with the given name.
Using the ZorbaXQStaticCollectionManager one can retrieve information about statically declared colle...
This interface represents a sequence of items as defined in the XDM.
ZorbaXQStaticCollectionManager(StaticCollectionManager cm)
boolean isAvailableCollection(XQItem aName)
This function returns true if a collection with the given name is available.
void deleteCollection(XQItem aName)
This function removes the collection with the given name.