Search in sources :

Example 96 with DecodingException

use of org.n52.svalbard.decode.exception.DecodingException in project arctic-sea by 52North.

the class ProcessDocumentDecoder method decode.

@Override
public Process decode(ProcessDocument pd) throws DecodingException {
    Process process = parseProcessType(pd.getProcess());
    process.setXml(pd.xmlText(getXmlOptions()));
    return process;
}
Also used : Process(org.n52.shetland.inspire.ompr.Process)

Example 97 with DecodingException

use of org.n52.svalbard.decode.exception.DecodingException in project arctic-sea by 52North.

the class ProcessTypeDecoder method decode.

@Override
public Process decode(ProcessType pt) throws DecodingException {
    Process process = parseProcessType(pt);
    process.setXml(pt.xmlText(getXmlOptions()));
    return process;
}
Also used : Process(org.n52.shetland.inspire.ompr.Process)

Example 98 with DecodingException

use of org.n52.svalbard.decode.exception.DecodingException in project arctic-sea by 52North.

the class RelatedOfferingTypeDecoder method parseRelatedOffering.

private OfferingContext parseRelatedOffering(RelatedOffering relatedOffering) throws DecodingException {
    ReferenceType role = decodeXmlElement(relatedOffering.getOfferingContext().getRole());
    ReferenceType relOff = decodeXmlElement(relatedOffering.getOfferingContext().getRelatedOffering());
    return new OfferingContext(role, relOff);
}
Also used : ReferenceType(org.n52.shetland.ogc.gml.ReferenceType) OfferingContext(org.n52.shetland.ogc.sos.ro.OfferingContext)

Example 99 with DecodingException

use of org.n52.svalbard.decode.exception.DecodingException in project arctic-sea by 52North.

the class RelatedOfferingTypeDecoder method decode.

@Override
public RelatedOfferings decode(RelatedOfferingsPropertyType rot) throws DecodingException {
    RelatedOfferings relatedOfferings = new RelatedOfferings();
    relatedOfferings.setNamespace(RelatedOfferingConstants.NS_RO).setDefinition(RelatedOfferingConstants.RELATED_OFFERINGS).setIdentifier(RelatedOfferingConstants.RELATED_OFFERINGS);
    for (RelatedOffering relatedOffering : rot.getRelatedOfferings().getRelatedOfferingArray()) {
        relatedOfferings.getValue().add(parseRelatedOffering(relatedOffering));
    }
    return relatedOfferings;
}
Also used : RelatedOffering(net.opengis.sosro.x10.RelatedOfferingsType.RelatedOffering) RelatedOfferings(org.n52.shetland.ogc.sos.ro.RelatedOfferings)

Example 100 with DecodingException

use of org.n52.svalbard.decode.exception.DecodingException in project arctic-sea by 52North.

the class RelatedPartyTypeDecoder method parseContact.

private Contact parseContact(RelatedPartyType rpt) throws DecodingException {
    ContactType ct = rpt.getContact().getContact();
    Contact contact = new Contact();
    contact.setAddress(parseAddress(ct));
    contact.setContactInstructions(parseContactInstructions(ct));
    contact.setElectronicMailAddress(parseElectronicMailAddress(ct));
    contact.setTelephoneFacsimile(parseTelephoneFacsimile(ct));
    contact.setTelephoneVoice(parseTelephoneVoice(ct));
    contact.setWebsite(parseWebsite(ct));
    return contact;
}
Also used : ContactType(eu.europa.ec.inspire.schemas.base2.x20.ContactType) Contact(org.n52.shetland.inspire.base2.Contact)

Aggregations

Test (org.junit.Test)92 DecodingException (org.n52.svalbard.decode.exception.DecodingException)63 XmlObject (org.apache.xmlbeans.XmlObject)52 JsonNode (com.fasterxml.jackson.databind.JsonNode)25 SweField (org.n52.shetland.ogc.swe.SweField)25 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)23 XmlException (org.apache.xmlbeans.XmlException)23 GetObservationRequest (org.n52.shetland.ogc.sos.request.GetObservationRequest)22 UnsupportedDecoderInputException (org.n52.svalbard.decode.exception.UnsupportedDecoderInputException)21 AbstractProcess (org.n52.shetland.ogc.sensorML.AbstractProcess)13 SystemType (net.opengis.sensorML.x101.SystemType)12 TimeInstant (org.n52.shetland.ogc.gml.time.TimeInstant)12 Before (org.junit.Before)11 AbstractFeature (org.n52.shetland.ogc.gml.AbstractFeature)11 SensorMLDocument (net.opengis.sensorML.x101.SensorMLDocument)10 DateTime (org.joda.time.DateTime)10 SweAbstractDataComponent (org.n52.shetland.ogc.swe.SweAbstractDataComponent)10 XmlString (org.apache.xmlbeans.XmlString)9 SuppressFBWarnings (edu.umd.cs.findbugs.annotations.SuppressFBWarnings)8 Geometry (org.locationtech.jts.geom.Geometry)8