Search in sources :

Example 1 with Document

use of net.opengis.sensorML.x101.DocumentDocument.Document in project arctic-sea by 52North.

the class SensorMLDecoderV101 method parseSensorML.

@SuppressFBWarnings("BC_VACUOUS_INSTANCEOF")
private SensorML parseSensorML(final SensorMLDocument xbSensorML) throws DecodingException {
    final SensorML sensorML = new SensorML();
    // get member process
    for (final Member xbMember : xbSensorML.getSensorML().getMemberArray()) {
        if (xbMember.getProcess() != null) {
            if (xbMember.getProcess() instanceof AbstractProcessType) {
                final AbstractProcessType xbAbstractProcess = xbMember.getProcess();
                AbstractProcess abstractProcess = null;
                if (xbAbstractProcess.schemaType() == SystemType.type) {
                    abstractProcess = parseSystem((SystemType) xbAbstractProcess);
                } else if (xbAbstractProcess.schemaType() == ProcessModelType.type) {
                    abstractProcess = parseProcessModel((ProcessModelType) xbAbstractProcess);
                } else if (xbAbstractProcess.schemaType() == ComponentType.type) {
                    abstractProcess = parseComponent((ComponentType) xbAbstractProcess);
                } else {
                    throw unsupportedMemberProcess(xbMember);
                }
                sensorML.addMember(abstractProcess);
            } else {
                throw unsupportedMemberProcess(xbMember);
            }
        } else {
            throw new DecodingException(XmlHelper.getLocalName(xbMember), "The process of a member of the SensorML Document is null (%s)!", xbMember.getProcess());
        }
    }
    sensorML.setXml(xbSensorML.xmlText(getXmlOptions()));
    return sensorML;
}
Also used : AbstractProcessType(net.opengis.sensorML.x101.AbstractProcessType) AbstractComponentType(net.opengis.sensorML.x101.AbstractComponentType) AbstractDerivableComponentType(net.opengis.sensorML.x101.AbstractDerivableComponentType) ComponentType(net.opengis.sensorML.x101.ComponentType) AbstractProcess(org.n52.shetland.ogc.sensorML.AbstractProcess) SystemType(net.opengis.sensorML.x101.SystemType) DecodingException(org.n52.svalbard.decode.exception.DecodingException) SensorML(org.n52.shetland.ogc.sensorML.SensorML) AbstractSensorML(org.n52.shetland.ogc.sensorML.AbstractSensorML) Member(net.opengis.sensorML.x101.SensorMLDocument.SensorML.Member) SuppressFBWarnings(edu.umd.cs.findbugs.annotations.SuppressFBWarnings)

Aggregations

SuppressFBWarnings (edu.umd.cs.findbugs.annotations.SuppressFBWarnings)1 AbstractComponentType (net.opengis.sensorML.x101.AbstractComponentType)1 AbstractDerivableComponentType (net.opengis.sensorML.x101.AbstractDerivableComponentType)1 AbstractProcessType (net.opengis.sensorML.x101.AbstractProcessType)1 ComponentType (net.opengis.sensorML.x101.ComponentType)1 Member (net.opengis.sensorML.x101.SensorMLDocument.SensorML.Member)1 SystemType (net.opengis.sensorML.x101.SystemType)1 AbstractProcess (org.n52.shetland.ogc.sensorML.AbstractProcess)1 AbstractSensorML (org.n52.shetland.ogc.sensorML.AbstractSensorML)1 SensorML (org.n52.shetland.ogc.sensorML.SensorML)1 DecodingException (org.n52.svalbard.decode.exception.DecodingException)1