public class SMLUtils extends XMLBindingsUtils
Helper class providing a version agnostic access to SensorML object readers and writers. This class delegates to version specific readers/writers.
Modifier and Type | Field and Description |
---|---|
static String |
IC |
static String |
SENSORML |
static String |
V2_0 |
encoding, staxBindings
Constructor and Description |
---|
SMLUtils(String version)
Creates this helper for the specified SensorML version
|
Modifier and Type | Method and Description |
---|---|
String |
getVersion(DOMHelper dom,
Element smlElt)
Logic to guess SensorML version from namespace
|
static void |
loadRegistry() |
protected Object |
readFromXmlStream(XMLStreamReader reader,
Enum<?> eltType) |
AbstractProcess |
readProcess(DOMHelper dom,
Element processElt)
Reads a SensorML process from a DOM element
|
AbstractProcess |
readProcess(InputStream is)
Reads a SensorML process from an InputStream
The root element must be of one of the types derived from AbstractProcess
|
Element |
writeProcess(DOMHelper dom,
AbstractProcess process)
Serializes a SensorML process to a DOM element
|
void |
writeProcess(OutputStream os,
AbstractProcess process,
boolean indent)
Serializes a SensorMl process to an OutputStream
|
protected void |
writeToXmlStream(XMLStreamWriter writer,
Object sweObj,
Enum<?> eltType) |
addOnlyUsedNamespaceMappingsToDOM, readFromDom, readFromStream, setEncoding, writeToDom, writeToStream
public static final String IC
public static final String SENSORML
public static final String V2_0
public SMLUtils(String version)
version
- public static void loadRegistry()
public AbstractProcess readProcess(DOMHelper dom, Element processElt) throws XMLReaderException
dom
- DOM helper wrapping the XML document to read fromprocessElt
- DOM element to read from. Must be of one of the types derived from AbstractProcessXMLReaderException
- if an error occured while reading the XMLpublic AbstractProcess readProcess(InputStream is) throws XMLReaderException
is
- Input stream to read fromXMLReaderException
- if an error occured while reading the XMLpublic Element writeProcess(DOMHelper dom, AbstractProcess process) throws XMLWriterException
dom
- DOM helper wrapping the XMl document to write toprocess
- Process object to serializeXMLWriterException
- if an error occurs while generating the DOM treepublic void writeProcess(OutputStream os, AbstractProcess process, boolean indent) throws XMLWriterException, IOException
os
- Output stream to write toprocess
- Process object to serializeindent
- Set to true to indent the outputXMLWriterException
- if an error occurs while generating the XML contentIOException
- if an error occurs while writing to output the streampublic String getVersion(DOMHelper dom, Element smlElt)
dom
- smlElt
- DOM element containing the SensorML contentprotected Object readFromXmlStream(XMLStreamReader reader, Enum<?> eltType) throws XMLStreamException
readFromXmlStream
in class XMLBindingsUtils
XMLStreamException
protected void writeToXmlStream(XMLStreamWriter writer, Object sweObj, Enum<?> eltType) throws XMLStreamException
writeToXmlStream
in class XMLBindingsUtils
XMLStreamException
Copyright © 2016 Sensia Software LLC. All rights reserved.