use of net.opengis.swe.x101.AbstractEncodingType in project arctic-sea by 52North.
the class SweCommonEncoderv101 method createTextEncoding.
private BlockEncodingPropertyType createTextEncoding(SweTextEncoding sosTextEncoding) {
BlockEncodingPropertyType xbTextEncodingType = BlockEncodingPropertyType.Factory.newInstance(getXmlOptions());
TextBlock xbTextEncoding = xbTextEncodingType.addNewTextBlock();
if (sosTextEncoding.getBlockSeparator() != null) {
xbTextEncoding.setBlockSeparator(sosTextEncoding.getBlockSeparator());
}
// }
if (sosTextEncoding.getDecimalSeparator() != null) {
xbTextEncoding.setDecimalSeparator(sosTextEncoding.getDecimalSeparator());
}
if (sosTextEncoding.getTokenSeparator() != null) {
xbTextEncoding.setTokenSeparator(sosTextEncoding.getTokenSeparator());
}
// cannot be cast to net.opengis.swe.x101.AbstractEncodingType
return xbTextEncodingType;
}
use of net.opengis.swe.x101.AbstractEncodingType in project arctic-sea by 52North.
the class InsertResultTemplateRequestEncoderTest method shouldEncodeResultEncoding.
@Test
public void shouldEncodeResultEncoding() throws EncodingException, DecodingException {
ResultTemplateType template = ((InsertResultTemplateDocument) encoder.create(request)).getInsertResultTemplate().getProposedTemplate().getResultTemplate();
XmlHelper.validateDocument(template);
Assert.assertThat(template.getResultEncoding(), Matchers.notNullValue());
Assert.assertThat(template.getResultEncoding().getAbstractEncoding(), Matchers.notNullValue());
AbstractEncodingType resultEncoding = template.getResultEncoding().getAbstractEncoding();
Assert.assertThat(resultEncoding, Matchers.instanceOf(TextEncodingType.class));
TextEncodingType xbTextEncoding = (TextEncodingType) resultEncoding;
Assert.assertThat(xbTextEncoding.getBlockSeparator(), Is.is(blockSeparator));
Assert.assertThat(xbTextEncoding.getTokenSeparator(), Is.is(tokenSeparator));
}
Aggregations