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);
}
}
Aggregations