use of net.opengis.om.x20.NamedValueDocument in project arctic-sea by 52North.
the class AbstractOmEncoderv20 method encode.
@Override
public XmlObject encode(Object element, EncodingContext additionalValues) throws EncodingException {
XmlObject encodedObject = null;
if (element instanceof OmObservation) {
encodedObject = encodeOmObservation((OmObservation) element, additionalValues);
} else if (element instanceof NamedValue) {
NamedValueType nvt = createNamedValue((NamedValue<?>) element);
if (additionalValues.has(XmlBeansEncodingFlags.DOCUMENT)) {
NamedValueDocument nvd = NamedValueDocument.Factory.newInstance();
nvd.setNamedValue(nvt);
encodedObject = nvd;
} else if (additionalValues.has(XmlBeansEncodingFlags.PROPERTY_TYPE)) {
NamedValuePropertyType nvpt = NamedValuePropertyType.Factory.newInstance();
nvpt.setNamedValue(nvt);
encodedObject = nvpt;
} else {
encodedObject = nvt;
}
} else if (element instanceof AbstractFeature) {
encodedObject = encodeFeatureOfInterest((AbstractFeature) element);
} else if (element instanceof SosProcedureDescription) {
encodedObject = encodeProcedureDescription((SosProcedureDescription<?>) element);
} else {
throw new UnsupportedEncoderInputException(this, element);
}
// XmlHelper.validateDocument(encodedObject));
return encodedObject;
}
Aggregations