Package thredds.catalog.parser.jdom
Class InvCatalogFactory10
- java.lang.Object
-
- thredds.catalog.parser.jdom.InvCatalogFactory10
-
- All Implemented Interfaces:
InvCatalogConvertIF
,MetadataConverterIF
public class InvCatalogFactory10 extends Object implements InvCatalogConvertIF, MetadataConverterIF
Inventory Catalog parser, version 1.0. Reads InvCatalog.xml files, constructs object representation.
-
-
Constructor Summary
Constructors Constructor Description InvCatalogFactory10()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMetadataContent(org.jdom2.Element mdataElement, Object contentObject)
Serialize the InvMetadata content object to a org.jdom2.Element and add ro theelement. List<PathAliasReplacement>
getDataRootLocationAliasExpanders()
protected DateType
makeDateType(String text, String format, String type)
InvCatalogImpl
parseXML(InvCatalogFactory fac, org.jdom2.Document jdomDoc, URI uri)
Create an InvCatalogImpl from a parsed document tree.protected InvAccessImpl
readAccess(InvDatasetImpl dataset, org.jdom2.Element accessElem)
protected InvCatalogImpl
readCatalog(org.jdom2.Element catalogElem, URI docBaseURI)
protected InvCatalogRef
readCatalogRef(InvCatalogImpl cat, InvDatasetImpl parent, org.jdom2.Element catRefElem, URI baseURI)
protected ThreddsMetadata.Contributor
readContributor(org.jdom2.Element elem)
protected ThreddsMetadata.Vocab
readControlledVocabulary(org.jdom2.Element elem)
protected InvDatasetImpl
readDataset(InvCatalogImpl catalog, InvDatasetImpl parent, org.jdom2.Element dsElem, URI base)
protected void
readDatasetInfo(InvCatalogImpl catalog, InvDatasetImpl dataset, org.jdom2.Element dsElem, URI base)
protected DataRootConfig
readDatasetRoot(org.jdom2.Element s)
protected InvDatasetScan
readDatasetScan(InvCatalogImpl catalog, InvDatasetImpl parent, org.jdom2.Element dsElem, URI base)
protected Map<String,ProxyDatasetHandler>
readDatasetScanAddProxies(org.jdom2.Element addProxiesElem, org.jdom2.Element addLatestElem, InvCatalogImpl catalog)
protected DatasetEnhancer
readDatasetScanAddTimeCoverage(org.jdom2.Element addTimeCovElem)
protected CrawlableDatasetLabeler
readDatasetScanIdentifier(org.jdom2.Element identifierElem)
protected CrawlableDatasetLabeler
readDatasetScanNamer(org.jdom2.Element namerElem)
protected InvDatasetScan
readDatasetScanNew(InvCatalogImpl catalog, InvDatasetImpl parent, org.jdom2.Element dsElem, URI base)
protected CrawlableDatasetSorter
readDatasetScanSorter(org.jdom2.Element sorterElem)
protected double
readDataSize(org.jdom2.Element parent)
protected DateType
readDate(org.jdom2.Element elem)
protected InvDocumentation
readDocumentation(InvCatalog cat, org.jdom2.Element s)
protected double
readDouble(org.jdom2.Element elem)
protected TimeDuration
readDuration(org.jdom2.Element elem)
protected InvDatasetImpl
readFeatureCollection(InvCatalogImpl catalog, InvDatasetImpl parent, org.jdom2.Element dsElem, URI base)
protected ThreddsMetadata.GeospatialCoverage
readGeospatialCoverage(org.jdom2.Element gcElem)
protected ThreddsMetadata.Range
readGeospatialRange(org.jdom2.Element spElem, String defUnits)
protected InvMetadata
readMetadata(InvCatalog catalog, InvDatasetImpl dataset, org.jdom2.Element mdataElement)
Object
readMetadataContent(InvDataset dataset, org.jdom2.Element mdataElement)
Create an InvMetadata content object from an org.jdom2.Element.Object
readMetadataContentFromURL(InvDataset dataset, URI uri)
Create an InvMetadata content object from an XML document at a named URL.protected InvProperty
readProperty(org.jdom2.Element s)
protected InvService
readService(org.jdom2.Element s, URI baseURI)
protected ThreddsMetadata.Source
readSource(org.jdom2.Element elem)
protected void
readThreddsMetadata(InvCatalog catalog, InvDatasetImpl dataset, org.jdom2.Element parent, ThreddsMetadata tmg)
protected DateRange
readTimeCoverage(org.jdom2.Element tElem)
protected ThreddsMetadata.Variable
readVariable(org.jdom2.Element varElem)
protected ThreddsMetadata.Variables
readVariables(InvCatalog cat, InvDataset ds, org.jdom2.Element varsElem)
void
registerMetadataConverter(MetadataType type, MetadataConverterIF converter)
void
setDataRootLocationAliasExpanders(List<PathAliasReplacement> dataRootLocAliasExpanders)
void
setVersion(String version)
static void
useBytesForDataSize(boolean b)
boolean
validateMetadataContent(Object contentObject, StringBuilder out)
Validate internal data structures.org.jdom2.Document
writeCatalog(InvCatalogImpl cat)
protected org.jdom2.Element
writeContributor(ThreddsMetadata.Contributor c)
protected org.jdom2.Element
writeDate(String name, DateType date)
org.jdom2.Element
writeGeospatialCoverage(ThreddsMetadata.GeospatialCoverage gc)
protected void
writeInheritedMetadata(org.jdom2.Element elem, ThreddsMetadata tmi)
protected org.jdom2.Element
writeSource(String elementName, ThreddsMetadata.Source p)
protected void
writeThreddsMetadata(org.jdom2.Element elem, ThreddsMetadata tmg)
protected org.jdom2.Element
writeTimeCoverage(DateRange t)
protected org.jdom2.Element
writeVariable(ThreddsMetadata.Variable v)
protected org.jdom2.Element
writeVariables(ThreddsMetadata.Variables vs)
void
writeXML(InvCatalogImpl catalog, OutputStream os)
Write the catalog as an XML document to the specified stream.void
writeXML(InvCatalogImpl catalog, OutputStream os, boolean raw)
Write the catalog as an XML document to the specified stream.
-
-
-
Method Detail
-
useBytesForDataSize
public static void useBytesForDataSize(boolean b)
-
setDataRootLocationAliasExpanders
public void setDataRootLocationAliasExpanders(List<PathAliasReplacement> dataRootLocAliasExpanders)
-
getDataRootLocationAliasExpanders
public List<PathAliasReplacement> getDataRootLocationAliasExpanders()
-
parseXML
public InvCatalogImpl parseXML(InvCatalogFactory fac, org.jdom2.Document jdomDoc, URI uri)
Description copied from interface:InvCatalogConvertIF
Create an InvCatalogImpl from a parsed document tree.- Specified by:
parseXML
in interfaceInvCatalogConvertIF
- Parameters:
fac
- use this factoryjdomDoc
- : a parsed document tree.uri
- : the URI for the document.- Returns:
- an InvCatalog object
-
registerMetadataConverter
public void registerMetadataConverter(MetadataType type, MetadataConverterIF converter)
-
setVersion
public void setVersion(String version)
-
readAccess
protected InvAccessImpl readAccess(InvDatasetImpl dataset, org.jdom2.Element accessElem)
-
readCatalog
protected InvCatalogImpl readCatalog(org.jdom2.Element catalogElem, URI docBaseURI)
-
readCatalogRef
protected InvCatalogRef readCatalogRef(InvCatalogImpl cat, InvDatasetImpl parent, org.jdom2.Element catRefElem, URI baseURI)
-
readContributor
protected ThreddsMetadata.Contributor readContributor(org.jdom2.Element elem)
-
readControlledVocabulary
protected ThreddsMetadata.Vocab readControlledVocabulary(org.jdom2.Element elem)
-
readDataset
protected InvDatasetImpl readDataset(InvCatalogImpl catalog, InvDatasetImpl parent, org.jdom2.Element dsElem, URI base)
-
readDatasetInfo
protected void readDatasetInfo(InvCatalogImpl catalog, InvDatasetImpl dataset, org.jdom2.Element dsElem, URI base)
-
readFeatureCollection
protected InvDatasetImpl readFeatureCollection(InvCatalogImpl catalog, InvDatasetImpl parent, org.jdom2.Element dsElem, URI base)
-
readDatasetScan
protected InvDatasetScan readDatasetScan(InvCatalogImpl catalog, InvDatasetImpl parent, org.jdom2.Element dsElem, URI base)
-
readDatasetScanNew
protected InvDatasetScan readDatasetScanNew(InvCatalogImpl catalog, InvDatasetImpl parent, org.jdom2.Element dsElem, URI base)
-
readDatasetScanIdentifier
protected CrawlableDatasetLabeler readDatasetScanIdentifier(org.jdom2.Element identifierElem)
-
readDatasetScanNamer
protected CrawlableDatasetLabeler readDatasetScanNamer(org.jdom2.Element namerElem)
-
readDatasetScanSorter
protected CrawlableDatasetSorter readDatasetScanSorter(org.jdom2.Element sorterElem)
-
readDatasetScanAddProxies
protected Map<String,ProxyDatasetHandler> readDatasetScanAddProxies(org.jdom2.Element addProxiesElem, org.jdom2.Element addLatestElem, InvCatalogImpl catalog)
-
readDatasetScanAddTimeCoverage
protected DatasetEnhancer readDatasetScanAddTimeCoverage(org.jdom2.Element addTimeCovElem)
-
readDatasetRoot
protected DataRootConfig readDatasetRoot(org.jdom2.Element s)
-
readDate
protected DateType readDate(org.jdom2.Element elem)
-
readDuration
protected TimeDuration readDuration(org.jdom2.Element elem)
-
readDocumentation
protected InvDocumentation readDocumentation(InvCatalog cat, org.jdom2.Element s)
-
readDouble
protected double readDouble(org.jdom2.Element elem)
-
readGeospatialCoverage
protected ThreddsMetadata.GeospatialCoverage readGeospatialCoverage(org.jdom2.Element gcElem)
-
readGeospatialRange
protected ThreddsMetadata.Range readGeospatialRange(org.jdom2.Element spElem, String defUnits)
-
readMetadata
protected InvMetadata readMetadata(InvCatalog catalog, InvDatasetImpl dataset, org.jdom2.Element mdataElement)
-
readMetadataContent
public Object readMetadataContent(InvDataset dataset, org.jdom2.Element mdataElement)
Description copied from interface:MetadataConverterIF
Create an InvMetadata content object from an org.jdom2.Element.- Specified by:
readMetadataContent
in interfaceMetadataConverterIF
- Parameters:
dataset
- : the containing datasetmdataElement
- : theelement - Returns:
- an object representing the metadata content. The type depends on the metadata handler.
-
readMetadataContentFromURL
public Object readMetadataContentFromURL(InvDataset dataset, URI uri) throws IOException
Description copied from interface:MetadataConverterIF
Create an InvMetadata content object from an XML document at a named URL.- Specified by:
readMetadataContentFromURL
in interfaceMetadataConverterIF
- Parameters:
dataset
- : the containing dataseturi
- : the URI that the XML doc is at.- Returns:
- an object representing the metadata content. The type depends on the metadata handler.
- Throws:
IOException
- on read error
-
validateMetadataContent
public boolean validateMetadataContent(Object contentObject, StringBuilder out)
Description copied from interface:MetadataConverterIF
Validate internal data structures.- Specified by:
validateMetadataContent
in interfaceMetadataConverterIF
- Parameters:
contentObject
- : the content objectout
- : print errors here- Returns:
- true if no fatal validation errors.
-
addMetadataContent
public void addMetadataContent(org.jdom2.Element mdataElement, Object contentObject)
Description copied from interface:MetadataConverterIF
Serialize the InvMetadata content object to a org.jdom2.Element and add ro theelement. - Specified by:
addMetadataContent
in interfaceMetadataConverterIF
- Parameters:
mdataElement
- : the org.w3c.dom.Element to add tocontentObject
- : the InvMetadata content object
-
readProperty
protected InvProperty readProperty(org.jdom2.Element s)
-
readSource
protected ThreddsMetadata.Source readSource(org.jdom2.Element elem)
-
readService
protected InvService readService(org.jdom2.Element s, URI baseURI)
-
readDataSize
protected double readDataSize(org.jdom2.Element parent)
-
readTimeCoverage
protected DateRange readTimeCoverage(org.jdom2.Element tElem)
-
readThreddsMetadata
protected void readThreddsMetadata(InvCatalog catalog, InvDatasetImpl dataset, org.jdom2.Element parent, ThreddsMetadata tmg)
-
readVariable
protected ThreddsMetadata.Variable readVariable(org.jdom2.Element varElem)
-
readVariables
protected ThreddsMetadata.Variables readVariables(InvCatalog cat, InvDataset ds, org.jdom2.Element varsElem)
-
writeXML
public void writeXML(InvCatalogImpl catalog, OutputStream os, boolean raw) throws IOException
Write the catalog as an XML document to the specified stream.- Specified by:
writeXML
in interfaceInvCatalogConvertIF
- Parameters:
catalog
- write this catalogos
- write to this OutputStreamraw
- write raw file if true (for server configuration)- Throws:
IOException
-
writeXML
public void writeXML(InvCatalogImpl catalog, OutputStream os) throws IOException
Write the catalog as an XML document to the specified stream.- Specified by:
writeXML
in interfaceInvCatalogConvertIF
- Parameters:
catalog
- write this catalogos
- write to this OutputStream- Throws:
IOException
-
writeCatalog
public org.jdom2.Document writeCatalog(InvCatalogImpl cat)
-
writeContributor
protected org.jdom2.Element writeContributor(ThreddsMetadata.Contributor c)
-
writeGeospatialCoverage
public org.jdom2.Element writeGeospatialCoverage(ThreddsMetadata.GeospatialCoverage gc)
-
writeSource
protected org.jdom2.Element writeSource(String elementName, ThreddsMetadata.Source p)
-
writeInheritedMetadata
protected void writeInheritedMetadata(org.jdom2.Element elem, ThreddsMetadata tmi)
-
writeThreddsMetadata
protected void writeThreddsMetadata(org.jdom2.Element elem, ThreddsMetadata tmg)
-
writeTimeCoverage
protected org.jdom2.Element writeTimeCoverage(DateRange t)
-
writeVariable
protected org.jdom2.Element writeVariable(ThreddsMetadata.Variable v)
-
writeVariables
protected org.jdom2.Element writeVariables(ThreddsMetadata.Variables vs)
-
-