gov.noaa.eds.xapi.generic
Class GenericXmlNodeResource

java.lang.Object
  extended bygov.noaa.eds.xapi.generic.GenericConfigurable
      extended bygov.noaa.eds.xapi.generic.GenericResource
          extended bygov.noaa.eds.xapi.generic.GenericXmlNodeResource
All Implemented Interfaces:
org.xmldb.api.base.Configurable, org.xmldb.api.base.Resource, org.xmldb.api.modules.XMLResource

public class GenericXmlNodeResource
extends GenericResource
implements org.xmldb.api.modules.XMLResource

A generic implementation of an XMLResource in which the only copy of the resource is in memory.

Version:
$Id: GenericXmlNodeResource.java,v 1.2 2004/12/23 23:39:01 mrxtravis Exp $
Author:
tns

Field Summary
 
Fields inherited from class gov.noaa.eds.xapi.generic.GenericConfigurable
properties
 
Fields inherited from interface org.xmldb.api.modules.XMLResource
RESOURCE_TYPE
 
Constructor Summary
GenericXmlNodeResource(org.w3c.dom.Node root)
          Creates a new instance of GenericNodeXmlResource
 
Method Summary
 java.lang.Object getContent()
          Returns the Node object
 org.w3c.dom.Node getContentAsDOM()
          Returns the contents of this resource as a DOM node
 void getContentAsSAX(org.xml.sax.ContentHandler contentHandler)
          Throws an XMLDBException with ErrorCodes.NOT_IMPLEMENTED.
 java.lang.String getDocumentId()
          Returns the ID of this resource
 java.lang.String getResourceType()
          Returns 'XMLResource'
 boolean getSAXFeature(java.lang.String str)
          Throws UnsupportedOperationException
 void setContent(java.lang.Object obj)
          Sets the content if the obj type is a Node
 void setContentAsDOM(org.w3c.dom.Node node)
          Sets this resource to be the specified node
 org.xml.sax.ContentHandler setContentAsSAX()
          Throws unsupppored exception
 void setSAXFeature(java.lang.String str, boolean param)
          Throws Unsupported Exception
 
Methods inherited from class gov.noaa.eds.xapi.generic.GenericResource
getId, getParentCollection, setId
 
Methods inherited from class gov.noaa.eds.xapi.generic.GenericConfigurable
getProperty, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xmldb.api.base.Resource
getId, getParentCollection
 

Constructor Detail

GenericXmlNodeResource

public GenericXmlNodeResource(org.w3c.dom.Node root)
Creates a new instance of GenericNodeXmlResource

Parameters:
root - The node root this resource wraps.
Method Detail

getSAXFeature

public boolean getSAXFeature(java.lang.String str)
                      throws org.xml.sax.SAXNotRecognizedException,
                             org.xml.sax.SAXNotSupportedException
Throws UnsupportedOperationException

Specified by:
getSAXFeature in interface org.xmldb.api.modules.XMLResource
Throws:
org.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException

getResourceType

public java.lang.String getResourceType()
Returns 'XMLResource'

Specified by:
getResourceType in interface org.xmldb.api.base.Resource
Returns:
'XMLResource

setContentAsDOM

public void setContentAsDOM(org.w3c.dom.Node node)
                     throws org.xmldb.api.base.XMLDBException
Sets this resource to be the specified node

Specified by:
setContentAsDOM in interface org.xmldb.api.modules.XMLResource
Parameters:
node - The replacement node
Throws:
org.xmldb.api.base.XMLDBException

getContentAsSAX

public void getContentAsSAX(org.xml.sax.ContentHandler contentHandler)
                     throws org.xmldb.api.base.XMLDBException
Throws an XMLDBException with ErrorCodes.NOT_IMPLEMENTED.

Specified by:
getContentAsSAX in interface org.xmldb.api.modules.XMLResource
Throws:
org.xmldb.api.base.XMLDBException

setSAXFeature

public void setSAXFeature(java.lang.String str,
                          boolean param)
                   throws org.xml.sax.SAXNotRecognizedException,
                          org.xml.sax.SAXNotSupportedException
Throws Unsupported Exception

Specified by:
setSAXFeature in interface org.xmldb.api.modules.XMLResource
Throws:
org.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException

setContentAsSAX

public org.xml.sax.ContentHandler setContentAsSAX()
                                           throws org.xmldb.api.base.XMLDBException
Throws unsupppored exception

Specified by:
setContentAsSAX in interface org.xmldb.api.modules.XMLResource
Throws:
org.xmldb.api.base.XMLDBException

getDocumentId

public java.lang.String getDocumentId()
                               throws org.xmldb.api.base.XMLDBException
Returns the ID of this resource

Specified by:
getDocumentId in interface org.xmldb.api.modules.XMLResource
Returns:
the id
Throws:
org.xmldb.api.base.XMLDBException

getContentAsDOM

public org.w3c.dom.Node getContentAsDOM()
Returns the contents of this resource as a DOM node

Specified by:
getContentAsDOM in interface org.xmldb.api.modules.XMLResource
Returns:
the node representation of this resource

setContent

public void setContent(java.lang.Object obj)
                throws org.xmldb.api.base.XMLDBException
Sets the content if the obj type is a Node

Specified by:
setContent in interface org.xmldb.api.base.Resource
Throws:
org.xmldb.api.base.XMLDBException

getContent

public java.lang.Object getContent()
Returns the Node object

Specified by:
getContent in interface org.xmldb.api.base.Resource


Copyright © 2004 National Oceanic and Atmospheric Administration > National Geophysical Data Center > Enterprise Data Services Division. All Rights Reserved.