Search in sources :

Example 1 with Outputs

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;
}
Also used : Outputs(net.opengis.sensorML.x101.OutputsDocument.Outputs) SmlIo(org.n52.shetland.ogc.sensorML.elements.SmlIo) OutputList(net.opengis.sensorML.x101.OutputsDocument.Outputs.OutputList)

Aggregations

Outputs (net.opengis.sensorML.x101.OutputsDocument.Outputs)1 OutputList (net.opengis.sensorML.x101.OutputsDocument.Outputs.OutputList)1 SmlIo (org.n52.shetland.ogc.sensorML.elements.SmlIo)1