-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix encoding of Inspire observations for streaming
- Loading branch information
CarstenHollmann
committed
Nov 18, 2022
1 parent
66e76d6
commit bc73350
Showing
3 changed files
with
67 additions
and
6 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
...is/src/test/java/org/n52/shetland/arcgis/service/feature/FeatureServiceConstantsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
...d/xmlbeans/src/main/java/org/n52/svalbard/encode/InspireOmObservationXmlStreamWriter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright (C) 2015-2022 52°North Spatial Information Research GmbH | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.n52.svalbard.encode; | ||
|
||
import java.io.OutputStream; | ||
|
||
import javax.xml.stream.XMLStreamException; | ||
|
||
import org.n52.shetland.ogc.om.OmObservation; | ||
import org.n52.svalbard.encode.exception.EncodingException; | ||
import org.n52.svalbard.write.XmlStreamWriter; | ||
|
||
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; | ||
|
||
@SuppressFBWarnings({"EI_EXPOSE_REP2"}) | ||
public class InspireOmObservationXmlStreamWriter extends XmlStreamWriter<OmObservation> { | ||
|
||
|
||
private InspireOmObservationEncoder encoder; | ||
|
||
public InspireOmObservationXmlStreamWriter(EncodingContext context, OutputStream outputStream, | ||
OmObservation element, InspireOmObservationEncoder encoder) throws XMLStreamException { | ||
super(context, outputStream, element); | ||
this.encoder = encoder; | ||
} | ||
|
||
@Override | ||
public void write() throws XMLStreamException, EncodingException { | ||
rawText(encoder.encode(getElement(), getContext()).xmlText(getXmlOptions().setSaveNoXmlDecl())); | ||
} | ||
|
||
} |