use of net.opengis.gml.StringOrRefType in project arctic-sea by 52North.
the class SweCommonEncoderv101 method createSimpleDataRecord.
private SimpleDataRecordType createSimpleDataRecord(SweSimpleDataRecord simpleDataRecord) throws EncodingException {
SimpleDataRecordType xbSimpleDataRecord = SimpleDataRecordType.Factory.newInstance(getXmlOptions());
if (simpleDataRecord.isSetDefinition()) {
xbSimpleDataRecord.setDefinition(simpleDataRecord.getDefinition());
}
if (simpleDataRecord.isSetDescription()) {
StringOrRefType xbSoR = StringOrRefType.Factory.newInstance();
xbSoR.setStringValue(simpleDataRecord.getDefinition());
xbSimpleDataRecord.setDescription(xbSoR);
}
if (simpleDataRecord.isSetFields()) {
AnyScalarPropertyType[] xbFields = new AnyScalarPropertyType[simpleDataRecord.getFields().size()];
int xbFieldIndex = 0;
for (SweField sweField : simpleDataRecord.getFields()) {
AnyScalarPropertyType xbField = createFieldForSimpleDataRecord(sweField);
xbFields[xbFieldIndex] = xbField;
xbFieldIndex++;
}
xbSimpleDataRecord.setFieldArray(xbFields);
}
return xbSimpleDataRecord;
}
Aggregations