public abstract class AbstractOmV20XmlStreamWriter extends XmlStreamWriter<OmObservation>
XmlStreamWriter
for writing
OmObservation
s to streamModifier and Type | Field and Description |
---|---|
private OmObservation |
observation |
indent, out, XML_FRAGMENT, XML_VERSION
Constructor and Description |
---|
AbstractOmV20XmlStreamWriter()
constructor
|
AbstractOmV20XmlStreamWriter(OmObservation observation)
constructor
|
Modifier and Type | Method and Description |
---|---|
private String |
addGmlId(OmObservation observation)
Add gml:id to om:OM_Observation element
|
private void |
addResultTime(TimeInstant time)
Write encoded om:resultTime to stream
|
private boolean |
checkEncodProcedureForEncoderKeys(Encoder<?,?> encoder)
Method to check whether the procedure should be encoded
|
private boolean |
checkResult(org.apache.xmlbeans.XmlObject result)
Check the encoded om:result content for ...PropertyType
|
protected Map<SosConstants.HelperValues,String> |
getDocumentAdditionalHelperValues()
Get additional values map with document helper value
|
private OmObservation |
getOmObservation()
Get the
OmObservation which should be written |
private org.joda.time.DateTime |
getTime(Time time)
Get the time representation from ITime object
|
protected String |
getTimeString(Time time)
Parses the ITime object to a time representation as String
|
private void |
setOmObservation(OmObservation observation)
Set
OmObservation which should be written |
void |
write(OmObservation response,
OutputStream out)
Encode and write the elementToStream to the
OutputStream |
void |
write(OmObservation observation,
OutputStream out,
EncodingValues encodingValues)
Encode and write the elementToStream to the
OutputStream |
void |
write(OutputStream out)
Encode and write element to the
OutputStream |
void |
write(OutputStream out,
EncodingValues encodingValues)
Encode and write element to the
OutputStream |
protected void |
writeDescription(String description)
Write description as gml:descritpion to stream
|
protected void |
writeFeatureOfIntererst(EncodingValues encodingValues)
Write om:featureOfInterest encoded or as xlink:href to stream
|
protected void |
writeIdentifier(CodeWithAuthority identifier)
Write
CodeWithAuthority as gml:identifier to stream |
protected void |
writeObservableProperty()
Write om:observedProperty to stream
|
protected void |
writeObservationType(String observationType)
Write observation typ as om:type to stream
|
protected void |
writeOmObservationDoc(EncodingValues encodingValues)
Write
OmObservation XML encoded to stream |
protected void |
writeParameter(EncodingValues encodingValues)
Write om:parameter to stream
|
protected void |
writePhenomenonTime(Time time)
Write
Time as om:phenomenonTime to stream |
private void |
writePhenomenonTimeContent(Time time)
Write encoded om:phenomenonTime to stream
|
protected void |
writeProcedure(EncodingValues encodingValues)
Write om:procedure encoded or as xlink:href to stream
|
protected void |
writeResult(OmObservation observation,
EncodingValues encodingValues)
write om:result to stream
|
protected void |
writeResultTime()
Write om:resultTime to stream
|
attr, attr, attr, chars, chars, empty, end, end, endInline, finish, flush, getXmlWriter, init, namespace, start, start
addXlinkHrefAttr, addXlinkTitleAttr, getOutputStream, getReplacement, getXmlOutputFactory, init, init, init, rawText, schemaLocation, time, time, writeIndent, writeNewLine, writeXmlObject
private OmObservation observation
public AbstractOmV20XmlStreamWriter()
public AbstractOmV20XmlStreamWriter(OmObservation observation)
observation
- OmObservation
to write to streampublic void write(OutputStream out) throws XMLStreamException, OwsExceptionReport
XmlWriter
OutputStream
write
in class XmlWriter<XMLStreamWriter,OmObservation>
out
- OutputStream to write the encoded elementXMLStreamException
- If an error occurs when writing to OutputStream
OwsExceptionReport
- If an encoding error occurspublic void write(OutputStream out, EncodingValues encodingValues) throws XMLStreamException, OwsExceptionReport
XmlWriter
OutputStream
write
in class XmlWriter<XMLStreamWriter,OmObservation>
out
- OutputStream to write the encoded elementencodingValues
- EncodingValues
with additional informationXMLStreamException
- If an error occurs when writing to OutputStream
OwsExceptionReport
- If an encoding error occurspublic void write(OmObservation response, OutputStream out) throws XMLStreamException, OwsExceptionReport
XmlWriter
OutputStream
write
in class XmlWriter<XMLStreamWriter,OmObservation>
response
- Element to encode and write to streamout
- OutputStream to write the encoded elementXMLStreamException
- If an error occurs when writing to OutputStream
OwsExceptionReport
- If an encoding error occurspublic void write(OmObservation observation, OutputStream out, EncodingValues encodingValues) throws XMLStreamException, OwsExceptionReport
XmlWriter
OutputStream
write
in class XmlWriter<XMLStreamWriter,OmObservation>
observation
- Element to encode and write to streamout
- OutputStream to write the encoded elementencodingValues
- EncodingValues
with additional informationXMLStreamException
- If an error occurs when writing to OutputStream
OwsExceptionReport
- If an encoding error occursprotected void writeOmObservationDoc(EncodingValues encodingValues) throws XMLStreamException, OwsExceptionReport
OmObservation
XML encoded to streamencodingValues
- EncodingValues
contains additional information for the
encodingXMLStreamException
- If an error occurs when writing to streamOwsExceptionReport
- If an error occurs when creating elements to be written If an
error occurs when creating elements to be writtenprotected void writeIdentifier(CodeWithAuthority identifier) throws OwsExceptionReport, XMLStreamException
CodeWithAuthority
as gml:identifier to streamidentifier
- CodeWithAuthority
to writeOwsExceptionReport
- If an error occurs when creating elements to be writtenXMLStreamException
- If an error occurs when writing to streamprotected void writeDescription(String description) throws XMLStreamException
description
- Description to writeXMLStreamException
- If an error occurs when writing to streamprotected void writeObservationType(String observationType) throws XMLStreamException
observationType
- Observation type to writeXMLStreamException
- If an error occurs when writing to streamprotected void writePhenomenonTime(Time time) throws OwsExceptionReport, XMLStreamException
Time
as om:phenomenonTime to streamtime
- Time
to write as om:phenomenonTime to streamOwsExceptionReport
- If an error occurs when creating elements to be writtenXMLStreamException
- If an error occurs when writing to streamprotected void writeResultTime() throws XMLStreamException, OwsExceptionReport
XMLStreamException
- If an error occurs when writing to streamOwsExceptionReport
- If an error occurs when creating elements to be writtenprotected void writeProcedure(EncodingValues encodingValues) throws XMLStreamException, UnsupportedEncoderInputException, OwsExceptionReport
encodingValues
- EncodingValues
contains the required encoderXMLStreamException
- If an error occurs when writing to streamUnsupportedEncoderInputException
- If the procedure could not be encodedOwsExceptionReport
- If an error occurs when creating elements to be writtenprotected void writeParameter(EncodingValues encodingValues) throws XMLStreamException, OwsExceptionReport
encodingValues
- EncodingValues
contains the required encoderXMLStreamException
- If an error occurs when writing to streamOwsExceptionReport
- If an error occurs when creating elements to be writtenprotected void writeObservableProperty() throws XMLStreamException
XMLStreamException
- If an error occurs when writing to streamprotected void writeFeatureOfIntererst(EncodingValues encodingValues) throws XMLStreamException, OwsExceptionReport
encodingValues
- EncodingValues
contains the required encoderXMLStreamException
- If an error occurs when writing to streamOwsExceptionReport
- If an error occurs when creating elements to be writtenprotected void writeResult(OmObservation observation, EncodingValues encodingValues) throws XMLStreamException, OwsExceptionReport
observation
- OmObservation
with the result to writeencodingValues
- EncodingValues
contains the result element namespaceXMLStreamException
- If an error occurs when writing to streamOwsExceptionReport
- If an error occurs when creating elements to be writtenprotected Map<SosConstants.HelperValues,String> getDocumentAdditionalHelperValues()
protected String getTimeString(Time time) throws DateTimeFormatException
time
- SOS ITime objectDateTimeFormatException
- If a formatting error occursprivate boolean checkResult(org.apache.xmlbeans.XmlObject result)
result
- Encoded om:result content to checktrue
, if content contains ...PropertyTypeprivate String addGmlId(OmObservation observation) throws XMLStreamException
observation
- OmObservation
with the GML idXMLStreamException
- If an error occurs when writing to streamprivate void writePhenomenonTimeContent(Time time) throws OwsExceptionReport, XMLStreamException
time
- Time
to encode and writeOwsExceptionReport
- If an error occurs when creating elements to be writtenXMLStreamException
- If an error occurs when writing to streamprivate void addResultTime(TimeInstant time) throws OwsExceptionReport, XMLStreamException
time
- Time
to encode and writeOwsExceptionReport
- If an error occurs when creating elements to be writtenXMLStreamException
- If an error occurs when writing to streamprivate org.joda.time.DateTime getTime(Time time)
time
- ITime objectprivate void setOmObservation(OmObservation observation)
OmObservation
which should be writtenobservation
- the OmObservation
private OmObservation getOmObservation()
OmObservation
which should be writtenOmObservation
private boolean checkEncodProcedureForEncoderKeys(Encoder<?,?> encoder)
Copyright © 2012-2015 52north.org. All Rights Reserved.