Search in sources :

Example 1 with Hierarchy

use of org.n52.shetland.inspire.ef.Hierarchy 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 Hierarchy

use of org.n52.shetland.inspire.ef.Hierarchy 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)

Aggregations

Hierarchy (org.n52.shetland.inspire.ef.Hierarchy)2 Broader (eu.europa.ec.inspire.schemas.ef.x40.AbstractMonitoringObjectType.Broader)1 Narrower (eu.europa.ec.inspire.schemas.ef.x40.AbstractMonitoringObjectType.Narrower)1