Search in sources :

Example 1 with GetObservationResponseXmlStreamWriter

use of org.n52.svalbard.write.GetObservationResponseXmlStreamWriter in project arctic-sea by 52North.

the class GetObservationResponseEncoder method createResponse.

@Override
protected void createResponse(ObservationEncoder<XmlObject, OmObservation> encoder, GetObservationResponse response, OutputStream outputStream, EncodingContext ctx) throws EncodingException {
    try {
        EncodingContext context = ctx.with(EncoderFlags.ENCODER_REPOSITORY, getEncoderRepository()).with(XmlEncoderFlags.XML_OPTIONS, (Supplier<XmlOptions>) this::getXmlOptions).with(StreamingEncoderFlags.ENCODER, this);
        new GetObservationResponseXmlStreamWriter(context, outputStream, response).write();
    } catch (XMLStreamException xmlse) {
        throw new EncodingException(xmlse);
    }
}
Also used : XMLStreamException(javax.xml.stream.XMLStreamException) EncodingException(org.n52.svalbard.encode.exception.EncodingException) XmlOptions(org.apache.xmlbeans.XmlOptions) GetObservationResponseXmlStreamWriter(org.n52.svalbard.write.GetObservationResponseXmlStreamWriter)

Aggregations

XMLStreamException (javax.xml.stream.XMLStreamException)1 XmlOptions (org.apache.xmlbeans.XmlOptions)1 EncodingException (org.n52.svalbard.encode.exception.EncodingException)1 GetObservationResponseXmlStreamWriter (org.n52.svalbard.write.GetObservationResponseXmlStreamWriter)1