Search in sources :

Example 11 with Nillable

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

the class Iso19139GmdEncoder method encodePhone.

private void encodePhone(CITelephonePropertyType citpt, Referenceable<CiTelephone> referenceable) {
    if (referenceable.isReference()) {
        Reference reference = referenceable.getReference();
        reference.getActuate().map(Actuate::toString).map(ActuateType.Enum::forString).ifPresent(citpt::setActuate);
        reference.getArcrole().ifPresent(citpt::setArcrole);
        reference.getHref().map(URI::toString).ifPresent(citpt::setHref);
        reference.getRole().ifPresent(citpt::setRole);
        reference.getShow().map(Show::toString).map(ShowType.Enum::forString).ifPresent(citpt::setShow);
        reference.getTitle().ifPresent(citpt::setTitle);
        reference.getType().map(Type::toString).map(TypeType.Enum::forString).ifPresent(citpt::setType);
    } else {
        if (referenceable.isInstance()) {
            Nillable<CiTelephone> nillable = referenceable.getInstance();
            if (nillable.isPresent()) {
                CiTelephone ciTelephone = referenceable.getInstance().get();
                CITelephoneType citt = citpt.addNewCITelephone();
                if (ciTelephone.isSetVoice()) {
                    citt.setVoiceArray(listToCharacterStringPropertyTypeArray(ciTelephone.getVoice()));
                }
                if (ciTelephone.isSetFacsimile()) {
                    citt.setFacsimileArray(listToCharacterStringPropertyTypeArray(ciTelephone.getFacsimile()));
                }
                if (ciTelephone.isSetId()) {
                    citt.setId(ciTelephone.getId());
                }
                if (ciTelephone.isSetUuid()) {
                    citt.setUuid(ciTelephone.getUuid());
                }
            } else {
                if (nillable.hasReason()) {
                    citpt.setNilReason(nillable.getNilReason().get());
                }
            }
        }
    }
}
Also used : ActuateType(org.w3.x1999.xlink.ActuateType) Actuate(org.n52.shetland.w3c.xlink.Actuate) CIAddressType(org.isotc211.x2005.gmd.CIAddressType) CIContactPropertyType(org.isotc211.x2005.gmd.CIContactPropertyType) DQDomainConsistencyPropertyType(org.isotc211.x2005.gmd.DQDomainConsistencyPropertyType) CodeType(net.opengis.gml.x32.CodeType) MDMetadataPropertyType(org.isotc211.x2005.gmd.MDMetadataPropertyType) MDMetadataType(org.isotc211.x2005.gmd.MDMetadataType) LocalisedCharacterStringPropertyType(org.isotc211.x2005.gmd.LocalisedCharacterStringPropertyType) CharacterStringPropertyType(org.isotc211.x2005.gco.CharacterStringPropertyType) EXExtentPropertyType(org.isotc211.x2005.gmd.EXExtentPropertyType) CICitationType(org.isotc211.x2005.gmd.CICitationType) MDDataIdentificationType(org.isotc211.x2005.gmd.MDDataIdentificationType) DQDomainConsistencyType(org.isotc211.x2005.gmd.DQDomainConsistencyType) EXVerticalExtentType(org.isotc211.x2005.gmd.EXVerticalExtentType) GmdDateType(org.n52.shetland.iso.gmd.GmdDateType) CodeListValueType(org.isotc211.x2005.gco.CodeListValueType) AbstractCRSType(net.opengis.gml.x32.AbstractCRSType) DQResultPropertyType(org.isotc211.x2005.gmd.DQResultPropertyType) CIDateType(org.isotc211.x2005.gmd.CIDateType) CIContactType(org.isotc211.x2005.gmd.CIContactType) ShowType(org.w3.x1999.xlink.ShowType) MDIdentificationPropertyType(org.isotc211.x2005.gmd.MDIdentificationPropertyType) EXExtentType(org.isotc211.x2005.gmd.EXExtentType) CIOnlineResourcePropertyType(org.isotc211.x2005.gmd.CIOnlineResourcePropertyType) BaseUnitType(net.opengis.gml.x32.BaseUnitType) CITelephonePropertyType(org.isotc211.x2005.gmd.CITelephonePropertyType) ActuateType(org.w3.x1999.xlink.ActuateType) CIAddressPropertyType(org.isotc211.x2005.gmd.CIAddressPropertyType) UnitOfMeasurePropertyType(org.isotc211.x2005.gco.UnitOfMeasurePropertyType) EXVerticalExtentPropertyType(org.isotc211.x2005.gmd.EXVerticalExtentPropertyType) CIOnlineResourceType(org.isotc211.x2005.gmd.CIOnlineResourceType) DQQuantitativeResultType(org.isotc211.x2005.gmd.DQQuantitativeResultType) CIResponsiblePartyType(org.isotc211.x2005.gmd.CIResponsiblePartyType) SupportedType(org.n52.shetland.ogc.SupportedType) LocalisedCharacterStringType(org.isotc211.x2005.gmd.LocalisedCharacterStringType) CICitationPropertyType(org.isotc211.x2005.gmd.CICitationPropertyType) CITelephoneType(org.isotc211.x2005.gmd.CITelephoneType) DQConformanceResultType(org.isotc211.x2005.gmd.DQConformanceResultType) TypeType(org.w3.x1999.xlink.TypeType) Type(org.n52.shetland.w3c.xlink.Type) CIRoleCodePropertyType(org.isotc211.x2005.gmd.CIRoleCodePropertyType) MDDataIdentificationPropertyType(org.isotc211.x2005.gmd.MDDataIdentificationPropertyType) RealPropertyType(org.isotc211.x2005.gco.RealPropertyType) AbstractMDIdentificationType(org.isotc211.x2005.gmd.AbstractMDIdentificationType) PTFreeTextType(org.isotc211.x2005.gmd.PTFreeTextType) SCCRSPropertyType(org.isotc211.x2005.gsr.SCCRSPropertyType) CIResponsiblePartyPropertyType(org.isotc211.x2005.gmd.CIResponsiblePartyPropertyType) CiTelephone(org.n52.shetland.iso.gmd.CiTelephone) Reference(org.n52.shetland.w3c.xlink.Reference) CITelephoneType(org.isotc211.x2005.gmd.CITelephoneType) Show(org.n52.shetland.w3c.xlink.Show) TypeType(org.w3.x1999.xlink.TypeType) ShowType(org.w3.x1999.xlink.ShowType)

Example 12 with Nillable

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

the class Iso19139GmdEncoder method encodeContact.

private void encodeContact(CIContactPropertyType cicpt, Referenceable<CiContact> referenceable) {
    if (referenceable.isReference()) {
        Reference reference = referenceable.getReference();
        reference.getActuate().map(Actuate::toString).map(ActuateType.Enum::forString).ifPresent(cicpt::setActuate);
        reference.getArcrole().ifPresent(cicpt::setArcrole);
        reference.getHref().map(URI::toString).ifPresent(cicpt::setHref);
        reference.getRole().ifPresent(cicpt::setRole);
        reference.getShow().map(Show::toString).map(ShowType.Enum::forString).ifPresent(cicpt::setShow);
        reference.getTitle().ifPresent(cicpt::setTitle);
        reference.getType().map(Type::toString).map(TypeType.Enum::forString).ifPresent(cicpt::setType);
    } else {
        if (referenceable.isInstance()) {
            Nillable<CiContact> nillable = referenceable.getInstance();
            if (nillable.isPresent()) {
                CiContact ciContact = referenceable.getInstance().get();
                CIContactType cict = cicpt.addNewCIContact();
                if (ciContact.getAddress() != null) {
                    encodeCiAddress(cict.addNewAddress(), ciContact.getAddress());
                }
                if (ciContact.getContactInstructionsNillable() != null) {
                    if (ciContact.getContactInstructionsNillable().isPresent()) {
                        cict.addNewContactInstructions().setCharacterString(ciContact.getContactInstructions());
                    } else if (ciContact.getContactInstructionsNillable().hasReason()) {
                        cict.addNewContactInstructions().setNilReason(ciContact.getContactInstructionsNillable().getNilReason().get());
                    }
                }
                if (ciContact.isSetHoursOfService()) {
                    if (ciContact.getHoursOfServiceNillable().isPresent()) {
                        cict.addNewHoursOfService().setCharacterString(ciContact.getHoursOfService());
                    } else if (ciContact.getHoursOfServiceNillable().hasReason()) {
                        cict.addNewHoursOfService().setNilReason(ciContact.getHoursOfServiceNillable().getNilReason().get());
                    }
                }
                if (ciContact.getOnlineResourceReferenceable() != null) {
                    encodeOnlineResource(cict.addNewOnlineResource(), ciContact.getOnlineResourceReferenceable());
                }
                if (ciContact.isSetPhone()) {
                    encodePhone(cict.addNewPhone(), ciContact.getPhone());
                }
            } else {
                if (nillable.hasReason()) {
                    cicpt.setNilReason(nillable.getNilReason().get());
                }
            }
        }
    }
}
Also used : ActuateType(org.w3.x1999.xlink.ActuateType) Actuate(org.n52.shetland.w3c.xlink.Actuate) CIAddressType(org.isotc211.x2005.gmd.CIAddressType) CIContactPropertyType(org.isotc211.x2005.gmd.CIContactPropertyType) DQDomainConsistencyPropertyType(org.isotc211.x2005.gmd.DQDomainConsistencyPropertyType) CodeType(net.opengis.gml.x32.CodeType) MDMetadataPropertyType(org.isotc211.x2005.gmd.MDMetadataPropertyType) MDMetadataType(org.isotc211.x2005.gmd.MDMetadataType) LocalisedCharacterStringPropertyType(org.isotc211.x2005.gmd.LocalisedCharacterStringPropertyType) CharacterStringPropertyType(org.isotc211.x2005.gco.CharacterStringPropertyType) EXExtentPropertyType(org.isotc211.x2005.gmd.EXExtentPropertyType) CICitationType(org.isotc211.x2005.gmd.CICitationType) MDDataIdentificationType(org.isotc211.x2005.gmd.MDDataIdentificationType) DQDomainConsistencyType(org.isotc211.x2005.gmd.DQDomainConsistencyType) EXVerticalExtentType(org.isotc211.x2005.gmd.EXVerticalExtentType) GmdDateType(org.n52.shetland.iso.gmd.GmdDateType) CodeListValueType(org.isotc211.x2005.gco.CodeListValueType) AbstractCRSType(net.opengis.gml.x32.AbstractCRSType) DQResultPropertyType(org.isotc211.x2005.gmd.DQResultPropertyType) CIDateType(org.isotc211.x2005.gmd.CIDateType) CIContactType(org.isotc211.x2005.gmd.CIContactType) ShowType(org.w3.x1999.xlink.ShowType) MDIdentificationPropertyType(org.isotc211.x2005.gmd.MDIdentificationPropertyType) EXExtentType(org.isotc211.x2005.gmd.EXExtentType) CIOnlineResourcePropertyType(org.isotc211.x2005.gmd.CIOnlineResourcePropertyType) BaseUnitType(net.opengis.gml.x32.BaseUnitType) CITelephonePropertyType(org.isotc211.x2005.gmd.CITelephonePropertyType) ActuateType(org.w3.x1999.xlink.ActuateType) CIAddressPropertyType(org.isotc211.x2005.gmd.CIAddressPropertyType) UnitOfMeasurePropertyType(org.isotc211.x2005.gco.UnitOfMeasurePropertyType) EXVerticalExtentPropertyType(org.isotc211.x2005.gmd.EXVerticalExtentPropertyType) CIOnlineResourceType(org.isotc211.x2005.gmd.CIOnlineResourceType) DQQuantitativeResultType(org.isotc211.x2005.gmd.DQQuantitativeResultType) CIResponsiblePartyType(org.isotc211.x2005.gmd.CIResponsiblePartyType) SupportedType(org.n52.shetland.ogc.SupportedType) LocalisedCharacterStringType(org.isotc211.x2005.gmd.LocalisedCharacterStringType) CICitationPropertyType(org.isotc211.x2005.gmd.CICitationPropertyType) CITelephoneType(org.isotc211.x2005.gmd.CITelephoneType) DQConformanceResultType(org.isotc211.x2005.gmd.DQConformanceResultType) TypeType(org.w3.x1999.xlink.TypeType) Type(org.n52.shetland.w3c.xlink.Type) CIRoleCodePropertyType(org.isotc211.x2005.gmd.CIRoleCodePropertyType) MDDataIdentificationPropertyType(org.isotc211.x2005.gmd.MDDataIdentificationPropertyType) RealPropertyType(org.isotc211.x2005.gco.RealPropertyType) AbstractMDIdentificationType(org.isotc211.x2005.gmd.AbstractMDIdentificationType) PTFreeTextType(org.isotc211.x2005.gmd.PTFreeTextType) SCCRSPropertyType(org.isotc211.x2005.gsr.SCCRSPropertyType) CIResponsiblePartyPropertyType(org.isotc211.x2005.gmd.CIResponsiblePartyPropertyType) Reference(org.n52.shetland.w3c.xlink.Reference) CIContactType(org.isotc211.x2005.gmd.CIContactType) Show(org.n52.shetland.w3c.xlink.Show) TypeType(org.w3.x1999.xlink.TypeType) CiContact(org.n52.shetland.iso.gmd.CiContact) ShowType(org.w3.x1999.xlink.ShowType)

Example 13 with Nillable

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

the class Iso19139GmdEncoder method encodeCiAddress.

private void encodeCiAddress(CIAddressPropertyType ciapt, Referenceable<CiAddress> referenceable) {
    if (referenceable.isReference()) {
        Reference reference = referenceable.getReference();
        reference.getActuate().map(Actuate::toString).map(ActuateType.Enum::forString).ifPresent(ciapt::setActuate);
        reference.getArcrole().ifPresent(ciapt::setArcrole);
        reference.getHref().map(URI::toString).ifPresent(ciapt::setHref);
        reference.getRole().ifPresent(ciapt::setRole);
        reference.getShow().map(Show::toString).map(ShowType.Enum::forString).ifPresent(ciapt::setShow);
        reference.getTitle().ifPresent(ciapt::setTitle);
        reference.getType().map(Type::toString).map(TypeType.Enum::forString).ifPresent(ciapt::setType);
    } else {
        if (referenceable.isInstance()) {
            Nillable<CiAddress> nillable = referenceable.getInstance();
            if (nillable.isPresent()) {
                CiAddress ciAddress = referenceable.getInstance().get();
                CIAddressType ciat = ciapt.addNewCIAddress();
                if (ciAddress.isSetAdministrativeArea()) {
                    ciat.addNewAdministrativeArea().setCharacterString(ciAddress.getAdministrativeArea());
                }
                if (ciAddress.isSetCity()) {
                    ciat.addNewCity().setCharacterString(ciAddress.getCity());
                }
                if (ciAddress.isSetCountry()) {
                    ciat.addNewCountry().setCharacterString(ciAddress.getCountry());
                }
                if (ciAddress.isSetPostalCode()) {
                    ciat.addNewPostalCode().setCharacterString(ciAddress.getPostalCode());
                }
                if (ciAddress.hasDeliveryPoints()) {
                    ciat.setDeliveryPointArray(listToCharacterStringPropertyTypeArray(ciAddress.getDeliveryPoints()));
                }
                if (ciAddress.hasElectronicMailAddresses()) {
                    ciat.setElectronicMailAddressArray(listToCharacterStringPropertyTypeArray(Lists.newArrayList(ciAddress.getElectronicMailAddresses())));
                }
                if (ciAddress.isSetId()) {
                    ciat.setId(ciAddress.getId());
                }
                if (ciAddress.isSetUuid()) {
                    ciat.setUuid(ciAddress.getUuid());
                }
            } else {
                if (nillable.hasReason()) {
                    ciapt.setNilReason(nillable.getNilReason().get());
                }
            }
        }
    }
}
Also used : ActuateType(org.w3.x1999.xlink.ActuateType) Actuate(org.n52.shetland.w3c.xlink.Actuate) CIAddressType(org.isotc211.x2005.gmd.CIAddressType) CIContactPropertyType(org.isotc211.x2005.gmd.CIContactPropertyType) DQDomainConsistencyPropertyType(org.isotc211.x2005.gmd.DQDomainConsistencyPropertyType) CodeType(net.opengis.gml.x32.CodeType) MDMetadataPropertyType(org.isotc211.x2005.gmd.MDMetadataPropertyType) MDMetadataType(org.isotc211.x2005.gmd.MDMetadataType) LocalisedCharacterStringPropertyType(org.isotc211.x2005.gmd.LocalisedCharacterStringPropertyType) CharacterStringPropertyType(org.isotc211.x2005.gco.CharacterStringPropertyType) EXExtentPropertyType(org.isotc211.x2005.gmd.EXExtentPropertyType) CICitationType(org.isotc211.x2005.gmd.CICitationType) MDDataIdentificationType(org.isotc211.x2005.gmd.MDDataIdentificationType) DQDomainConsistencyType(org.isotc211.x2005.gmd.DQDomainConsistencyType) EXVerticalExtentType(org.isotc211.x2005.gmd.EXVerticalExtentType) GmdDateType(org.n52.shetland.iso.gmd.GmdDateType) CodeListValueType(org.isotc211.x2005.gco.CodeListValueType) AbstractCRSType(net.opengis.gml.x32.AbstractCRSType) DQResultPropertyType(org.isotc211.x2005.gmd.DQResultPropertyType) CIDateType(org.isotc211.x2005.gmd.CIDateType) CIContactType(org.isotc211.x2005.gmd.CIContactType) ShowType(org.w3.x1999.xlink.ShowType) MDIdentificationPropertyType(org.isotc211.x2005.gmd.MDIdentificationPropertyType) EXExtentType(org.isotc211.x2005.gmd.EXExtentType) CIOnlineResourcePropertyType(org.isotc211.x2005.gmd.CIOnlineResourcePropertyType) BaseUnitType(net.opengis.gml.x32.BaseUnitType) CITelephonePropertyType(org.isotc211.x2005.gmd.CITelephonePropertyType) ActuateType(org.w3.x1999.xlink.ActuateType) CIAddressPropertyType(org.isotc211.x2005.gmd.CIAddressPropertyType) UnitOfMeasurePropertyType(org.isotc211.x2005.gco.UnitOfMeasurePropertyType) EXVerticalExtentPropertyType(org.isotc211.x2005.gmd.EXVerticalExtentPropertyType) CIOnlineResourceType(org.isotc211.x2005.gmd.CIOnlineResourceType) DQQuantitativeResultType(org.isotc211.x2005.gmd.DQQuantitativeResultType) CIResponsiblePartyType(org.isotc211.x2005.gmd.CIResponsiblePartyType) SupportedType(org.n52.shetland.ogc.SupportedType) LocalisedCharacterStringType(org.isotc211.x2005.gmd.LocalisedCharacterStringType) CICitationPropertyType(org.isotc211.x2005.gmd.CICitationPropertyType) CITelephoneType(org.isotc211.x2005.gmd.CITelephoneType) DQConformanceResultType(org.isotc211.x2005.gmd.DQConformanceResultType) TypeType(org.w3.x1999.xlink.TypeType) Type(org.n52.shetland.w3c.xlink.Type) CIRoleCodePropertyType(org.isotc211.x2005.gmd.CIRoleCodePropertyType) MDDataIdentificationPropertyType(org.isotc211.x2005.gmd.MDDataIdentificationPropertyType) RealPropertyType(org.isotc211.x2005.gco.RealPropertyType) AbstractMDIdentificationType(org.isotc211.x2005.gmd.AbstractMDIdentificationType) PTFreeTextType(org.isotc211.x2005.gmd.PTFreeTextType) SCCRSPropertyType(org.isotc211.x2005.gsr.SCCRSPropertyType) CIResponsiblePartyPropertyType(org.isotc211.x2005.gmd.CIResponsiblePartyPropertyType) Reference(org.n52.shetland.w3c.xlink.Reference) Show(org.n52.shetland.w3c.xlink.Show) CiAddress(org.n52.shetland.iso.gmd.CiAddress) CIAddressType(org.isotc211.x2005.gmd.CIAddressType) TypeType(org.w3.x1999.xlink.TypeType) ShowType(org.w3.x1999.xlink.ShowType)

Example 14 with Nillable

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

the class GmlEncoderv321 method createVerticalCRS.

private XmlObject createVerticalCRS(VerticalCRS verticalCRS, EncodingContext ctx) throws EncodingException {
    VerticalCRSType vcrst = VerticalCRSType.Factory.newInstance();
    addAbstractCRSValues(vcrst, verticalCRS);
    // verticalCS
    Referenceable<VerticalCS> verticalCS = verticalCRS.getVerticalCS();
    VerticalCSPropertyType vcspt = vcrst.addNewVerticalCS();
    if (verticalCS.isReference()) {
        Reference reference = verticalCS.getReference();
        reference.getActuate().map(Actuate::toString).map(ActuateType.Enum::forString).ifPresent(vcspt::setActuate);
        reference.getArcrole().ifPresent(vcspt::setArcrole);
        reference.getHref().map(URI::toString).ifPresent(vcspt::setHref);
        reference.getRole().ifPresent(vcspt::setRole);
        reference.getShow().map(Show::toString).map(ShowType.Enum::forString).ifPresent(vcspt::setShow);
        reference.getTitle().ifPresent(vcspt::setTitle);
        reference.getType().map(Type::toString).map(TypeType.Enum::forString).ifPresent(vcspt::setType);
    } else {
        if (verticalCS.isInstance()) {
            Nillable<VerticalCS> nillable = verticalCS.getInstance();
            if (nillable.isPresent()) {
                XmlObject xml = createVerticalCS(nillable.get(), EncodingContext.empty());
                if (xml != null && xml instanceof VerticalCSType) {
                    vcspt.set((VerticalCSType) xml);
                } else {
                    vcspt.setNil();
                    vcspt.setNilReason(Nillable.missing().get());
                }
            } else {
                vcspt.setNil();
                if (nillable.hasReason()) {
                    vcspt.setNilReason(nillable.getNilReason().get());
                } else {
                    vcspt.setNilReason(Nillable.missing().get());
                }
            }
        }
    }
    // verticalDatum
    Referenceable<VerticalDatum> verticalDatum = verticalCRS.getVerticalDatum();
    VerticalDatumPropertyType vdpt = vcrst.addNewVerticalDatum();
    if (verticalDatum.isReference()) {
        Reference reference = verticalDatum.getReference();
        reference.getActuate().map(Actuate::toString).map(ActuateType.Enum::forString).ifPresent(vdpt::setActuate);
        reference.getArcrole().ifPresent(vdpt::setArcrole);
        reference.getHref().map(URI::toString).ifPresent(vdpt::setHref);
        reference.getRole().ifPresent(vdpt::setRole);
        reference.getShow().map(Show::toString).map(ShowType.Enum::forString).ifPresent(vdpt::setShow);
        reference.getTitle().ifPresent(vdpt::setTitle);
        reference.getType().map(Type::toString).map(TypeType.Enum::forString).ifPresent(vdpt::setType);
    } else {
        if (verticalDatum.isInstance()) {
            Nillable<VerticalDatum> nillable = verticalDatum.getInstance();
            if (nillable.isPresent()) {
                XmlObject xml = createVerticalDatum(nillable.get(), EncodingContext.empty());
                if (xml != null && xml instanceof VerticalDatumType) {
                    vdpt.setVerticalDatum((VerticalDatumType) xml);
                } else {
                    vdpt.setNil();
                    vdpt.setNilReason(Nillable.missing().get());
                }
            } else {
                vdpt.setNil();
                if (nillable.hasReason()) {
                    vdpt.setNilReason(nillable.getNilReason().get());
                } else {
                    vdpt.setNilReason(Nillable.missing().get());
                }
            }
        }
    }
    if (ctx.has(XmlBeansEncodingFlags.PROPERTY_TYPE)) {
        VerticalCRSPropertyType vcrspt = VerticalCRSPropertyType.Factory.newInstance();
        vcrspt.setVerticalCRS(vcrst);
        return vcrspt;
    }
    return vcrst;
}
Also used : ActuateType(org.w3.x1999.xlink.ActuateType) Reference(org.n52.shetland.w3c.xlink.Reference) VerticalDatumPropertyType(net.opengis.gml.x32.VerticalDatumPropertyType) VerticalCSPropertyType(net.opengis.gml.x32.VerticalCSPropertyType) VerticalCSType(net.opengis.gml.x32.VerticalCSType) VerticalDatum(org.n52.shetland.ogc.gml.VerticalDatum) 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) VerticalCS(org.n52.shetland.ogc.gml.VerticalCS) VerticalDatumType(net.opengis.gml.x32.VerticalDatumType) VerticalCRSPropertyType(net.opengis.gml.x32.VerticalCRSPropertyType) Show(org.n52.shetland.w3c.xlink.Show) XmlObject(org.apache.xmlbeans.XmlObject) TypeType(org.w3.x1999.xlink.TypeType) VerticalCRSType(net.opengis.gml.x32.VerticalCRSType) ShowType(org.w3.x1999.xlink.ShowType)

Example 15 with Nillable

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

the class GmlEncoderv321 method addAbstractDatumValues.

private void addAbstractDatumValues(AbstractDatumType adt, AbstractDatum abstractDatum, EncodingContext ctx) throws EncodingException {
    addDefinitonValues(adt, abstractDatum);
    if (abstractDatum.hasAnchorDefinition()) {
        adt.setAnchorDefinition(createCodeType(abstractDatum.getAnchorDefinition()));
    }
    if (abstractDatum.hasDomainOfValidity()) {
        net.opengis.gml.x32.DomainOfValidityDocument.DomainOfValidity dov = adt.addNewDomainOfValidity();
        Referenceable<DomainOfValidity> domainOfValidity = abstractDatum.getDomainOfValidity();
        if (domainOfValidity.isReference()) {
            Reference reference = domainOfValidity.getReference();
            reference.getActuate().map(Actuate::toString).map(ActuateType.Enum::forString).ifPresent(dov::setActuate);
            reference.getArcrole().ifPresent(dov::setArcrole);
            reference.getHref().map(URI::toString).ifPresent(dov::setHref);
            reference.getRole().ifPresent(dov::setRole);
            reference.getShow().map(Show::toString).map(ShowType.Enum::forString).ifPresent(dov::setShow);
            reference.getTitle().ifPresent(dov::setTitle);
            reference.getType().map(Type::toString).map(TypeType.Enum::forString).ifPresent(dov::setType);
        } else {
            if (domainOfValidity.isInstance()) {
                Nillable<DomainOfValidity> nillable = domainOfValidity.getInstance();
                if (nillable.isPresent()) {
                    net.opengis.gml.x32.DomainOfValidityDocument.DomainOfValidity xml = createDomainOfValidity(nillable.get(), EncodingContext.empty());
                    if (xml != null) {
                        dov.set(xml);
                    } else {
                        dov.setNil();
                        dov.setNilReason(Nillable.missing().get());
                    }
                } else {
                    dov.setNil();
                    if (nillable.hasReason()) {
                        dov.setNilReason(nillable.getNilReason().get());
                    } else {
                        dov.setNilReason(Nillable.missing().get());
                    }
                }
            }
        }
    }
    if (abstractDatum.hasRealizationEpoch()) {
        adt.setRealizationEpoch(abstractDatum.getRealizationEpoch().toCalendar(Locale.ROOT));
    }
    abstractDatum.getScope().forEach(scope -> adt.addNewScope().setStringValue(scope));
}
Also used : ActuateType(org.w3.x1999.xlink.ActuateType) DomainOfValidity(org.n52.shetland.ogc.gml.DomainOfValidity) Reference(org.n52.shetland.w3c.xlink.Reference) 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) Show(org.n52.shetland.w3c.xlink.Show) 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