Search in sources :

Example 1 with AbstractMonitoringObject

use of org.n52.shetland.inspire.ef.AbstractMonitoringObject in project arctic-sea by 52North.

the class AbstractMonitoringObjectEncoder method setNarrower.

private void setNarrower(AbstractMonitoringObjectType amot, AbstractMonitoringObject abstractMonitoringObject) throws EncodingException {
    if (abstractMonitoringObject.isSetNarrower()) {
        for (Hierarchy narrower : abstractMonitoringObject.getNarrower()) {
            if (narrower.isSetSimpleAttrs()) {
                Narrower n = amot.addNewNarrower();
                n.setHref(narrower.getSimpleAttrs().getHref());
                if (narrower.getSimpleAttrs().isSetTitle()) {
                    n.setTitle(narrower.getSimpleAttrs().getTitle());
                }
            } else {
                amot.addNewNarrower().addNewHierarchy().set(encodeEF(narrower));
            }
        }
    }
}
Also used : Hierarchy(org.n52.shetland.inspire.ef.Hierarchy) Narrower(eu.europa.ec.inspire.schemas.ef.x40.AbstractMonitoringObjectType.Narrower)

Example 2 with AbstractMonitoringObject

use of org.n52.shetland.inspire.ef.AbstractMonitoringObject in project arctic-sea by 52North.

the class AbstractMonitoringObjectEncoder method setBroader.

private void setBroader(AbstractMonitoringObjectType amot, AbstractMonitoringObject abstractMonitoringObject) throws EncodingException {
    if (abstractMonitoringObject.isSetBroader()) {
        Hierarchy broader = abstractMonitoringObject.getBroader();
        if (broader.isSetSimpleAttrs()) {
            Broader b = amot.addNewBroader();
            b.setHref(broader.getSimpleAttrs().getHref());
            if (broader.getSimpleAttrs().isSetTitle()) {
                b.setTitle(broader.getSimpleAttrs().getTitle());
            }
        } else {
            amot.addNewBroader().addNewHierarchy().set(encodeEF(broader));
        }
    }
}
Also used : Hierarchy(org.n52.shetland.inspire.ef.Hierarchy) Broader(eu.europa.ec.inspire.schemas.ef.x40.AbstractMonitoringObjectType.Broader)

Example 3 with AbstractMonitoringObject

use of org.n52.shetland.inspire.ef.AbstractMonitoringObject in project arctic-sea by 52North.

the class AbstractMonitoringObjectEncoder method setSupersedes.

private void setSupersedes(AbstractMonitoringObjectType amot, AbstractMonitoringObject abstractMonitoringObject) throws EncodingException {
    if (abstractMonitoringObject.isSetSupersedes()) {
        for (AbstractMonitoringObject supersedes : abstractMonitoringObject.getSupersedes()) {
            if (supersedes.isSetSimpleAttrs()) {
                Supersedes s = amot.addNewSupersedes();
                s.setHref(supersedes.getSimpleAttrs().getHref());
                if (supersedes.getSimpleAttrs().isSetTitle()) {
                    s.setTitle(supersedes.getSimpleAttrs().getTitle());
                }
            } else {
                amot.addNewSupersedes().addNewAbstractMonitoringObject().set(encodeEF(supersedes));
            }
        }
    }
}
Also used : AbstractMonitoringObject(org.n52.shetland.inspire.ef.AbstractMonitoringObject) Supersedes(eu.europa.ec.inspire.schemas.ef.x40.AbstractMonitoringObjectType.Supersedes)

Example 4 with AbstractMonitoringObject

use of org.n52.shetland.inspire.ef.AbstractMonitoringObject in project arctic-sea by 52North.

the class AbstractMonitoringObjectEncoder method setLegalBackground.

private void setLegalBackground(AbstractMonitoringObjectType amot, AbstractMonitoringObject abstractMonitoringObject) throws EncodingException {
    if (abstractMonitoringObject.isSetLegalBackground()) {
        for (LegislationCitation legislationCitation : abstractMonitoringObject.getLegalBackground()) {
            if (legislationCitation.isSetSimpleAttrs()) {
                SimpleAttrs simpleAttrs = legislationCitation.getSimpleAttrs();
                if (simpleAttrs.isSetHref()) {
                    LegalBackground lb = amot.addNewLegalBackground();
                    lb.setHref(simpleAttrs.getHref());
                    if (simpleAttrs.isSetTitle()) {
                        lb.setTitle(simpleAttrs.getTitle());
                    }
                }
            } else {
                amot.addNewLegalBackground().addNewLegislationCitation().set(encodeEF(legislationCitation));
            }
        }
    }
}
Also used : SimpleAttrs(org.n52.shetland.w3c.xlink.SimpleAttrs) LegislationCitation(org.n52.shetland.inspire.base2.LegislationCitation) LegalBackground(eu.europa.ec.inspire.schemas.ef.x40.AbstractMonitoringObjectType.LegalBackground)

Example 5 with AbstractMonitoringObject

use of org.n52.shetland.inspire.ef.AbstractMonitoringObject in project arctic-sea by 52North.

the class AbstractMonitoringObjectEncoder method setObservingCapability.

private void setObservingCapability(AbstractMonitoringObjectType amot, AbstractMonitoringObject abstractMonitoringObject) throws EncodingException {
    if (abstractMonitoringObject.isSetObservingCapability()) {
        for (ObservingCapability observingCapability : abstractMonitoringObject.getObservingCapability()) {
            if (observingCapability.isSetHref()) {
                eu.europa.ec.inspire.schemas.ef.x40.AbstractMonitoringObjectType.ObservingCapability oc = amot.addNewObservingCapability();
                oc.setHref(observingCapability.getHref());
                if (observingCapability.isSetTitle()) {
                    oc.setTitle(observingCapability.getTitle());
                }
            } else {
                amot.addNewObservingCapability().addNewObservingCapability().set(encodeEF(observingCapability));
            }
        }
    }
}
Also used : AbstractMonitoringObjectType(eu.europa.ec.inspire.schemas.ef.x40.AbstractMonitoringObjectType) ObservingCapability(org.n52.shetland.inspire.ef.ObservingCapability)

Aggregations

AbstractMonitoringObject (org.n52.shetland.inspire.ef.AbstractMonitoringObject)2 Hierarchy (org.n52.shetland.inspire.ef.Hierarchy)2 AbstractMonitoringObjectPropertyType (eu.europa.ec.inspire.schemas.ef.x40.AbstractMonitoringObjectPropertyType)1 AbstractMonitoringObjectType (eu.europa.ec.inspire.schemas.ef.x40.AbstractMonitoringObjectType)1 Broader (eu.europa.ec.inspire.schemas.ef.x40.AbstractMonitoringObjectType.Broader)1 LegalBackground (eu.europa.ec.inspire.schemas.ef.x40.AbstractMonitoringObjectType.LegalBackground)1 Narrower (eu.europa.ec.inspire.schemas.ef.x40.AbstractMonitoringObjectType.Narrower)1 Supersedes (eu.europa.ec.inspire.schemas.ef.x40.AbstractMonitoringObjectType.Supersedes)1 LegislationCitation (org.n52.shetland.inspire.base2.LegislationCitation)1 ObservingCapability (org.n52.shetland.inspire.ef.ObservingCapability)1 SimpleAttrs (org.n52.shetland.w3c.xlink.SimpleAttrs)1