| java.lang.Object org.ozoneDB.xml.cli.resources.XMLResourceImpl
XMLResourceImpl | public class XMLResourceImpl implements XMLResource(Code) | | This is a database persistent XML class for XML:DB, possible of
returning XML content back as DOM, SAX or String. Performance is
best using DOM. Please note that getContent() is overridden to
return a String back and can always be cast to a String.
author: SMB, Per Nyfelt version: $Revision: 1.1 $ |
Method Summary | |
public Object | getContent() | public Node | getContentAsDOM() Returns the content of the Resource as a DOM Node. | public void | getContentAsSAX(ContentHandler handler) Allows you to use a ContentHandler to parse the XML data from
the database for use in an application.
Parameters: handler - the SAX ContentHandler to use to handle theResource content. | public String | getId() Returns the unique id for this Resource or null if the resource has
not yet been given one. | public Collection | getParentCollection() Returns the Collection instance that this resource is
associated with.
the collection associated with the resource. | public String | getResourceType() Returns the resource type for this Resource. | public void | setContent(Object value) Sets the content of the Resource using a either a
String or a DOM Node as the source. | public void | setContentAsDOM(Node content) Sets the content of the Resource using a DOM Node as the
source. | public ContentHandler | setContentAsSAX() Sets the content of the Resource using a SAX
ContentHandler . |
getContent | public Object getContent() throws XMLDBException(Code) | | Returns a String representation of the XML content
usage exampel :
String content = (String)xmlResource.getContent();
a String representation of the XML content |
getContentAsDOM | public Node getContentAsDOM() throws XMLDBException(Code) | | Returns the content of the Resource as a DOM Node.
The XML content as a DOM Node |
getContentAsSAX | public void getContentAsSAX(ContentHandler handler) throws XMLDBException(Code) | | Allows you to use a ContentHandler to parse the XML data from
the database for use in an application.
Parameters: handler - the SAX ContentHandler to use to handle theResource content. |
getId | public String getId() throws XMLDBException(Code) | | Returns the unique id for this Resource or null if the resource has
not yet been given one.
the id for the Resource or null if no id exists. |
getParentCollection | public Collection getParentCollection() throws XMLDBException(Code) | | Returns the Collection instance that this resource is
associated with.
the collection associated with the resource. |
getResourceType | public String getResourceType() throws XMLDBException(Code) | | Returns the resource type for this Resource.
the resource type for the Resource. |
setContent | public void setContent(Object value) throws XMLDBException(Code) | | Sets the content of the Resource using a either a
String or a DOM Node as the source.
Parameters: content - The new content value |
setContentAsDOM | public void setContentAsDOM(Node content) throws XMLDBException(Code) | | Sets the content of the Resource using a DOM Node as the
source.
Parameters: content - The new content value |
setContentAsSAX | public ContentHandler setContentAsSAX() throws XMLDBException(Code) | | Sets the content of the Resource using a SAX
ContentHandler .
a SAX ContentHandler that can be used to add contentinto the Resource . |
|
|