|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exist.xmldb.RemoteXMLResource
Field Summary | |
protected java.lang.String |
content
|
protected java.lang.String |
documentName
|
protected java.lang.String |
encoding
|
protected java.io.File |
file
|
protected int |
handle
|
protected java.lang.String |
id
|
protected int |
indent
|
protected RemoteCollection |
parent
|
protected java.lang.String |
path
|
protected Permission |
permissions
|
protected int |
pos
|
protected boolean |
saxDocEvents
|
Fields inherited from interface org.xmldb.api.modules.XMLResource |
RESOURCE_TYPE |
Constructor Summary | |
RemoteXMLResource(RemoteCollection parent,
int handle,
int pos,
java.lang.String docId,
java.lang.String id,
int indent,
java.lang.String encoding)
|
|
RemoteXMLResource(RemoteCollection parent,
java.lang.String docId,
java.lang.String id)
|
Method Summary | |
java.lang.Object |
getContent()
Retrieves the content from the resource. |
org.w3c.dom.Node |
getContentAsDOM()
Returns the content of the Resource as a DOM Node. |
void |
getContentAsSAX(org.xml.sax.ContentHandler handler)
Allows you to use a ContentHandler to parse the XML data from
the database for use in an application. |
java.util.Date |
getCreationTime()
|
protected byte[] |
getData()
Force content to be loaded into mem |
java.lang.String |
getDocumentId()
Returns the unique id for the parent document to this Resource
or null if the Resource does not have a parent document. |
java.lang.String |
getId()
Returns the unique id for this Resource or null if the
Resource is anonymous. |
java.util.Date |
getLastModificationTime()
|
Collection |
getParentCollection()
Returns the Collection instance that this resource is
associated with. |
Permission |
getPermissions()
|
java.lang.String |
getResourceType()
Returns the resource type for this Resource. |
boolean |
getSAXFeature(java.lang.String arg0)
Returns current setting of a SAX feature that will be used when this XMLResource is used to produce SAX events (through the
getContentAsSAX() method) |
void |
setCocoonParser(org.apache.cocoon.components.parser.Parser parser)
Sets the cocoonParser to be used. |
void |
setContent(java.lang.Object value)
Sets the content for this resource. |
void |
setContentAsDOM(org.w3c.dom.Node root)
Sets the content of the Resource using a DOM Node as the
source. |
org.xml.sax.ContentHandler |
setContentAsSAX()
Sets the content of the Resource using a SAX
ContentHandler . |
protected void |
setEncoding(java.lang.String encoding)
|
void |
setPermissions(Permission perms)
|
protected void |
setSAXDocEvents(boolean generate)
|
void |
setSAXFeature(java.lang.String arg0,
boolean arg1)
Sets a SAX feature that will be used when this XMLResource
is used to produce SAX events (through the getContentAsSAX() method) |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.String encoding
protected java.lang.String id
protected java.lang.String documentName
protected java.lang.String path
protected int indent
protected int handle
protected int pos
protected RemoteCollection parent
protected boolean saxDocEvents
protected java.lang.String content
protected java.io.File file
protected Permission permissions
Constructor Detail |
public RemoteXMLResource(RemoteCollection parent, java.lang.String docId, java.lang.String id) throws XMLDBException
public RemoteXMLResource(RemoteCollection parent, int handle, int pos, java.lang.String docId, java.lang.String id, int indent, java.lang.String encoding) throws XMLDBException
Method Detail |
public java.util.Date getCreationTime() throws XMLDBException
getCreationTime
in interface XMLResourceImpl
XMLDBException
public java.util.Date getLastModificationTime() throws XMLDBException
getLastModificationTime
in interface XMLResourceImpl
XMLDBException
public java.lang.Object getContent() throws XMLDBException
Resource
getContent
in interface Resource
XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.public org.w3c.dom.Node getContentAsDOM() throws XMLDBException
XMLResource
Resource
as a DOM Node.
getContentAsDOM
in interface XMLResource
Node
XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.public void getContentAsSAX(org.xml.sax.ContentHandler handler) throws XMLDBException
XMLResource
ContentHandler
to parse the XML data from
the database for use in an application.
getContentAsSAX
in interface XMLResource
handler
- the SAX ContentHandler
to use to handle the
Resource
content.
XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.ErrorCodes.INVALID_RESOURCE
if the
ContentHandler
provided is null.public java.lang.String getDocumentId() throws XMLDBException
XMLResource
Resource
or null if the Resource
does not have a parent document.
getDocumentId()
is typically used with Resource
instances retrieved using a query. It enables accessing the parent
document of the Resource
even if the Resource
is
a child node of the document. If the Resource
was not
obtained through a query then getId()
and
getDocumentId()
will return the same id.
getDocumentId
in interface XMLResource
Resource
or
null if there is no parent document for this Resource
.
XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.public java.lang.String getId() throws XMLDBException
Resource
Resource
or null if the
Resource
is anonymous. The Resource
will be
anonymous if it is obtained as the result of a query.
getId
in interface Resource
XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.public Collection getParentCollection() throws XMLDBException
Resource
Collection
instance that this resource is
associated with. All resources must exist within the context of a
collection
.
getParentCollection
in interface Resource
XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.public java.lang.String getResourceType() throws XMLDBException
Resource
getResourceType
in interface Resource
XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.public void setCocoonParser(org.apache.cocoon.components.parser.Parser parser)
parser
- The new cocoonParser valuepublic void setContent(java.lang.Object value) throws XMLDBException
Resource
setContent
in interface Resource
value
- the content value to set for the resource.
XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.public void setContentAsDOM(org.w3c.dom.Node root) throws XMLDBException
XMLResource
Resource
using a DOM Node as the
source.
setContentAsDOM
in interface XMLResource
root
- The new content value
XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.ErrorCodes.INVALID_RESOURCE
if the content value provided is
null.ErrorCodes.WRONG_CONTENT_TYPE
if the content provided in not
a valid DOM Node
.public org.xml.sax.ContentHandler setContentAsSAX() throws XMLDBException
XMLResource
Resource
using a SAX
ContentHandler
.
setContentAsSAX
in interface XMLResource
ContentHandler
that can be used to add content
into the Resource
.
XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.protected void setEncoding(java.lang.String encoding)
protected void setSAXDocEvents(boolean generate)
public boolean getSAXFeature(java.lang.String arg0) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException
XMLResource
XMLResource
is used to produce SAX events (through the
getContentAsSAX() method)
getSAXFeature
in interface XMLResource
arg0
- Feature name. Standard SAX feature names are documented at
http://sax.sourceforge.net/.
org.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException
public void setSAXFeature(java.lang.String arg0, boolean arg1) throws org.xml.sax.SAXNotRecognizedException, org.xml.sax.SAXNotSupportedException
XMLResource
XMLResource
is used to produce SAX events (through the getContentAsSAX() method)
setSAXFeature
in interface XMLResource
arg0
- Feature name. Standard SAX feature names are documented at
http://sax.sourceforge.net/.arg1
- Set or unset feature
org.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException
protected byte[] getData() throws XMLDBException
XMLDBException
public void setPermissions(Permission perms)
public Permission getPermissions()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |