org.xmldb.api.sdk
public abstract class SimpleResourceSet extends java.lang.Object implements ResourceSet
Modifier and Type | Field and Description |
---|---|
protected Collection |
collection |
static java.lang.String |
RESOURCE_SET_NS |
protected java.util.List |
resources |
Constructor and Description |
---|
SimpleResourceSet() |
Modifier and Type | Method and Description |
---|---|
void |
addResource(Resource res)
Adds a
Resource instance to the set. |
org.w3c.dom.Document |
buildMembersAsResourceDocument()
Turns the List into the proper XML format to implement
getMembersAsResource.
|
void |
clear()
Removes all
Resource instances from the set. |
ResourceIterator |
getIterator()
Returns an iterator over all
Resource instances stored in
the set. |
Resource |
getMembersAsResource()
Returns a Resource containing an XML representation of all resources
stored in the set.
|
Resource |
getResource(long index)
Returns the
Resource instance stored at the index specified
by index . |
long |
getSize()
Returns the number of resources contained in the set.
|
void |
removeResource(long index)
Removes the
Resource located at index from the
set. |
public static final java.lang.String RESOURCE_SET_NS
protected java.util.List resources
protected Collection collection
public ResourceIterator getIterator() throws XMLDBException
Resource
instances stored in
the set.getIterator
in interface ResourceSet
Resource
instances in the
set.XMLDBException
public Resource getResource(long index) throws XMLDBException
Resource
instance stored at the index specified
by index
.getResource
in interface ResourceSet
index
- the index of the resource to retrieve.Resource
instance.XMLDBException
public long getSize() throws XMLDBException
getSize
in interface ResourceSet
Resource
instances in the set.XMLDBException
public void addResource(Resource res) throws XMLDBException
Resource
instance to the set.addResource
in interface ResourceSet
res
- The Resource
to add to the set.XMLDBException
public void clear() throws XMLDBException
Resource
instances from the set.clear
in interface ResourceSet
XMLDBException
public void removeResource(long index) throws XMLDBException
Resource
located at index
from the
set.removeResource
in interface ResourceSet
index
- The index of the Resource
instance to remove.XMLDBException
public Resource getMembersAsResource() throws XMLDBException
getMembersAsResource
in interface ResourceSet
Resource
instance containing an XML representation
of all set members.XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.public org.w3c.dom.Document buildMembersAsResourceDocument() throws XMLDBException
XMLDBException