thredds.catalog
Class InvMetadata

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

public class InvMetadata
extends java.lang.Object

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

Version:
$Revision: 48 $ $Date: 2006-07-12 16:15:40Z $
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, java.lang.String mtype, java.lang.String namespaceURI, java.lang.String namespacePrefix, boolean inherited, boolean isThreddsMetadata, MetadataConverterIF converter, java.lang.Object contentObject)
          Constructor for elements with inline content.
InvMetadata(InvDataset dataset, java.lang.String xlinkHref, java.lang.String title, java.lang.String type, java.lang.String namespaceURI, java.lang.String prefix, boolean inherited, boolean isThreddsMetadata, MetadataConverterIF converter)
          Constructor for elements with Xlinks.
 
Method Summary
 boolean equals(java.lang.Object o)
          InvMetadata elements with same values are equal.
 void finish()
          Finish getting the metadata if necessary.
 java.lang.Object getContentObject()
          get the content object, may be null
 MetadataConverterIF getConverter()
          Get the converter; may be null.
 java.lang.String getMetadataType()
          Get the metadata type.
 java.lang.String getNamespacePrefix()
          Get the prefix mapped to the namespace.
 java.lang.String getNamespaceURI()
          Get the namespace.
 InvDataset getParentDataset()
          Return the parent dataset of this InvMetadata
 ThreddsMetadata getThreddsMetadata()
          get the internal ThreddsMetadata, may be null
 java.lang.String getXlinkHref()
          if its a XLink, get the xlink:href as an absolute URI; may be null
 java.lang.String getXlinkTitle()
          if its a XLink, get the xlink:title attribute
 java.net.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(java.lang.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
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InvMetadata

public InvMetadata(InvDataset dataset,
                   java.lang.String xlinkHref,
                   java.lang.String title,
                   java.lang.String type,
                   java.lang.String namespaceURI,
                   java.lang.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,
                   java.lang.String mtype,
                   java.lang.String namespaceURI,
                   java.lang.String namespacePrefix,
                   boolean inherited,
                   boolean isThreddsMetadata,
                   MetadataConverterIF converter,
                   java.lang.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()
Return the parent dataset of this InvMetadata


getConverter

public MetadataConverterIF getConverter()
Get the converter; may be null.


getMetadataType

public java.lang.String getMetadataType()
Get the metadata type.


getNamespaceURI

public java.lang.String getNamespaceURI()
Get the namespace.


getNamespacePrefix

public java.lang.String getNamespacePrefix()
Get the prefix mapped to the namespace.


hasXlink

public boolean hasXlink()
if it has an XLink


getXlinkHref

public java.lang.String getXlinkHref()
if its a XLink, get the xlink:href as an absolute URI; may be null


getXlinkURI

public java.net.URI getXlinkURI()
if its a XLink, get the xlink:href as an absolute URI; may be null


getXlinkTitle

public java.lang.String getXlinkTitle()
if its a XLink, get the xlink:title attribute


isInherited

public boolean isInherited()
if it is inherited


isThreddsMetadata

public boolean isThreddsMetadata()
if this element contains ThreddsMetadata


setThreddsMetadata

public void setThreddsMetadata(boolean isThreddsMetadata)
set if this element contains ThreddsMetadata


setNamespaceURI

public void setNamespaceURI(java.lang.String namespaceURI)
set the namespace URI


getContentObject

public java.lang.Object getContentObject()
get the content object, may be null


setThreddsMetadata

public void setThreddsMetadata(ThreddsMetadata tmd)
set the internal ThreddsMetadata; this holds elements from THREDDS namespace


getThreddsMetadata

public ThreddsMetadata getThreddsMetadata()
get the internal ThreddsMetadata, may be 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(java.lang.Object o)
InvMetadata elements with same values are equal.

Overrides:
equals in class java.lang.Object

hashCode

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

Overrides:
hashCode in class java.lang.Object