Package thredds.catalog
Class InvMetadata
- java.lang.Object
-
- thredds.catalog.InvMetadata
-
public class InvMetadata extends Object
A metadata element: structured XML element containing info about associated dataset or catalog.- See Also:
for public interface
-
-
Constructor Summary
Constructors Constructor Description InvMetadata(InvDataset dataset, boolean inherited, ThreddsMetadata tm)
Constructor using an existing ThreddsMetadata object.InvMetadata(InvDataset dataset, String mtype, String namespaceURI, String namespacePrefix, boolean inherited, boolean isThreddsMetadata, MetadataConverterIF converter, Object contentObject)
Constructor for elements with inline content.InvMetadata(InvDataset dataset, String xlinkHref, String title, String type, String namespaceURI, String prefix, boolean inherited, boolean isThreddsMetadata, MetadataConverterIF converter)
Constructor for elements with Xlinks.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
InvMetadata elements with same values are equal.void
finish()
Finish getting the metadata if necessary.Object
getContentObject()
get the content object, may be nullMetadataConverterIF
getConverter()
Get the converter; may be null.String
getMetadataType()
Get the metadata type.String
getNamespacePrefix()
Get the prefix mapped to the namespace.String
getNamespaceURI()
Get the namespace.InvDataset
getParentDataset()
Get the parent dataset of this InvMetadataThreddsMetadata
getThreddsMetadata()
get the internal ThreddsMetadata, if isThreddsMetadata() is trueString
getXlinkHref()
if its a XLink, get the xlink:href StringString
getXlinkTitle()
if its a XLink, get the xlink:title attributeURI
getXlinkURI()
if its a XLink, get the xlink:href as an absolute URI; may be nullint
hashCode()
Override Object.hashCode() to implement equals.boolean
hasXlink()
if it has an XLinkboolean
isInherited()
if it is inheritedboolean
isThreddsMetadata()
if this element contains ThreddsMetadatavoid
setNamespaceURI(String namespaceURI)
set the namespace URIvoid
setThreddsMetadata(boolean isThreddsMetadata)
set if this element contains ThreddsMetadatavoid
setThreddsMetadata(ThreddsMetadata tmd)
set the internal ThreddsMetadata; this holds elements from THREDDS namespace
-
-
-
Constructor Detail
-
InvMetadata
public InvMetadata(InvDataset dataset, String xlinkHref, String title, String type, String namespaceURI, String prefix, boolean inherited, boolean isThreddsMetadata, MetadataConverterIF converter)
Constructor for elements with Xlinks.- Parameters:
dataset
- : dataset that contains the metadata.xlinkHref
- : URI of xlink, may be null.title
- : xlink title, may be null.type
- : metadata typenamespaceURI
- : namespace URI string of the element, use null for THREDDSprefix
- : namespace prefix of the element, use null for THREDDSinherited
- : if inheritedisThreddsMetadata
- : is threddsMetadataconverter
- : converter for creating the content object, may be null
-
InvMetadata
public InvMetadata(InvDataset dataset, String mtype, String namespaceURI, String namespacePrefix, boolean inherited, boolean isThreddsMetadata, MetadataConverterIF converter, Object contentObject)
Constructor for elements with inline content.- Parameters:
dataset
- : dataset that contains the metadata.mtype
- : metadata typenamespaceURI
- : namespace URI string of the element, can use null for THREDDSnamespacePrefix
- : namespace prefix of the element, use null for THREDDSinherited
- : if inheritedisThreddsMetadata
- : is threddsMetadataconverter
- : the metadata converter.contentObject
- : content object.
-
InvMetadata
public InvMetadata(InvDataset dataset, boolean inherited, ThreddsMetadata tm)
Constructor using an existing ThreddsMetadata object.- Parameters:
dataset
- : dataset that contains the metadata.inherited
- : if inheritedtm
- : content object.
-
-
Method Detail
-
getParentDataset
public InvDataset getParentDataset()
Get the parent dataset of this InvMetadata- Returns:
- the parent dataset of this InvMetadata
-
getConverter
public MetadataConverterIF getConverter()
Get the converter; may be null.- Returns:
- the converter or null
-
getMetadataType
public String getMetadataType()
Get the metadata type.- Returns:
- the metadata type.
-
getNamespaceURI
public String getNamespaceURI()
Get the namespace.- Returns:
- the namespace.
-
getNamespacePrefix
public String getNamespacePrefix()
Get the prefix mapped to the namespace.- Returns:
- the prefix mapped to the namespace.
-
hasXlink
public boolean hasXlink()
if it has an XLink- Returns:
- true if it has an XLink
-
getXlinkHref
public String getXlinkHref()
if its a XLink, get the xlink:href String- Returns:
- the xlink:href or null
-
getXlinkURI
public URI getXlinkURI()
if its a XLink, get the xlink:href as an absolute URI; may be null- Returns:
- the xlink:href as an absolute URI, or null
-
getXlinkTitle
public String getXlinkTitle()
if its a XLink, get the xlink:title attribute- Returns:
- xlink:title or null
-
isInherited
public boolean isInherited()
if it is inherited- Returns:
- true if it is inherited
-
isThreddsMetadata
public boolean isThreddsMetadata()
if this element contains ThreddsMetadata- Returns:
- true if this element contains ThreddsMetadata
-
setThreddsMetadata
public void setThreddsMetadata(boolean isThreddsMetadata)
set if this element contains ThreddsMetadata- Parameters:
isThreddsMetadata
- true if this element contains ThreddsMetadata
-
setNamespaceURI
public void setNamespaceURI(String namespaceURI)
set the namespace URI- Parameters:
namespaceURI
- set the namespace URI
-
getContentObject
public Object getContentObject()
get the content object, may be null- Returns:
- the content object, or null
-
setThreddsMetadata
public void setThreddsMetadata(ThreddsMetadata tmd)
set the internal ThreddsMetadata; this holds elements from THREDDS namespace- Parameters:
tmd
- the internal ThreddsMetadata object
-
getThreddsMetadata
public ThreddsMetadata getThreddsMetadata()
get the internal ThreddsMetadata, if isThreddsMetadata() is true- Returns:
- the internal ThreddsMetadata, or null
-
finish
public void finish()
Finish getting the metadata if necessary. If this is an XLink, this will trigger a read of the href the first time called.
-
equals
public boolean equals(Object o)
InvMetadata elements with same values are equal.
-
-