org.xmldb.api.base
public interface Resource
Resource
is a container for data stored within the database. Raw resources
are not particulary useful. It is necessary to have a resource implementation
that provides handling for a specific content type before anything useful can
be done.Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getContent()
Retrieves the content from the resource.
|
java.lang.String |
getId()
Returns the unique id for this
Resource or null if the
Resource is anonymous. |
Collection |
getParentCollection()
Returns the
Collection instance that this resource is
associated with. |
java.lang.String |
getResourceType()
Returns the resource type for this Resource.
|
void |
setContent(java.lang.Object value)
Sets the content for this resource.
|
Collection getParentCollection() throws XMLDBException
Collection
instance that this resource is
associated with. All resources must exist within the context of a
collection
.XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.java.lang.String getId() throws XMLDBException
Resource
or null if the
Resource
is anonymous. The Resource
will be
anonymous if it is obtained as the result of a query.XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.java.lang.String getResourceType() throws XMLDBException
XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.java.lang.Object getContent() throws XMLDBException
XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.void setContent(java.lang.Object value) throws XMLDBException
value
- the content value to set for the resource.XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.