use of org.n52.svalbard.decode.exception.DecodingException in project arctic-sea by 52North.
the class SensorMLDecoderV20 method parseSimpleProcess.
private DescribedObject parseSimpleProcess(SimpleProcessType describedObject) throws DecodingException {
SimpleProcess sp = new SimpleProcess();
parseAbstractProcess(describedObject, sp);
parseDescribedObject(describedObject, sp);
return sp;
}
use of org.n52.svalbard.decode.exception.DecodingException in project arctic-sea by 52North.
the class SensorMLDecoderV20 method parseOutput.
@SuppressWarnings({ "rawtypes" })
private SmlIo parseOutput(Output xbOutput) throws DecodingException {
final SmlIo sosIo = new SmlIo();
sosIo.setIoName(xbOutput.getName());
if (xbOutput.isSetHref()) {
parseReference(xbOutput, sosIo);
} else {
sosIo.setIoValue(parseDataComponentOrObservablePropertyType(xbOutput));
}
return sosIo;
}
use of org.n52.svalbard.decode.exception.DecodingException in project arctic-sea by 52North.
the class SensorMLDecoderV20 method parseDataInterfaceType.
protected SmlDataInterface parseDataInterfaceType(DataInterfaceType xbDataInterface) throws DecodingException {
SmlDataInterface dataInterface = new SmlDataInterface();
// TODO implement- no funding at the moment available
// When starting implementation: Do not forget to activate the already
// available unit tests
Object data = decodeXmlElement(xbDataInterface.getData());
if (data instanceof SweDataStream) {
dataInterface.setData((SweDataStream) data);
}
if (xbDataInterface.isSetInterfaceParameters()) {
Object parameter = decodeXmlElement(xbDataInterface.getInterfaceParameters());
if (parameter instanceof SweDataRecord) {
dataInterface.setInputParameters((SweDataRecord) parameter);
}
// TODO throw exception if not instance of SweDataRecord
}
return dataInterface;
}
use of org.n52.svalbard.decode.exception.DecodingException in project arctic-sea by 52North.
the class SensorMLDecoderV20 method parsePhysicalSystem.
private DescribedObject parsePhysicalSystem(PhysicalSystemType describedObject) throws DecodingException {
PhysicalSystem ps = new PhysicalSystem();
parseAbstractPhysicalProcess(describedObject, ps);
parseAbstractProcess(describedObject, ps);
parseDescribedObject(describedObject, ps);
if (describedObject.isSetComponents()) {
ps.addComponents(parseComponents(describedObject.getComponents()));
final List<Integer> compsToRemove = checkComponentsForRemoval(describedObject.getComponents().getComponentList());
compsToRemove.forEach(describedObject.getComponents().getComponentList()::removeComponent);
if (removeEmptyComponents(describedObject.getComponents())) {
describedObject.unsetComponents();
}
}
return ps;
}
use of org.n52.svalbard.decode.exception.DecodingException in project arctic-sea by 52North.
the class SensorMLDecoderV20 method parseAggregateProcess.
private DescribedObject parseAggregateProcess(AggregateProcessType describedObject) throws DecodingException {
AggregateProcess ap = new AggregateProcess();
parseAbstractProcess(describedObject, ap);
parseDescribedObject(describedObject, ap);
if (describedObject.isSetComponents()) {
ap.addComponents(parseComponents(describedObject.getComponents()));
List<Integer> compsToRemove = checkComponentsForRemoval(describedObject.getComponents().getComponentList());
compsToRemove.forEach(describedObject.getComponents().getComponentList()::removeComponent);
if (removeEmptyComponents(describedObject.getComponents())) {
describedObject.unsetComponents();
}
}
if (describedObject.isSetConnections()) {
ap.setConnections(parseConnections(describedObject.getConnections()));
}
return ap;
}
Aggregations