Search in sources :

Example 1 with DQResultPropertyType

use of org.isotc211.x2005.gmd.DQResultPropertyType in project arctic-sea by 52North.

the class Iso19139GmdEncoder method encodeGmdConformanceResult.

private void encodeGmdConformanceResult(DQResultPropertyType xbResult, GmdConformanceResult gmdConformanceResult) {
    DQConformanceResultType dqConformanceResultType = (DQConformanceResultType) xbResult.addNewAbstractDQResult().substitute(QN_GMD_CONFORMANCE_RESULT, DQConformanceResultType.type);
    if (gmdConformanceResult.isSetPassNilReason()) {
        dqConformanceResultType.addNewPass().setNilReason(gmdConformanceResult.getPassNilReason().name());
    } else {
        dqConformanceResultType.addNewPass().setBoolean(gmdConformanceResult.isPass());
    }
    dqConformanceResultType.addNewExplanation().setCharacterString(gmdConformanceResult.getSpecification().getExplanation());
    encodeCiCitation(dqConformanceResultType.addNewSpecification(), gmdConformanceResult.getSpecification().getCitation());
}
Also used : DQConformanceResultType(org.isotc211.x2005.gmd.DQConformanceResultType)

Example 2 with DQResultPropertyType

use of org.isotc211.x2005.gmd.DQResultPropertyType in project arctic-sea by 52North.

the class Iso19139GmdEncoder method encodeGmdDomainConsistency.

private XmlObject encodeGmdDomainConsistency(GmdDomainConsistency element, EncodingContext additionalValues) throws EncodingException {
    if (additionalValues.has(XmlBeansEncodingFlags.DOCUMENT)) {
        DQDomainConsistencyDocument document = DQDomainConsistencyDocument.Factory.newInstance(getXmlOptions());
        DQResultPropertyType addNewResult = document.addNewDQDomainConsistency().addNewResult();
        encodeGmdDomainConsistency(addNewResult, element);
        return document;
    } else if (additionalValues.has(XmlBeansEncodingFlags.PROPERTY_TYPE)) {
        DQDomainConsistencyPropertyType propertyType = DQDomainConsistencyPropertyType.Factory.newInstance(getXmlOptions());
        DQResultPropertyType addNewResult = propertyType.addNewDQDomainConsistency().addNewResult();
        encodeGmdDomainConsistency(addNewResult, element);
        return propertyType;
    } else {
        DQDomainConsistencyType type = DQDomainConsistencyType.Factory.newInstance(getXmlOptions());
        DQResultPropertyType addNewResult = type.addNewResult();
        encodeGmdDomainConsistency(addNewResult, element);
        return type;
    }
}
Also used : DQDomainConsistencyType(org.isotc211.x2005.gmd.DQDomainConsistencyType) DQDomainConsistencyDocument(org.isotc211.x2005.gmd.DQDomainConsistencyDocument) DQDomainConsistencyPropertyType(org.isotc211.x2005.gmd.DQDomainConsistencyPropertyType) DQResultPropertyType(org.isotc211.x2005.gmd.DQResultPropertyType)

Example 3 with DQResultPropertyType

use of org.isotc211.x2005.gmd.DQResultPropertyType in project arctic-sea by 52North.

the class Iso19139GmdEncoder method encodeGmdQuantitativeResult.

private void encodeGmdQuantitativeResult(DQResultPropertyType xbResult, GmdQuantitativeResult gmdQuantitativeResult) {
    DQQuantitativeResultType dqQuantitativeResultType = (DQQuantitativeResultType) xbResult.addNewAbstractDQResult().substitute(QN_GMD_QUANTITATIVE_RESULT, DQQuantitativeResultType.type);
    GmlBaseUnit unit = gmdQuantitativeResult.getUnit();
    UnitOfMeasurePropertyType valueUnit = dqQuantitativeResultType.addNewValueUnit();
    BaseUnitType xbBaseUnit = (BaseUnitType) valueUnit.addNewUnitDefinition().substitute(QN_GML_BASE_UNIT, BaseUnitType.type);
    CodeType xbCatalogSymbol = xbBaseUnit.addNewCatalogSymbol();
    xbCatalogSymbol.setCodeSpace(unit.getCatalogSymbol().getCodeSpace().toString());
    xbCatalogSymbol.setStringValue(unit.getCatalogSymbol().getValue());
    xbBaseUnit.setId(unit.getId());
    xbBaseUnit.addNewUnitsSystem().setHref(unit.getUnitSystem());
    xbBaseUnit.addNewIdentifier().setCodeSpace(unit.getIdentifier());
    if (gmdQuantitativeResult.isSetValueNilReason()) {
        dqQuantitativeResultType.addNewValue().setNilReason(gmdQuantitativeResult.getValueNilReason().name());
    } else {
        XmlCursor cursor = dqQuantitativeResultType.addNewValue().addNewRecord().newCursor();
        cursor.toNextToken();
        cursor.insertChars(gmdQuantitativeResult.getValue());
        cursor.dispose();
    }
}
Also used : UnitOfMeasurePropertyType(org.isotc211.x2005.gco.UnitOfMeasurePropertyType) BaseUnitType(net.opengis.gml.x32.BaseUnitType) CodeType(net.opengis.gml.x32.CodeType) GmlBaseUnit(org.n52.shetland.iso.gmd.GmlBaseUnit) DQQuantitativeResultType(org.isotc211.x2005.gmd.DQQuantitativeResultType) XmlCursor(org.apache.xmlbeans.XmlCursor)

Aggregations

BaseUnitType (net.opengis.gml.x32.BaseUnitType)1 CodeType (net.opengis.gml.x32.CodeType)1 XmlCursor (org.apache.xmlbeans.XmlCursor)1 UnitOfMeasurePropertyType (org.isotc211.x2005.gco.UnitOfMeasurePropertyType)1 DQConformanceResultType (org.isotc211.x2005.gmd.DQConformanceResultType)1 DQDomainConsistencyDocument (org.isotc211.x2005.gmd.DQDomainConsistencyDocument)1 DQDomainConsistencyPropertyType (org.isotc211.x2005.gmd.DQDomainConsistencyPropertyType)1 DQDomainConsistencyType (org.isotc211.x2005.gmd.DQDomainConsistencyType)1 DQQuantitativeResultType (org.isotc211.x2005.gmd.DQQuantitativeResultType)1 DQResultPropertyType (org.isotc211.x2005.gmd.DQResultPropertyType)1 GmlBaseUnit (org.n52.shetland.iso.gmd.GmlBaseUnit)1