org.xmldb.api.sdk
Class SimpleResourceSet
java.lang.Object
org.xmldb.api.sdk.SimpleResourceSet
- ResourceSet
public abstract class SimpleResourceSet
extends java.lang.Object
Provides a base ResourceSet implementation that utilizes a synchronized list
to contain the set of resources.
RESOURCE_SET_NS
public static final String RESOURCE_SET_NS
resources
protected List resources
SimpleResourceSet
public SimpleResourceSet()
buildMembersAsResourceDocument
public Document buildMembersAsResourceDocument()
throws XMLDBException
Turns the List into the proper XML format to implement
getMembersAsResource. This is a helper method to make implementing
getMembersAsResource easier. The result is a DOM document that should be
converted into a proper XMLResource implementation by the implementing
driver.
getMembersAsResource
public Resource getMembersAsResource()
throws XMLDBException
Returns a Resource containing an XML representation of all resources
stored in the set.
TODO: Specify the schema used for this
- getMembersAsResource in interface ResourceSet
- A
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.
getResource
public Resource getResource(long index)
throws XMLDBException
Returns the
Resource
instance stored at the index specified
by
index
.
- getResource in interface ResourceSet
index
- the index of the resource to retrieve.
getSize
public long getSize()
throws XMLDBException
Returns the number of resources contained in the set.
- getSize in interface ResourceSet
- the number of
Resource
instances in the set.
removeResource
public void removeResource(long index)
throws XMLDBException
Removes the Resource
located at index
from the
set.
- removeResource in interface ResourceSet
index
- The index of the Resource
instance to remove.