Search in sources :

Example 16 with Nillable

use of org.n52.shetland.w3c.Nillable in project arctic-sea by 52North.

the class GmlEncoderv321 method addAbstractCoordincateSystemValues.

private void addAbstractCoordincateSystemValues(AbstractCoordinateSystemType acst, AbstractCoordinateSystem abstractCoordinateSystem) throws EncodingException {
    addDefinitonValues(acst, abstractCoordinateSystem);
    acst.setAggregationType(AggregationType.Enum.forString(abstractCoordinateSystem.getAggregation().name()));
    for (Referenceable<CoordinateSystemAxis> coordinateSystemAxis : abstractCoordinateSystem.getCoordinateSystemAxis()) {
        CoordinateSystemAxisPropertyType csapt = acst.addNewAxis();
        if (coordinateSystemAxis.isReference()) {
            Reference reference = coordinateSystemAxis.getReference();
            reference.getActuate().map(Actuate::toString).map(ActuateType.Enum::forString).ifPresent(csapt::setActuate);
            reference.getArcrole().ifPresent(csapt::setArcrole);
            reference.getHref().map(URI::toString).ifPresent(csapt::setHref);
            reference.getRole().ifPresent(csapt::setRole);
            reference.getShow().map(Show::toString).map(ShowType.Enum::forString).ifPresent(csapt::setShow);
            reference.getTitle().ifPresent(csapt::setTitle);
            reference.getType().map(Type::toString).map(TypeType.Enum::forString).ifPresent(csapt::setType);
        } else {
            if (coordinateSystemAxis.isInstance()) {
                Nillable<CoordinateSystemAxis> nillable = coordinateSystemAxis.getInstance();
                if (nillable.isPresent()) {
                    XmlObject xml = createCoordinateSystemAxis(nillable.get(), EncodingContext.empty());
                    if (xml != null && xml instanceof CoordinateSystemAxisType) {
                        csapt.addNewCoordinateSystemAxis().set(xml);
                    } else {
                        csapt.setNil();
                        csapt.setNilReason(Nillable.missing().get());
                    }
                } else {
                    csapt.setNil();
                    if (nillable.hasReason()) {
                        csapt.setNilReason(nillable.getNilReason().get());
                    } else {
                        csapt.setNilReason(Nillable.missing().get());
                    }
                }
            }
        }
    }
}
Also used : ActuateType(org.w3.x1999.xlink.ActuateType) Reference(org.n52.shetland.w3c.xlink.Reference) CoordinateSystemAxis(org.n52.shetland.ogc.gml.CoordinateSystemAxis) Actuate(org.n52.shetland.w3c.xlink.Actuate) EnvelopeType(net.opengis.gml.x32.EnvelopeType) MultiPointType(net.opengis.gml.x32.MultiPointType) VerticalDatumPropertyType(net.opengis.gml.x32.VerticalDatumPropertyType) CodeType(net.opengis.gml.x32.CodeType) DirectPositionListType(net.opengis.gml.x32.DirectPositionListType) CoordinateSystemAxisPropertyType(net.opengis.gml.x32.CoordinateSystemAxisPropertyType) VerticalCSType(net.opengis.gml.x32.VerticalCSType) TimePeriodPropertyType(net.opengis.gml.x32.TimePeriodPropertyType) LineStringType(net.opengis.gml.x32.LineStringType) CoordinateSystemAxisType(net.opengis.gml.x32.CoordinateSystemAxisType) FeaturePropertyType(net.opengis.gml.x32.FeaturePropertyType) TimeInstantPropertyType(net.opengis.gml.x32.TimeInstantPropertyType) TimeIndeterminateValueType(net.opengis.gml.x32.TimeIndeterminateValueType) GeometryPropertyType(net.opengis.gml.x32.GeometryPropertyType) PolygonType(net.opengis.gml.x32.PolygonType) VerticalDatumType(net.opengis.gml.x32.VerticalDatumType) MultiCurveType(net.opengis.gml.x32.MultiCurveType) AggregationType(net.opengis.gml.x32.AggregationType) AbstractCRSType(net.opengis.gml.x32.AbstractCRSType) ShowType(org.w3.x1999.xlink.ShowType) AbstractRingPropertyType(net.opengis.gml.x32.AbstractRingPropertyType) LinearRingType(net.opengis.gml.x32.LinearRingType) EXExtentType(org.isotc211.x2005.gmd.EXExtentType) TimePeriodType(net.opengis.gml.x32.TimePeriodType) ReferenceType(net.opengis.gml.x32.ReferenceType) TimeInstantType(net.opengis.gml.x32.TimeInstantType) GenericMetaDataType(net.opengis.gml.x32.GenericMetaDataType) ActuateType(org.w3.x1999.xlink.ActuateType) TimePositionType(net.opengis.gml.x32.TimePositionType) VerticalCRSType(net.opengis.gml.x32.VerticalCRSType) CurvePropertyType(net.opengis.gml.x32.CurvePropertyType) DefinitionType(net.opengis.gml.x32.DefinitionType) AbstractCoordinateSystemType(net.opengis.gml.x32.AbstractCoordinateSystemType) AbstractDatumType(net.opengis.gml.x32.AbstractDatumType) AbstractRingType(net.opengis.gml.x32.AbstractRingType) MeasureType(net.opengis.gml.x32.MeasureType) VerticalCSPropertyType(net.opengis.gml.x32.VerticalCSPropertyType) CodeWithAuthorityType(net.opengis.gml.x32.CodeWithAuthorityType) TypeType(org.w3.x1999.xlink.TypeType) Type(org.n52.shetland.w3c.xlink.Type) AbstractGeometryType(net.opengis.gml.x32.AbstractGeometryType) DirectPositionType(net.opengis.gml.x32.DirectPositionType) FeatureCollectionType(net.opengis.gml.x32.FeatureCollectionType) PointType(net.opengis.gml.x32.PointType) VerticalCRSPropertyType(net.opengis.gml.x32.VerticalCRSPropertyType) CoordinateSystemAxisType(net.opengis.gml.x32.CoordinateSystemAxisType) Show(org.n52.shetland.w3c.xlink.Show) XmlObject(org.apache.xmlbeans.XmlObject) CoordinateSystemAxisPropertyType(net.opengis.gml.x32.CoordinateSystemAxisPropertyType) TypeType(org.w3.x1999.xlink.TypeType) ShowType(org.w3.x1999.xlink.ShowType)

Aggregations

Actuate (org.n52.shetland.w3c.xlink.Actuate)12 Reference (org.n52.shetland.w3c.xlink.Reference)12 Show (org.n52.shetland.w3c.xlink.Show)12 Type (org.n52.shetland.w3c.xlink.Type)12 ActuateType (org.w3.x1999.xlink.ActuateType)12 ShowType (org.w3.x1999.xlink.ShowType)12 TypeType (org.w3.x1999.xlink.TypeType)12 AbstractCRSType (net.opengis.gml.x32.AbstractCRSType)10 CodeType (net.opengis.gml.x32.CodeType)10 EXExtentType (org.isotc211.x2005.gmd.EXExtentType)10 CIResponsiblePartyPropertyType (org.isotc211.x2005.gmd.CIResponsiblePartyPropertyType)8 CIResponsiblePartyType (org.isotc211.x2005.gmd.CIResponsiblePartyType)8 BaseUnitType (net.opengis.gml.x32.BaseUnitType)6 VerticalDatumPropertyType (net.opengis.gml.x32.VerticalDatumPropertyType)5 VerticalDatumType (net.opengis.gml.x32.VerticalDatumType)5 XmlObject (org.apache.xmlbeans.XmlObject)4 AbstractCoordinateSystemType (net.opengis.gml.x32.AbstractCoordinateSystemType)3 AbstractDatumType (net.opengis.gml.x32.AbstractDatumType)3 AbstractGeometryType (net.opengis.gml.x32.AbstractGeometryType)3 AbstractRingPropertyType (net.opengis.gml.x32.AbstractRingPropertyType)3