thredds.catalog
Class InvMetadata

java.lang.Object
  extended by thredds.catalog.InvMetadata

public class InvMetadata
extends Object

A metadata element: structured XML element containing info about associated dataset or catalog.

Author:
john caron
See Also:
for public interface

Constructor Summary
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
 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 null
 MetadataConverterIF 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 InvMetadata
 ThreddsMetadata getThreddsMetadata()
          get the internal ThreddsMetadata, if isThreddsMetadata() is true
 String getXlinkHref()
          if its a XLink, get the xlink:href String
 String getXlinkTitle()
          if its a XLink, get the xlink:title attribute
 URI getXlinkURI()
          if its a XLink, get the xlink:href as an absolute URI; may be null
 int hashCode()
          Override Object.hashCode() to implement equals.
 boolean hasXlink()
          if it has an XLink
 boolean isInherited()
          if it is inherited
 boolean isThreddsMetadata()
          if this element contains ThreddsMetadata
 void setNamespaceURI(String namespaceURI)
          set the namespace URI
 void setThreddsMetadata(boolean isThreddsMetadata)
          set if this element contains ThreddsMetadata
 void setThreddsMetadata(ThreddsMetadata tmd)
          set the internal ThreddsMetadata; this holds elements from THREDDS namespace
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

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 type
namespaceURI - : namespace URI string of the element, use null for THREDDS
prefix - : namespace prefix of the element, use null for THREDDS
inherited - : if inherited
isThreddsMetadata - : is threddsMetadata
converter - : 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 type
namespaceURI - : namespace URI string of the element, can use null for THREDDS
namespacePrefix - : namespace prefix of the element, use null for THREDDS
inherited - : if inherited
isThreddsMetadata - : is threddsMetadata
converter - : 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 inherited
tm - : 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.

Overrides:
equals in class Object

hashCode

public int hashCode()
Override Object.hashCode() to implement equals.

Overrides:
hashCode in class Object


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.