Package org.n52.svalbard.write
Class AbstractOmV20XmlStreamWriter
java.lang.Object
org.n52.svalbard.write.XmlStreamWriter<OmObservation>
org.n52.svalbard.write.AbstractOmV20XmlStreamWriter
- Direct Known Subclasses:
OmV20XmlStreamWriter,TsmlTDREncoderv10XmlStreamWriter,TsmlTVPEncoderv10XmlStreamWriter,WmlTDREncoderv20XmlStreamWriter,WmlTVPEncoderv20XmlStreamWriter
Abstract implementation of
XmlStreamWriter for writing
OmObservations to stream- Since:
- 1.0.0
-
Field Summary
Fields inherited from class org.n52.svalbard.write.XmlStreamWriter
XML_FRAGMENT -
Constructor Summary
ConstructorsConstructorDescriptionAbstractOmV20XmlStreamWriter(EncodingContext context, OutputStream outputStream, OmObservation element) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancheck(org.apache.xmlbeans.XmlObject result) Check the encoded om:result content for ...PropertyTypeprotected voidprotected voidprotected voidprotected EncodingContextGet additional values map with document helper valueprotected QNameprotected StringgetTimeString(Time time) Parses the ITime object to a time representation as Stringvoidwrite()Encode and write element to theOutputStream.protected abstract voidprotected voidwriteDescription(String description) Write description as gml:descritpion to streamprotected voidWrite om:featureOfInterest encoded or as xlink:href to streamprotected voidwriteIdentifier(CodeWithAuthority identifier) WriteCodeWithAuthorityas gml:identifier to streamprotected voidwriteMetadata(Map<String, NamedValue<?>> map, QName element) Write extension informationprotected voidwriteMetaDataProperty(List<AbstractMetaData> metaDataProperty) protected voidprotected voidWrite om:observedProperty to streamprotected voidwriteObservation(OmObservation observation) WriteOmObservationXML encoded to streamprotected voidwriteObservationType(String observationType) Write observation typ as om:type to streamprotected voidWrite om:parameter to streamprotected voidwritePhenomenonTime(Time time) WriteTimeas om:phenomenonTime to streamprotected voidWrite om:procedure encoded or as xlink:href to streamprotected voidwrite om:result to streamprotected voidWrite om:resultTime to streamprotected voidwriteValidTime(TimePeriod validTime) Methods inherited from class org.n52.svalbard.write.XmlStreamWriter
addXlinkHrefAttr, addXlinkTitleAttr, attr, attr, attr, chars, chars, empty, end, end, endInline, finish, flush, getContext, getElement, getEncodeNamespace, getEncoder, getEncoder, getEncoder, getOutputStream, getReplacement, getXmlOptions, isAddSchemaLocation, namespace, rawText, schemaLocation, start, start, time, time, tryGetEncoder, writeXmlObject, writeXmlObject
-
Constructor Details
-
AbstractOmV20XmlStreamWriter
public AbstractOmV20XmlStreamWriter(EncodingContext context, OutputStream outputStream, OmObservation element) throws XMLStreamException - Throws:
XMLStreamException
-
-
Method Details
-
writeAddtitionalNamespaces
- Throws:
XMLStreamException
-
write
Description copied from class:XmlStreamWriterEncode and write element to theOutputStream.- Specified by:
writein classXmlStreamWriter<OmObservation>- Throws:
XMLStreamException- If an error occurs when writing toOutputStreamEncodingException- If an encoding error occurs
-
writeObservation
protected void writeObservation(OmObservation observation) throws XMLStreamException, EncodingException WriteOmObservationXML encoded to stream- Parameters:
observation- the observation- Throws:
XMLStreamException- If an error occurs when writing to streamEncodingException- If an error occurs when creating elements to be written If an error occurs when creating elements to be written
-
checkAndWriteIdentifier
- Throws:
XMLStreamExceptionEncodingException
-
checkAndWriteName
- Throws:
XMLStreamExceptionEncodingException
-
checkAndWriteDescription
- Throws:
XMLStreamException
-
writeIdentifier
protected void writeIdentifier(CodeWithAuthority identifier) throws EncodingException, XMLStreamException WriteCodeWithAuthorityas gml:identifier to stream- Parameters:
identifier-CodeWithAuthorityto write- Throws:
EncodingException- If an error occurs when creating elements to be writtenXMLStreamException- If an error occurs when writing to stream
-
writeName
- Throws:
XMLStreamExceptionEncodingException
-
writeDescription
Write description as gml:descritpion to stream- Parameters:
description- Description to write- Throws:
XMLStreamException- If an error occurs when writing to stream
-
writeMetadata
protected void writeMetadata(Map<String, NamedValue<?>> map, QName element) throws XMLStreamException, EncodingExceptionWrite extension information- Parameters:
map- Map with valueselement- element name- Throws:
XMLStreamException- If an error occurs when writing to streamEncodingException- If an error occurs when creating elements to be written
-
writeMetaDataProperty
protected void writeMetaDataProperty(List<AbstractMetaData> metaDataProperty) throws XMLStreamException, EncodingException - Throws:
XMLStreamExceptionEncodingException
-
writeObservationType
Write observation typ as om:type to stream- Parameters:
observationType- Observation type to write- Throws:
XMLStreamException- If an error occurs when writing to stream
-
writePhenomenonTime
WriteTimeas om:phenomenonTime to stream- Parameters:
time-Timeto write as om:phenomenonTime to stream- Throws:
EncodingException- If an error occurs when creating elements to be writtenXMLStreamException- If an error occurs when writing to stream
-
writeValidTime
- Throws:
EncodingExceptionXMLStreamException
-
writeResultTime
Write om:resultTime to stream- Throws:
XMLStreamException- If an error occurs when writing to streamEncodingException- If an error occurs when creating elements to be written
-
writeProcedure
Write om:procedure encoded or as xlink:href to stream- Throws:
XMLStreamException- If an error occurs when writing to streamUnsupportedEncoderInputException- If the procedure could not be encodedEncodingException- If an error occurs when creating elements to be written
-
writeParameter
Write om:parameter to stream- Throws:
XMLStreamException- If an error occurs when writing to streamEncodingException- If an error occurs when creating elements to be written
-
writeObservableProperty
Write om:observedProperty to stream- Throws:
XMLStreamException- If an error occurs when writing to stream
-
writeFeatureOfIntererst
Write om:featureOfInterest encoded or as xlink:href to stream- Throws:
XMLStreamException- If an error occurs when writing to streamEncodingException- If an error occurs when creating elements to be written
-
getDefaultFeatureEncodingNamespace
-
writeResult
write om:result to stream- Throws:
XMLStreamException- If an error occurs when writing to streamEncodingException- If an error occurs when creating elements to be written
-
getDocumentAdditionalHelperValues
Get additional values map with document helper value- Returns:
- The encoding context
-
getTimeString
Parses the ITime object to a time representation as String- Parameters:
time- SOS ITime object- Returns:
- Time as String
- Throws:
DateTimeFormatException- If a formatting error occurs
-
getDocumentName
-
check
protected boolean check(org.apache.xmlbeans.XmlObject result) Check the encoded om:result content for ...PropertyType- Parameters:
result- Encoded om:result content to check- Returns:
true, if content contains ...PropertyType
-