thredds.catalog.parser.jdom
Class InvCatalogFactory6

java.lang.Object
  extended by thredds.catalog.parser.jdom.InvCatalogFactory6
All Implemented Interfaces:
InvCatalogConvertIF, MetadataConverterIF

public class InvCatalogFactory6
extends java.lang.Object
implements InvCatalogConvertIF, MetadataConverterIF

Inventory Catalog Factory, version 6. Reads InvCatalog.xml files, constructs object representation.

Version:
$Id: InvCatalogFactory6.java 48 2006-07-12 16:15:40Z caron $
Author:
John Caron

Constructor Summary
InvCatalogFactory6()
           
 
Method Summary
 void addMetadataContent(org.jdom.Element mdataElement, java.lang.Object contentObject)
          Serialize the InvMetadata content object to a org.jdom.Element and add ro the element.
 org.jdom.Document makeCatalog(InvCatalogImpl cat)
           
 InvCatalogImpl parseXML(InvCatalogFactory fac, org.jdom.Document jdomDoc, java.net.URI uri)
          Create an InvCatalogImpl from a parsed document tree.
protected  InvAccessImpl readAccess(InvDatasetImpl dataset, org.jdom.Element accessElem)
           
protected  InvCatalogImpl readCatalog(org.jdom.Element catalogElem, java.net.URI baseURI)
           
protected  InvCatalogRef readCatalogRef(InvDatasetImpl parent, org.jdom.Element catRefElem)
           
protected  InvDatasetImpl readDataset(InvCatalogImpl catalog, InvDatasetImpl parent, org.jdom.Element dsElem, java.net.URI base)
           
protected  InvDocumentation readDocumentation(InvCatalog catalog, org.jdom.Element s)
           
protected  InvMetadata readMetadata(InvCatalog catalog, InvDatasetImpl dataset, org.jdom.Element mdataElement)
           
 java.lang.Object readMetadataContent(InvDataset dataset, org.jdom.Element mdataElement)
          Create an InvMetadata content object from an org.jdom.Element.
 java.lang.Object readMetadataContentFromURL(InvDataset dataset, java.lang.String urlString)
           
 java.lang.Object readMetadataContentFromURL(InvDataset dataset, java.net.URI uri)
          Create an InvMetadata content object from an XML document at a named URL.
protected  InvProperty readProperty(org.jdom.Element s)
           
protected  InvService readService(org.jdom.Element s, java.net.URI baseURI)
           
 void registerMetadataConverter(MetadataType type, MetadataConverterIF converter)
           
 boolean validateMetadataContent(java.lang.Object contentObject, java.lang.StringBuffer out)
          Validate internal data structures.
 void writeXML(InvCatalogImpl catalog, java.io.OutputStream os)
          Write the catalog as an XML document to the specified stream.
 void writeXML(InvCatalogImpl catalog, java.io.OutputStream os, boolean raw)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InvCatalogFactory6

public InvCatalogFactory6()
Method Detail

parseXML

public InvCatalogImpl parseXML(InvCatalogFactory fac,
                               org.jdom.Document jdomDoc,
                               java.net.URI uri)
Description copied from interface: InvCatalogConvertIF
Create an InvCatalogImpl from a parsed document tree.

Specified by:
parseXML in interface InvCatalogConvertIF
jdomDoc - : a parsed document tree.
uri - : the URI for the document.
Returns:
an InvCatalog object

registerMetadataConverter

public void registerMetadataConverter(MetadataType type,
                                      MetadataConverterIF converter)

readAccess

protected InvAccessImpl readAccess(InvDatasetImpl dataset,
                                   org.jdom.Element accessElem)

readCatalog

protected InvCatalogImpl readCatalog(org.jdom.Element catalogElem,
                                     java.net.URI baseURI)

readCatalogRef

protected InvCatalogRef readCatalogRef(InvDatasetImpl parent,
                                       org.jdom.Element catRefElem)

readDataset

protected InvDatasetImpl readDataset(InvCatalogImpl catalog,
                                     InvDatasetImpl parent,
                                     org.jdom.Element dsElem,
                                     java.net.URI base)

readDocumentation

protected InvDocumentation readDocumentation(InvCatalog catalog,
                                             org.jdom.Element s)

readMetadata

protected InvMetadata readMetadata(InvCatalog catalog,
                                   InvDatasetImpl dataset,
                                   org.jdom.Element mdataElement)

readMetadataContentFromURL

public java.lang.Object readMetadataContentFromURL(InvDataset dataset,
                                                   java.lang.String urlString)

readMetadataContent

public java.lang.Object readMetadataContent(InvDataset dataset,
                                            org.jdom.Element mdataElement)
Description copied from interface: MetadataConverterIF
Create an InvMetadata content object from an org.jdom.Element.

Specified by:
readMetadataContent in interface MetadataConverterIF
Parameters:
dataset - : the containing dataset
mdataElement - : the element
Returns:
an object representing the metadata content. The type depends on the metadata handler.

addMetadataContent

public void addMetadataContent(org.jdom.Element mdataElement,
                               java.lang.Object contentObject)
Description copied from interface: MetadataConverterIF
Serialize the InvMetadata content object to a org.jdom.Element and add ro the element.

Specified by:
addMetadataContent in interface MetadataConverterIF
Parameters:
mdataElement - : the org.w3c.dom.Element to add to
contentObject - : the InvMetadata content object

validateMetadataContent

public boolean validateMetadataContent(java.lang.Object contentObject,
                                       java.lang.StringBuffer out)
Description copied from interface: MetadataConverterIF
Validate internal data structures.

Specified by:
validateMetadataContent in interface MetadataConverterIF
Parameters:
contentObject - : the content object
out - : print errors here
Returns:
true if no fatal validation errors.

readMetadataContentFromURL

public java.lang.Object readMetadataContentFromURL(InvDataset dataset,
                                                   java.net.URI uri)
                                            throws java.io.IOException
Description copied from interface: MetadataConverterIF
Create an InvMetadata content object from an XML document at a named URL.

Specified by:
readMetadataContentFromURL in interface MetadataConverterIF
Parameters:
dataset - : the containing dataset
uri - : the URI that the XML doc is at.
Returns:
an object representing the metadata content. The type depends on the metadata handler.
Throws:
java.io.IOException

readProperty

protected InvProperty readProperty(org.jdom.Element s)

readService

protected InvService readService(org.jdom.Element s,
                                 java.net.URI baseURI)

writeXML

public void writeXML(InvCatalogImpl catalog,
                     java.io.OutputStream os,
                     boolean raw)
              throws java.io.IOException
Specified by:
writeXML in interface InvCatalogConvertIF
Throws:
java.io.IOException

writeXML

public void writeXML(InvCatalogImpl catalog,
                     java.io.OutputStream os)
              throws java.io.IOException
Write the catalog as an XML document to the specified stream.

Specified by:
writeXML in interface InvCatalogConvertIF
Parameters:
catalog - write this catalog
os - write to this OutputStream
Throws:
java.io.IOException

makeCatalog

public org.jdom.Document makeCatalog(InvCatalogImpl cat)