use of net.opengis.ows.x11.ExceptionReportDocument.ExceptionReport in project arctic-sea by 52North.
the class OwsEncoderv110 method encodeOwsExceptionReport.
private ExceptionReportDocument encodeOwsExceptionReport(final OwsExceptionReport owsExceptionReport) {
ExceptionReportDocument erd = ExceptionReportDocument.Factory.newInstance(getXmlOptions());
ExceptionReport er = erd.addNewExceptionReport();
// er.setLanguage("en");
er.setVersion(owsExceptionReport.getVersion());
List<ExceptionType> exceptionTypes = new ArrayList<>(owsExceptionReport.getExceptions().size());
owsExceptionReport.getExceptions().stream().map(this::encodeOwsException).map(ExceptionDocument::getException).forEach(exceptionTypes::add);
er.setExceptionArray(exceptionTypes.toArray(new ExceptionType[exceptionTypes.size()]));
N52XmlHelper.setSchemaLocationsToDocument(erd, Collections.singletonList(N52XmlHelper.getSchemaLocationForOWS110()));
return erd;
}
use of net.opengis.ows.x11.ExceptionReportDocument.ExceptionReport in project arctic-sea by 52North.
the class OwsExceptionReportDecoder method decode.
private OwsExceptionReport decode(ExceptionReport report) {
String version = report.getVersion();
ExceptionType[] exceptionTypes = report.getExceptionArray();
List<CodedException> exceptions = Streams.stream(exceptionTypes).map(this::decode).collect(toList());
return new CompositeOwsException(exceptions).setVersion(version);
}
Aggregations