Package org.xmldb.api.sdk
Class SimpleResourceSet
java.lang.Object
org.xmldb.api.sdk.SimpleResourceSet
- All Implemented Interfaces:
ResourceSet
- Direct Known Subclasses:
ResourceSetImpl
Provides a base ResourceSet implementation that utilizes a synchronized list
to contain the set of resources.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAll
(ResourceSet rSet) Adds allResource
instances in the resourceSet to this set.void
addResource
(Resource res) Adds aResource
instance to the set.Turns the List into the proper XML format to implement getMembersAsResource.void
clear()
Removes allResource
instances from the set.Returns an iterator over allResource
instances stored in the set.Returns a Resource containing an XML representation of all resources stored in the set.getResource
(int index) Returns theResource
instance stored at the index specified byindex
.int
getSize()
Returns the number of resources contained in the set.void
removeResource
(int index) Removes theResource
located atindex
from the set.
-
Field Details
-
RESOURCE_SET_NS
- See Also:
-
-
Constructor Details
-
SimpleResourceSet
public SimpleResourceSet()
-
-
Method Details
-
getIterator
Returns an iterator over allResource
instances stored in the set.- Specified by:
getIterator
in interfaceResourceSet
- Returns:
- a ResourceIterator over all
Resource
instances in the set. - Throws:
XMLDBException
-
getResource
Returns theResource
instance stored at the index specified byindex
.- Specified by:
getResource
in interfaceResourceSet
- Parameters:
index
- the index of the resource to retrieve.- Returns:
- the
Resource
instance. - Throws:
XMLDBException
-
getSize
Returns the number of resources contained in the set.- Specified by:
getSize
in interfaceResourceSet
- Returns:
- the number of
Resource
instances in the set. - Throws:
XMLDBException
-
addResource
Adds aResource
instance to the set.- Specified by:
addResource
in interfaceResourceSet
- Parameters:
res
- TheResource
to add to the set.- Throws:
XMLDBException
-
addAll
Adds allResource
instances in the resourceSet to this set.- Specified by:
addAll
in interfaceResourceSet
- Parameters:
rSet
- TheResourceSet
containing all theResource
's to add to the set.- Throws:
XMLDBException
- with expected error codes.
ErrorCodes.VENDOR_ERROR
for any vendor specific errors that occur.
-
clear
Removes allResource
instances from the set.- Specified by:
clear
in interfaceResourceSet
- Throws:
XMLDBException
-
removeResource
Removes theResource
located atindex
from the set.- Specified by:
removeResource
in interfaceResourceSet
- Parameters:
index
- The index of theResource
instance to remove.- Throws:
XMLDBException
-
getMembersAsResource
Returns a Resource containing an XML representation of all resources stored in the set. TODO: Specify the schema used for this- Specified by:
getMembersAsResource
in interfaceResourceSet
- Returns:
- A
Resource
instance containing an XML representation of all set members. - Throws:
XMLDBException
- with expected error codes.
ErrorCodes.VENDOR_ERROR
for any vendor specific errors that occur.
-
buildMembersAsResourceDocument
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.- Throws:
XMLDBException
-