use of net.opengis.sensorML.x101.OutputsDocument.Outputs in project arctic-sea by 52North.
the class SensorMLEncoderv101 method createOutputs.
/**
* Creates the outputs section of the SensorML description.
*
* @param sosOutputs
* SOS SWE representation.
*
* @return XML Outputs element
*
* @throws EncodingException
* if the encoding fails
*/
private Outputs createOutputs(final List<SmlIo> sosOutputs) throws EncodingException {
Outputs outputs = Outputs.Factory.newInstance(getXmlOptions());
OutputList outputList = outputs.addNewOutputList();
Set<String> definitions = Sets.newHashSet();
int counter = 1;
Set<String> outputNames = Sets.newHashSet();
for (SmlIo sosSMLIo : sosOutputs) {
if (sosSMLIo.isSetValue() && !definitions.contains(sosSMLIo.getIoValue().getDefinition())) {
if (!sosSMLIo.isSetName() || outputNames.contains(sosSMLIo.getIoName())) {
sosSMLIo.setIoName(getValidOutputName(counter++, outputNames));
}
outputNames.add(sosSMLIo.getIoName());
addIoComponentPropertyType(outputList.addNewOutput(), sosSMLIo);
definitions.add(sosSMLIo.getIoValue().getDefinition());
}
}
return outputs;
}
Aggregations