Class OMUtils

java.lang.Object
org.vast.ogc.om.OMUtils

public class OMUtils extends Object

Provides Helper methods to read and write O&M observations in a version agnostic manner.

Since:
Feb 22, 2007
  • Field Details

  • Constructor Details

    • OMUtils

      public OMUtils(String version)
  • Method Details

    • loadRegistry

      public static void loadRegistry()
    • readObservation

      public IObservation readObservation(DOMHelper dom, Element obsElt) throws XMLReaderException
      Read an O&M observation object from a DOM element
      Parameters:
      dom - DOMHelper to use to read the element content
      obsElt - DOM element corresponding to the Observation
      Returns:
      Concrete instance of IObservation containing information parsed from the DOM tree
      Throws:
      XMLReaderException
    • readObservation

      public IObservation readObservation(InputStream inputStream) throws XMLReaderException
      Reads an O&M observation object from an InputStream
      Parameters:
      inputStream - input stream to read from
      Returns:
      Concrete instance of IObservation containing information parsed from XML
      Throws:
      XMLReaderException
    • writeObservation

      public Element writeObservation(DOMHelper dom, IObservation obs, String version) throws XMLWriterException
      Builds a DOM Element from the content of the IObservation object
      Parameters:
      dom - DOMHelper used to generate the element
      obs - Observation instance whose content will be serialized
      version - Version of O&M schema to use
      Returns:
      New DOM Element
      Throws:
      XMLWriterException
    • writeObservation

      public void writeObservation(OutputStream outputStream, IObservation obs, String version) throws XMLWriterException, IOException
      Writes XML for an Observation of selected version in the specified OutputStream
      Parameters:
      outputStream - Outputstream to write the XML into
      obs - Observation instance whose content will be serialized
      version - Version of O&M schema to use
      Throws:
      XMLWriterException
      IOException
    • getVersion

      public String getVersion(DOMHelper dom, Element omElt)
      Logic to guess O&M version from namespace
      Parameters:
      dom -
      omElt -
      Returns:
      Version string