Package thredds.client.catalog.builder
Class CatalogBuilder
- java.lang.Object
-
- thredds.client.catalog.builder.CatalogBuilder
-
public class CatalogBuilder extends Object
Builds client Catalogs using JDOM2 Non validating.- Since:
- 1/8/2015
-
-
Field Summary
Fields Modifier and Type Field Description protected URI
baseURI
protected List<DatasetBuilder>
datasetBuilders
protected Formatter
errlog
protected CalendarDate
expires
protected boolean
fatalError
protected String
name
protected List<Property>
properties
protected List<Service>
services
protected String
version
-
Constructor Summary
Constructors Constructor Description CatalogBuilder()
CatalogBuilder(Catalog from)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDataset(DatasetBuilder d)
void
addProperty(Property p)
void
addService(Service s)
Catalog
buildFromCatref(CatalogRef catref)
Catalog
buildFromJdom(org.jdom2.Element root, URI docBaseUri)
Catalog
buildFromLocation(String location, URI baseURI)
Catalog
buildFromStream(InputStream stream, URI docBaseUri)
Catalog
buildFromString(String catalogAsString, URI docBaseUri)
Catalog
buildFromURI(URI uri)
protected DatasetBuilder
buildOtherDataset(DatasetBuilder parent, org.jdom2.Element dsElem)
Iterable<DatasetBuilder>
getDatasets()
String
getErrorMessage()
DatasetBuilder
getTopDataset()
String
getValidationMessage()
boolean
hasFatalError()
boolean
hasService(String name)
boolean
hasServiceInDataset(String name)
Catalog
makeCatalog()
protected DateType
makeDateType(String text, String format, String type, Calendar calendar)
protected AccessBuilder
readAccess(DatasetBuilder dataset, org.jdom2.Element accessElem)
protected Calendar
readCalendar(String calendarAttribValue)
protected DatasetBuilder
readCatalogRef(DatasetBuilder parent, org.jdom2.Element catRefElem)
protected ThreddsMetadata.Contributor
readContributor(org.jdom2.Element elem)
protected ThreddsMetadata.Vocab
readControlledVocabulary(org.jdom2.Element elem)
protected DatasetBuilder
readDataset(DatasetBuilder parent, org.jdom2.Element dsElem)
protected void
readDatasetInfo(DatasetBuilder dataset, org.jdom2.Element dsElem)
protected long
readDataSize(org.jdom2.Element parent)
protected DateType
readDate(org.jdom2.Element elem, Calendar calendar)
protected Documentation
readDocumentation(org.jdom2.Element s)
protected double
readDouble(org.jdom2.Element elem)
protected TimeDuration
readDuration(org.jdom2.Element elem)
protected ThreddsMetadata.GeospatialCoverage
readGeospatialCoverage(org.jdom2.Element gcElem)
protected ThreddsMetadata.GeospatialRange
readGeospatialRange(org.jdom2.Element spElem, String defUnits)
protected ThreddsMetadata.MetadataOther
readMetadata(Map<String,Object> flds, DatasetBuilder dataset, org.jdom2.Element mdataElement)
protected Property
readProperty(org.jdom2.Element s)
protected Service
readService(org.jdom2.Element s)
protected ThreddsMetadata.Source
readSource(org.jdom2.Element elem)
protected void
readThreddsMetadataGroup(Map<String,Object> flds, DatasetBuilder dataset, org.jdom2.Element parent)
protected DateRange
readTimeCoverage(org.jdom2.Element tElem)
static ThreddsMetadata.Variable
readVariable(org.jdom2.Element varElem)
protected ThreddsMetadata.VariableGroup
readVariables(org.jdom2.Element varsElem)
void
removeAnyService()
void
setBaseURI(URI baseURI)
void
setExpires(CalendarDate expires)
protected Map<String,Object>
setFields()
void
setName(String name)
void
setVersion(String version)
-
-
-
Field Detail
-
errlog
protected Formatter errlog
-
fatalError
protected boolean fatalError
-
name
protected String name
-
version
protected String version
-
expires
protected CalendarDate expires
-
baseURI
protected URI baseURI
-
datasetBuilders
protected List<DatasetBuilder> datasetBuilders
-
-
Constructor Detail
-
CatalogBuilder
public CatalogBuilder()
-
CatalogBuilder
public CatalogBuilder(Catalog from)
-
-
Method Detail
-
buildFromCatref
public Catalog buildFromCatref(CatalogRef catref)
-
buildFromStream
public Catalog buildFromStream(InputStream stream, URI docBaseUri)
-
getErrorMessage
public String getErrorMessage()
-
getValidationMessage
public String getValidationMessage()
-
hasFatalError
public boolean hasFatalError()
-
setName
public void setName(String name)
-
setBaseURI
public void setBaseURI(URI baseURI)
-
setExpires
public void setExpires(CalendarDate expires)
-
setVersion
public void setVersion(String version)
-
addProperty
public void addProperty(Property p)
-
addService
public void addService(Service s)
-
removeAnyService
public void removeAnyService()
-
addDataset
public void addDataset(DatasetBuilder d)
-
makeCatalog
public Catalog makeCatalog()
-
getTopDataset
@Nullable public DatasetBuilder getTopDataset()
-
getDatasets
public Iterable<DatasetBuilder> getDatasets()
-
hasService
public boolean hasService(String name)
-
hasServiceInDataset
public boolean hasServiceInDataset(String name)
-
buildOtherDataset
protected DatasetBuilder buildOtherDataset(DatasetBuilder parent, org.jdom2.Element dsElem)
-
readAccess
protected AccessBuilder readAccess(DatasetBuilder dataset, org.jdom2.Element accessElem)
-
readProperty
protected Property readProperty(org.jdom2.Element s)
-
readService
protected Service readService(org.jdom2.Element s)
-
readCatalogRef
protected DatasetBuilder readCatalogRef(DatasetBuilder parent, org.jdom2.Element catRefElem)
-
readDataset
protected DatasetBuilder readDataset(DatasetBuilder parent, org.jdom2.Element dsElem)
-
readDatasetInfo
protected void readDatasetInfo(DatasetBuilder dataset, org.jdom2.Element dsElem)
-
readThreddsMetadataGroup
protected void readThreddsMetadataGroup(Map<String,Object> flds, DatasetBuilder dataset, org.jdom2.Element parent)
-
readContributor
protected ThreddsMetadata.Contributor readContributor(org.jdom2.Element elem)
-
readDataSize
protected long readDataSize(org.jdom2.Element parent)
-
readDocumentation
protected Documentation readDocumentation(org.jdom2.Element s)
-
readDouble
protected double readDouble(org.jdom2.Element elem)
-
readGeospatialCoverage
protected ThreddsMetadata.GeospatialCoverage readGeospatialCoverage(org.jdom2.Element gcElem)
-
readGeospatialRange
protected ThreddsMetadata.GeospatialRange readGeospatialRange(org.jdom2.Element spElem, String defUnits)
-
readMetadata
protected ThreddsMetadata.MetadataOther readMetadata(Map<String,Object> flds, DatasetBuilder dataset, org.jdom2.Element mdataElement)
-
readSource
protected ThreddsMetadata.Source readSource(org.jdom2.Element elem)
-
readTimeCoverage
protected DateRange readTimeCoverage(org.jdom2.Element tElem)
-
makeDateType
protected DateType makeDateType(String text, String format, String type, Calendar calendar)
-
readDuration
protected TimeDuration readDuration(org.jdom2.Element elem)
-
readVariables
protected ThreddsMetadata.VariableGroup readVariables(org.jdom2.Element varsElem)
-
readVariable
public static ThreddsMetadata.Variable readVariable(org.jdom2.Element varElem)
-
readControlledVocabulary
protected ThreddsMetadata.Vocab readControlledVocabulary(org.jdom2.Element elem)
-
-