You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2022/10/13 14:26:42 UTC
[sis] 03/03: Upgrade `org.apache.sis.metadata.quality` package to ISO 19157:2013. Work partially done by Alexis Gaillard.
This is an automated email from the ASF dual-hosted git repository.
desruisseaux pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git
commit a3a1bb098525a8758c9ecb2049016ff75a90efb9
Author: Martin Desruisseaux <ma...@geomatys.com>
AuthorDate: Wed Oct 12 18:15:11 2022 +0200
Upgrade `org.apache.sis.metadata.quality` package to ISO 19157:2013.
Work partially done by Alexis Gaillard.
https://issues.apache.org/jira/browse/SIS-394
https://github.com/opengeospatial/geoapi/issues/44
---
.../apache/sis/internal/jaxb/FilterByVersion.java | 4 +-
.../sis/internal/jaxb/code/DQM_ValueStructure.java | 89 ++++
.../sis/internal/jaxb/code/package-info.java | 3 +-
.../internal/jaxb/metadata/DQM_BasicMeasure.java | 92 ++++
.../internal/jaxb/metadata/DQM_Description.java | 92 ++++
.../sis/internal/jaxb/metadata/DQM_Measure.java | 92 ++++
.../sis/internal/jaxb/metadata/DQM_Parameter.java | 92 ++++
.../jaxb/metadata/DQM_SourceReference.java | 92 ++++
.../jaxb/metadata/DQ_EvaluationMethod.java | 93 ++++
.../jaxb/metadata/DQ_MeasureReference.java | 93 ++++
.../DQ_StandaloneQualityReportInformation.java | 95 ++++
.../sis/internal/jaxb/metadata/package-info.java | 3 +-
.../org/apache/sis/metadata/MetadataStandard.java | 63 ++-
.../org/apache/sis/metadata/PropertyAccessor.java | 4 +-
.../java/org/apache/sis/metadata/SpecialCases.java | 19 +-
.../sis/metadata/StandardImplementation.java | 6 +-
.../metadata/iso/quality/AbstractCompleteness.java | 2 +-
...ractResult.java => AbstractDataEvaluation.java} | 77 ++-
.../sis/metadata/iso/quality/AbstractElement.java | 567 +++++++++++----------
.../iso/quality/AbstractLogicalConsistency.java | 2 +-
...bstractResult.java => AbstractMetaquality.java} | 82 +--
.../iso/quality/AbstractPositionalAccuracy.java | 12 +-
.../sis/metadata/iso/quality/AbstractResult.java | 100 +++-
.../iso/quality/AbstractTemporalAccuracy.java | 42 +-
...lAccuracy.java => AbstractTemporalQuality.java} | 52 +-
.../iso/quality/AbstractThematicAccuracy.java | 17 +-
.../DefaultAbsoluteExternalPositionalAccuracy.java | 5 +-
.../quality/DefaultAccuracyOfATimeMeasurement.java | 10 +-
...lity.java => DefaultAggregationDerivation.java} | 49 +-
.../metadata/iso/quality/DefaultBasicMeasure.java | 225 ++++++++
.../iso/quality/DefaultCompletenessCommission.java | 3 +-
.../iso/quality/DefaultCompletenessOmission.java | 3 +-
.../iso/quality/DefaultConceptualConsistency.java | 7 +-
...efaultUsability.java => DefaultConfidence.java} | 53 +-
.../iso/quality/DefaultConformanceResult.java | 7 +-
.../iso/quality/DefaultCoverageResult.java | 67 ++-
.../metadata/iso/quality/DefaultDataQuality.java | 80 ++-
.../metadata/iso/quality/DefaultDescription.java | 162 ++++++
...sistency.java => DefaultDescriptiveResult.java} | 94 +++-
.../iso/quality/DefaultDomainConsistency.java | 3 +-
...ctElement.java => DefaultEvaluationMethod.java} | 311 +++--------
.../iso/quality/DefaultFormatConsistency.java | 5 +-
...ltUsability.java => DefaultFullInspection.java} | 51 +-
.../DefaultGriddedDataPositionalAccuracy.java | 3 +-
...faultUsability.java => DefaultHomogeneity.java} | 53 +-
...ability.java => DefaultIndirectEvaluation.java} | 94 +++-
.../sis/metadata/iso/quality/DefaultMeasure.java | 467 +++++++++++++++++
.../iso/quality/DefaultMeasureReference.java | 201 ++++++++
.../DefaultNonQuantitativeAttributeAccuracy.java | 22 +-
...efaultNonQuantitativeAttributeCorrectness.java} | 56 +-
.../sis/metadata/iso/quality/DefaultParameter.java | 252 +++++++++
.../DefaultQuantitativeAttributeAccuracy.java | 3 +-
.../iso/quality/DefaultQuantitativeResult.java | 17 +-
.../DefaultRelativeInternalPositionalAccuracy.java | 3 +-
...lValidity.java => DefaultRepresentativity.java} | 51 +-
.../iso/quality/DefaultSampleBasedInspection.java | 191 +++++++
...alAccuracy.java => DefaultSourceReference.java} | 86 +++-
.../DefaultStandaloneQualityReportInformation.java | 163 ++++++
.../iso/quality/DefaultTemporalConsistency.java | 8 +-
.../iso/quality/DefaultTemporalValidity.java | 8 +-
.../DefaultThematicClassificationCorrectness.java | 3 +-
.../iso/quality/DefaultTopologicalConsistency.java | 9 +-
.../sis/metadata/iso/quality/DefaultUsability.java | 19 +-
...lAccuracy.java => DefaultUsabilityElement.java} | 54 +-
.../sis/metadata/iso/quality/ISOMetadata.java | 60 +++
.../sis/metadata/iso/quality/package-info.java | 93 +---
.../java/org/apache/sis/metadata/package-info.java | 2 +-
.../main/java/org/apache/sis/xml/Namespaces.java | 14 +-
.../sis/metadata/PropertyConsistencyCheck.java | 3 +-
.../apache/sis/metadata/iso/AllMetadataTest.java | 52 +-
.../quality/AbstractPositionalAccuracyTest.java | 13 +-
.../sis/test/xml/AnnotationConsistencyCheck.java | 62 ++-
.../org/apache/sis/test/xml/SchemaCompliance.java | 5 +-
.../java/org/apache/sis/util/iso/TypesTest.java | 2 +-
.../sis/metadata/xml/2007/PositionalAccuracy.xml | 11 +-
.../sis/metadata/xml/2016/PositionalAccuracy.xml | 33 +-
76 files changed, 3922 insertions(+), 1211 deletions(-)
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/FilterByVersion.java b/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/FilterByVersion.java
index e4e729cc80..164b199afc 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/FilterByVersion.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/FilterByVersion.java
@@ -32,14 +32,14 @@ package org.apache.sis.internal.jaxb;
*/
public enum FilterByVersion {
/**
- * {@code accept() == true} if marshalling of an ISO 19139:2007 document in in progress,
+ * {@code accept() == true} if marshalling of an ISO 19139:2007 document is in progress,
* or if no marshalling in underway. Those documents are based on ISO 19115:2003 model.
*/
LEGACY_METADATA(Context.MARSHALLING | Context.LEGACY_METADATA,
Context.MARSHALLING),
/**
- * {@code accept() == true} if marshalling of an ISO 19115-3 document in in progress,
+ * {@code accept() == true} if marshalling of an ISO 19115-3 document is in progress,
* or if no marshalling in underway. Those documents are based on ISO 19115:2014 model.
*/
CURRENT_METADATA(Context.MARSHALLING | Context.LEGACY_METADATA,
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/DQM_ValueStructure.java b/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/DQM_ValueStructure.java
new file mode 100644
index 0000000000..d07cfabd67
--- /dev/null
+++ b/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/DQM_ValueStructure.java
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.internal.jaxb.code;
+
+import javax.xml.bind.annotation.XmlElement;
+import org.opengis.metadata.quality.ValueStructure;
+import org.apache.sis.internal.jaxb.cat.CodeListAdapter;
+import org.apache.sis.internal.jaxb.cat.CodeListUID;
+import org.apache.sis.xml.Namespaces;
+
+
+/**
+ * JAXB adapter for {@link ValueStructure}
+ * in order to wrap the value in an XML element as specified by ISO 19115-3 standard.
+ * See package documentation for more information about the handling of {@code CodeList} in ISO 19115-3.
+ *
+ * @author Martin Desruisseaux (Geomatys)
+ * @version 1.3
+ * @since 1.3
+ * @module
+ */
+public final class DQM_ValueStructure extends CodeListAdapter<DQM_ValueStructure, ValueStructure> {
+ /**
+ * Empty constructor for JAXB only.
+ */
+ public DQM_ValueStructure() {
+ }
+
+ /**
+ * Creates a new adapter for the given value.
+ */
+ private DQM_ValueStructure(final CodeListUID value) {
+ super(value);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @return the wrapper for the code list value.
+ */
+ @Override
+ protected DQM_ValueStructure wrap(final CodeListUID value) {
+ return new DQM_ValueStructure(value);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @return the code list class.
+ */
+ @Override
+ protected Class<ValueStructure> getCodeListClass() {
+ return ValueStructure.class;
+ }
+
+ /**
+ * Invoked by JAXB on marshalling.
+ *
+ * @return the value to be marshalled.
+ */
+ @Override
+ @XmlElement(name = "DQM_ValueStructure", namespace = Namespaces.DQM)
+ public CodeListUID getElement() {
+ return identifier;
+ }
+
+ /**
+ * Invoked by JAXB on unmarshalling.
+ *
+ * @param value the unmarshalled value.
+ */
+ public void setElement(final CodeListUID value) {
+ identifier = value;
+ }
+}
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/package-info.java b/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/package-info.java
index 7596367221..f95d40b272 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/package-info.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/package-info.java
@@ -32,7 +32,7 @@
* @author Cédric Briançon (Geomatys)
* @author Martin Desruisseaux (Geomatys)
* @author Cullen Rombach (Image Matters)
- * @version 1.0
+ * @version 1.3
*
* @see javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter
* @see org.opengis.util.CodeList
@@ -49,6 +49,7 @@
@XmlNs(prefix = "mex", namespaceURI = Namespaces.MEX), // Metadata with Schema Extensions
@XmlNs(prefix = "mac", namespaceURI = Namespaces.MAC), // Metadata for Acquisition
@XmlNs(prefix = "mdq", namespaceURI = Namespaces.MDQ), // Metadata for Data Quality
+ @XmlNs(prefix = "dqm", namespaceURI = Namespaces.DQM), // Metadata for Data Quality Measures
@XmlNs(prefix = "mco", namespaceURI = Namespaces.MCO), // Metadata for Constraints
@XmlNs(prefix = "srv", namespaceURI = Namespaces.SRV), // Metadata for Services
@XmlNs(prefix = "cit", namespaceURI = Namespaces.CIT), // Citation and responsible party information
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQM_BasicMeasure.java b/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQM_BasicMeasure.java
new file mode 100644
index 0000000000..c4b045f3a8
--- /dev/null
+++ b/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQM_BasicMeasure.java
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.internal.jaxb.metadata;
+
+import javax.xml.bind.annotation.XmlElementRef;
+import org.opengis.metadata.quality.BasicMeasure;
+import org.apache.sis.metadata.iso.quality.DefaultBasicMeasure;
+import org.apache.sis.internal.jaxb.gco.PropertyType;
+
+
+/**
+ * JAXB adapter mapping implementing class to the GeoAPI interface. See
+ * package documentation for more information about JAXB and interface.
+ *
+ * @author Martin Desruisseaux (Geomatys)
+ * @version 1.3
+ * @since 1.3
+ * @module
+ */
+public final class DQM_BasicMeasure extends PropertyType<DQM_BasicMeasure, BasicMeasure> {
+ /**
+ * Empty constructor for JAXB only.
+ */
+ public DQM_BasicMeasure() {
+ }
+
+ /**
+ * Returns the GeoAPI interface which is bound by this adapter.
+ * This method is indirectly invoked by the private constructor
+ * below, so it shall not depend on the state of this object.
+ *
+ * @return {@code BasicMeasure.class}
+ */
+ @Override
+ protected Class<BasicMeasure> getBoundType() {
+ return BasicMeasure.class;
+ }
+
+ /**
+ * Constructor for the {@link #wrap} method only.
+ */
+ private DQM_BasicMeasure(final BasicMeasure metadata) {
+ super(metadata);
+ }
+
+ /**
+ * Invoked by {@link PropertyType} at marshalling time for wrapping the given metadata value
+ * in a {@code <dqm:DQ_BasicMeasure>} XML element.
+ *
+ * @param metadata the metadata element to marshal.
+ * @return a {@code PropertyType} wrapping the given the metadata element.
+ */
+ @Override
+ protected DQM_BasicMeasure wrap(final BasicMeasure metadata) {
+ return new DQM_BasicMeasure(metadata);
+ }
+
+ /**
+ * Invoked by JAXB at marshalling time for getting the actual metadata to write
+ * inside the {@code <dqm:DQ_BasicMeasure>} XML element.
+ * This is the value or a copy of the value given in argument to the {@code wrap} method.
+ *
+ * @return the metadata to be marshalled.
+ */
+ @XmlElementRef
+ public DefaultBasicMeasure getElement() {
+ return DefaultBasicMeasure.castOrCopy(metadata);
+ }
+
+ /**
+ * Invoked by JAXB at unmarshalling time for storing the result temporarily.
+ *
+ * @param metadata the unmarshalled metadata.
+ */
+ public void setElement(final DefaultBasicMeasure metadata) {
+ this.metadata = metadata;
+ }
+}
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQM_Description.java b/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQM_Description.java
new file mode 100644
index 0000000000..30e555685f
--- /dev/null
+++ b/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQM_Description.java
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.internal.jaxb.metadata;
+
+import javax.xml.bind.annotation.XmlElementRef;
+import org.opengis.metadata.quality.Description;
+import org.apache.sis.metadata.iso.quality.DefaultDescription;
+import org.apache.sis.internal.jaxb.gco.PropertyType;
+
+
+/**
+ * JAXB adapter mapping implementing class to the GeoAPI interface. See
+ * package documentation for more information about JAXB and interface.
+ *
+ * @author Martin Desruisseaux (Geomatys)
+ * @version 1.3
+ * @since 1.3
+ * @module
+ */
+public final class DQM_Description extends PropertyType<DQM_Description, Description> {
+ /**
+ * Empty constructor for JAXB only.
+ */
+ public DQM_Description() {
+ }
+
+ /**
+ * Returns the GeoAPI interface which is bound by this adapter.
+ * This method is indirectly invoked by the private constructor
+ * below, so it shall not depend on the state of this object.
+ *
+ * @return {@code Description.class}
+ */
+ @Override
+ protected Class<Description> getBoundType() {
+ return Description.class;
+ }
+
+ /**
+ * Constructor for the {@link #wrap} method only.
+ */
+ private DQM_Description(final Description metadata) {
+ super(metadata);
+ }
+
+ /**
+ * Invoked by {@link PropertyType} at marshalling time for wrapping the given metadata value
+ * in a {@code <dqm:DQ_Description>} XML element.
+ *
+ * @param metadata the metadata element to marshal.
+ * @return a {@code PropertyType} wrapping the given the metadata element.
+ */
+ @Override
+ protected DQM_Description wrap(final Description metadata) {
+ return new DQM_Description(metadata);
+ }
+
+ /**
+ * Invoked by JAXB at marshalling time for getting the actual metadata to write
+ * inside the {@code <dqm:DQ_Description>} XML element.
+ * This is the value or a copy of the value given in argument to the {@code wrap} method.
+ *
+ * @return the metadata to be marshalled.
+ */
+ @XmlElementRef
+ public DefaultDescription getElement() {
+ return DefaultDescription.castOrCopy(metadata);
+ }
+
+ /**
+ * Invoked by JAXB at unmarshalling time for storing the result temporarily.
+ *
+ * @param metadata the unmarshalled metadata.
+ */
+ public void setElement(final DefaultDescription metadata) {
+ this.metadata = metadata;
+ }
+}
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQM_Measure.java b/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQM_Measure.java
new file mode 100644
index 0000000000..9f0eb67d3f
--- /dev/null
+++ b/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQM_Measure.java
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.internal.jaxb.metadata;
+
+import javax.xml.bind.annotation.XmlElementRef;
+import org.opengis.metadata.quality.Measure;
+import org.apache.sis.metadata.iso.quality.DefaultMeasure;
+import org.apache.sis.internal.jaxb.gco.PropertyType;
+
+
+/**
+ * JAXB adapter mapping implementing class to the GeoAPI interface. See
+ * package documentation for more information about JAXB and interface.
+ *
+ * @author Martin Desruisseaux (Geomatys)
+ * @version 1.3
+ * @since 1.3
+ * @module
+ */
+public final class DQM_Measure extends PropertyType<DQM_Measure, Measure> {
+ /**
+ * Empty constructor for JAXB only.
+ */
+ public DQM_Measure() {
+ }
+
+ /**
+ * Returns the GeoAPI interface which is bound by this adapter.
+ * This method is indirectly invoked by the private constructor
+ * below, so it shall not depend on the state of this object.
+ *
+ * @return {@code Measure.class}
+ */
+ @Override
+ protected Class<Measure> getBoundType() {
+ return Measure.class;
+ }
+
+ /**
+ * Constructor for the {@link #wrap} method only.
+ */
+ private DQM_Measure(final Measure metadata) {
+ super(metadata);
+ }
+
+ /**
+ * Invoked by {@link PropertyType} at marshalling time for wrapping the given metadata value
+ * in a {@code <dqm:DQ_Measure>} XML element.
+ *
+ * @param metadata the metadata element to marshal.
+ * @return a {@code PropertyType} wrapping the given the metadata element.
+ */
+ @Override
+ protected DQM_Measure wrap(final Measure metadata) {
+ return new DQM_Measure(metadata);
+ }
+
+ /**
+ * Invoked by JAXB at marshalling time for getting the actual metadata to write
+ * inside the {@code <dqm:DQ_Measure>} XML element.
+ * This is the value or a copy of the value given in argument to the {@code wrap} method.
+ *
+ * @return the metadata to be marshalled.
+ */
+ @XmlElementRef
+ public DefaultMeasure getElement() {
+ return DefaultMeasure.castOrCopy(metadata);
+ }
+
+ /**
+ * Invoked by JAXB at unmarshalling time for storing the result temporarily.
+ *
+ * @param metadata the unmarshalled metadata.
+ */
+ public void setElement(final DefaultMeasure metadata) {
+ this.metadata = metadata;
+ }
+}
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQM_Parameter.java b/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQM_Parameter.java
new file mode 100644
index 0000000000..ba308a6b39
--- /dev/null
+++ b/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQM_Parameter.java
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.internal.jaxb.metadata;
+
+import javax.xml.bind.annotation.XmlElementRef;
+import org.opengis.metadata.quality.Parameter;
+import org.apache.sis.metadata.iso.quality.DefaultParameter;
+import org.apache.sis.internal.jaxb.gco.PropertyType;
+
+
+/**
+ * JAXB adapter mapping implementing class to the GeoAPI interface. See
+ * package documentation for more information about JAXB and interface.
+ *
+ * @author Martin Desruisseaux (Geomatys)
+ * @version 1.3
+ * @since 1.3
+ * @module
+ */
+public final class DQM_Parameter extends PropertyType<DQM_Parameter, Parameter> {
+ /**
+ * Empty constructor for JAXB only.
+ */
+ public DQM_Parameter() {
+ }
+
+ /**
+ * Returns the GeoAPI interface which is bound by this adapter.
+ * This method is indirectly invoked by the private constructor
+ * below, so it shall not depend on the state of this object.
+ *
+ * @return {@code Parameter.class}
+ */
+ @Override
+ protected Class<Parameter> getBoundType() {
+ return Parameter.class;
+ }
+
+ /**
+ * Constructor for the {@link #wrap} method only.
+ */
+ private DQM_Parameter(final Parameter metadata) {
+ super(metadata);
+ }
+
+ /**
+ * Invoked by {@link PropertyType} at marshalling time for wrapping the given metadata value
+ * in a {@code <dqm:DQ_Parameter>} XML element.
+ *
+ * @param metadata the metadata element to marshal.
+ * @return a {@code PropertyType} wrapping the given the metadata element.
+ */
+ @Override
+ protected DQM_Parameter wrap(final Parameter metadata) {
+ return new DQM_Parameter(metadata);
+ }
+
+ /**
+ * Invoked by JAXB at marshalling time for getting the actual metadata to write
+ * inside the {@code <dqm:DQ_Parameter>} XML element.
+ * This is the value or a copy of the value given in argument to the {@code wrap} method.
+ *
+ * @return the metadata to be marshalled.
+ */
+ @XmlElementRef
+ public DefaultParameter getElement() {
+ return DefaultParameter.castOrCopy(metadata);
+ }
+
+ /**
+ * Invoked by JAXB at unmarshalling time for storing the result temporarily.
+ *
+ * @param metadata the unmarshalled metadata.
+ */
+ public void setElement(final DefaultParameter metadata) {
+ this.metadata = metadata;
+ }
+}
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQM_SourceReference.java b/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQM_SourceReference.java
new file mode 100644
index 0000000000..5f18c9688c
--- /dev/null
+++ b/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQM_SourceReference.java
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.internal.jaxb.metadata;
+
+import javax.xml.bind.annotation.XmlElementRef;
+import org.opengis.metadata.quality.SourceReference;
+import org.apache.sis.metadata.iso.quality.DefaultSourceReference;
+import org.apache.sis.internal.jaxb.gco.PropertyType;
+
+
+/**
+ * JAXB adapter mapping implementing class to the GeoAPI interface. See
+ * package documentation for more information about JAXB and interface.
+ *
+ * @author Martin Desruisseaux (Geomatys)
+ * @version 1.3
+ * @since 1.3
+ * @module
+ */
+public final class DQM_SourceReference extends PropertyType<DQM_SourceReference, SourceReference> {
+ /**
+ * Empty constructor for JAXB only.
+ */
+ public DQM_SourceReference() {
+ }
+
+ /**
+ * Returns the GeoAPI interface which is bound by this adapter.
+ * This method is indirectly invoked by the private constructor
+ * below, so it shall not depend on the state of this object.
+ *
+ * @return {@code SourceReference.class}
+ */
+ @Override
+ protected Class<SourceReference> getBoundType() {
+ return SourceReference.class;
+ }
+
+ /**
+ * Constructor for the {@link #wrap} method only.
+ */
+ private DQM_SourceReference(final SourceReference metadata) {
+ super(metadata);
+ }
+
+ /**
+ * Invoked by {@link PropertyType} at marshalling time for wrapping the given metadata value
+ * in a {@code <dqm:DQ_SourceReference>} XML element.
+ *
+ * @param metadata the metadata element to marshal.
+ * @return a {@code PropertyType} wrapping the given the metadata element.
+ */
+ @Override
+ protected DQM_SourceReference wrap(final SourceReference metadata) {
+ return new DQM_SourceReference(metadata);
+ }
+
+ /**
+ * Invoked by JAXB at marshalling time for getting the actual metadata to write
+ * inside the {@code <dqm:DQ_SourceReference>} XML element.
+ * This is the value or a copy of the value given in argument to the {@code wrap} method.
+ *
+ * @return the metadata to be marshalled.
+ */
+ @XmlElementRef
+ public DefaultSourceReference getElement() {
+ return DefaultSourceReference.castOrCopy(metadata);
+ }
+
+ /**
+ * Invoked by JAXB at unmarshalling time for storing the result temporarily.
+ *
+ * @param metadata the unmarshalled metadata.
+ */
+ public void setElement(final DefaultSourceReference metadata) {
+ this.metadata = metadata;
+ }
+}
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQ_EvaluationMethod.java b/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQ_EvaluationMethod.java
new file mode 100644
index 0000000000..245c4ce976
--- /dev/null
+++ b/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQ_EvaluationMethod.java
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.internal.jaxb.metadata;
+
+import javax.xml.bind.annotation.XmlElementRef;
+import org.opengis.metadata.quality.EvaluationMethod;
+import org.apache.sis.metadata.iso.quality.DefaultEvaluationMethod;
+import org.apache.sis.internal.jaxb.gco.PropertyType;
+
+
+/**
+ * JAXB adapter mapping implementing class to the GeoAPI interface. See
+ * package documentation for more information about JAXB and interface.
+ *
+ * @author Alexis Gaillard (Geomatys)
+ * @author Martin Desruisseaux (Geomatys)
+ * @version 1.3
+ * @since 1.3
+ * @module
+ */
+public final class DQ_EvaluationMethod extends PropertyType<DQ_EvaluationMethod, EvaluationMethod> {
+ /**
+ * Empty constructor for JAXB only.
+ */
+ public DQ_EvaluationMethod() {
+ }
+
+ /**
+ * Returns the GeoAPI interface which is bound by this adapter.
+ * This method is indirectly invoked by the private constructor
+ * below, so it shall not depend on the state of this object.
+ *
+ * @return {@code EvaluationMethod.class}
+ */
+ @Override
+ protected Class<EvaluationMethod> getBoundType() {
+ return EvaluationMethod.class;
+ }
+
+ /**
+ * Constructor for the {@link #wrap} method only.
+ */
+ private DQ_EvaluationMethod(final EvaluationMethod metadata) {
+ super(metadata);
+ }
+
+ /**
+ * Invoked by {@link PropertyType} at marshalling time for wrapping the given metadata value
+ * in a {@code <mdq:DQ_EvaluationMethod>} XML element.
+ *
+ * @param metadata the metadata element to marshal.
+ * @return a {@code PropertyType} wrapping the given the metadata element.
+ */
+ @Override
+ protected DQ_EvaluationMethod wrap(final EvaluationMethod metadata) {
+ return new DQ_EvaluationMethod(metadata);
+ }
+
+ /**
+ * Invoked by JAXB at marshalling time for getting the actual metadata to write
+ * inside the {@code <mdq:DQ_EvaluationMethod>} XML element.
+ * This is the value or a copy of the value given in argument to the {@code wrap} method.
+ *
+ * @return the metadata to be marshalled.
+ */
+ @XmlElementRef
+ public DefaultEvaluationMethod getElement() {
+ return DefaultEvaluationMethod.castOrCopy(metadata);
+ }
+
+ /**
+ * Invoked by JAXB at unmarshalling time for storing the result temporarily.
+ *
+ * @param metadata the unmarshalled metadata.
+ */
+ public void setElement(final DefaultEvaluationMethod metadata) {
+ this.metadata = metadata;
+ }
+}
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQ_MeasureReference.java b/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQ_MeasureReference.java
new file mode 100644
index 0000000000..14d60127dc
--- /dev/null
+++ b/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQ_MeasureReference.java
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.internal.jaxb.metadata;
+
+import javax.xml.bind.annotation.XmlElementRef;
+import org.opengis.metadata.quality.MeasureReference;
+import org.apache.sis.metadata.iso.quality.DefaultMeasureReference;
+import org.apache.sis.internal.jaxb.gco.PropertyType;
+
+
+/**
+ * JAXB adapter mapping implementing class to the GeoAPI interface. See
+ * package documentation for more information about JAXB and interface.
+ *
+ * @author Alexis Gaillard (Geomatys)
+ * @author Martin Desruisseaux (Geomatys)
+ * @version 1.3
+ * @since 1.3
+ * @module
+ */
+public final class DQ_MeasureReference extends PropertyType<DQ_MeasureReference, MeasureReference> {
+ /**
+ * Empty constructor for JAXB only.
+ */
+ public DQ_MeasureReference() {
+ }
+
+ /**
+ * Returns the GeoAPI interface which is bound by this adapter.
+ * This method is indirectly invoked by the private constructor
+ * below, so it shall not depend on the state of this object.
+ *
+ * @return {@code MeasureReference.class}
+ */
+ @Override
+ protected Class<MeasureReference> getBoundType() {
+ return MeasureReference.class;
+ }
+
+ /**
+ * Constructor for the {@link #wrap} method only.
+ */
+ private DQ_MeasureReference(final MeasureReference metadata) {
+ super(metadata);
+ }
+
+ /**
+ * Invoked by {@link PropertyType} at marshalling time for wrapping the given metadata value
+ * in a {@code <mdq:DQ_MeasureReference>} XML element.
+ *
+ * @param metadata the metadata element to marshal.
+ * @return a {@code PropertyType} wrapping the given the metadata element.
+ */
+ @Override
+ protected DQ_MeasureReference wrap(final MeasureReference metadata) {
+ return new DQ_MeasureReference(metadata);
+ }
+
+ /**
+ * Invoked by JAXB at marshalling time for getting the actual metadata to write
+ * inside the {@code <mdq:DQ_MeasureReference>} XML element.
+ * This is the value or a copy of the value given in argument to the {@code wrap} method.
+ *
+ * @return the metadata to be marshalled.
+ */
+ @XmlElementRef
+ public DefaultMeasureReference getElement() {
+ return DefaultMeasureReference.castOrCopy(metadata);
+ }
+
+ /**
+ * Invoked by JAXB at unmarshalling time for storing the result temporarily.
+ *
+ * @param metadata the unmarshalled metadata.
+ */
+ public void setElement(final DefaultMeasureReference metadata) {
+ this.metadata = metadata;
+ }
+}
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQ_StandaloneQualityReportInformation.java b/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQ_StandaloneQualityReportInformation.java
new file mode 100644
index 0000000000..181195e264
--- /dev/null
+++ b/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/DQ_StandaloneQualityReportInformation.java
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.internal.jaxb.metadata;
+
+import javax.xml.bind.annotation.XmlElementRef;
+import org.opengis.metadata.quality.StandaloneQualityReportInformation;
+import org.apache.sis.metadata.iso.quality.DefaultStandaloneQualityReportInformation;
+import org.apache.sis.internal.jaxb.gco.PropertyType;
+
+
+/**
+ * JAXB adapter mapping implementing class to the GeoAPI interface. See
+ * package documentation for more information about JAXB and interface.
+ *
+ * @author Alexis Gaillard (Geomatys)
+ * @author Martin Desruisseaux (Geomatys)
+ * @version 1.3
+ * @since 1.3
+ * @module
+ */
+public final class DQ_StandaloneQualityReportInformation extends
+ PropertyType<DQ_StandaloneQualityReportInformation, StandaloneQualityReportInformation>
+{
+ /**
+ * Empty constructor for JAXB only.
+ */
+ public DQ_StandaloneQualityReportInformation() {
+ }
+
+ /**
+ * Returns the GeoAPI interface which is bound by this adapter.
+ * This method is indirectly invoked by the private constructor
+ * below, so it shall not depend on the state of this object.
+ *
+ * @return {@code StandaloneQualityReportInformation.class}
+ */
+ @Override
+ protected Class<StandaloneQualityReportInformation> getBoundType() {
+ return StandaloneQualityReportInformation.class;
+ }
+
+ /**
+ * Constructor for the {@link #wrap} method only.
+ */
+ private DQ_StandaloneQualityReportInformation(final StandaloneQualityReportInformation metadata) {
+ super(metadata);
+ }
+
+ /**
+ * Invoked by {@link PropertyType} at marshalling time for wrapping the given metadata value
+ * in a {@code <mdq:DQ_StandaloneQualityReportInformation>} XML element.
+ *
+ * @param metadata the metadata element to marshal.
+ * @return a {@code PropertyType} wrapping the given the metadata element.
+ */
+ @Override
+ protected DQ_StandaloneQualityReportInformation wrap(final StandaloneQualityReportInformation metadata) {
+ return new DQ_StandaloneQualityReportInformation(metadata);
+ }
+
+ /**
+ * Invoked by JAXB at marshalling time for getting the actual metadata to write
+ * inside the {@code <mdq:DQ_StandaloneQualityReportInformation>} XML element.
+ * This is the value or a copy of the value given in argument to the {@code wrap} method.
+ *
+ * @return the metadata to be marshalled.
+ */
+ @XmlElementRef
+ public DefaultStandaloneQualityReportInformation getElement() {
+ return DefaultStandaloneQualityReportInformation.castOrCopy(metadata);
+ }
+
+ /**
+ * Invoked by JAXB at unmarshalling time for storing the result temporarily.
+ *
+ * @param metadata the unmarshalled metadata.
+ */
+ public void setElement(final DefaultStandaloneQualityReportInformation metadata) {
+ this.metadata = metadata;
+ }
+}
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/package-info.java b/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/package-info.java
index 0f03d9d128..2a87af664f 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/package-info.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/package-info.java
@@ -50,7 +50,8 @@
* @author Cédric Briançon (Geomatys)
* @author Martin Desruisseaux (Geomatys)
* @author Cullen Rombach (Image Matters)
- * @since 1.1
+ * @author Alexis Gaillard (Geomatys)
+ * @since 1.3
*
* @see javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter
*
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java
index 986a3ba754..447f79c90f 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java
@@ -64,7 +64,7 @@ import static org.apache.sis.util.ArgumentChecks.ensureNonNullElement;
* <li>All properties are <cite>readable</cite>.</li>
* <li>A property is also <cite>writable</cite> if a {@code set*(…)} method is defined
* <strong>in the implementation class</strong> for the corresponding getter method.
- * The setter method doesn't need to be defined in the interface.</li>
+ * The setter method does not need to be defined in the interface.</li>
* </ul>
*
* An instance of {@code MetadataStandard} is associated to every {@link AbstractMetadata} objects.
@@ -72,7 +72,7 @@ import static org.apache.sis.util.ArgumentChecks.ensureNonNullElement;
* can also be used for other standards.
*
* <h2>Defining new {@code MetadataStandard} instances</h2>
- * Users should use the pre-defined constants when applicable.
+ * Users should use the predefined constants when applicable.
* However if new instances need to be defined, then there is a choice:
*
* <ul>
@@ -90,7 +90,7 @@ import static org.apache.sis.util.ArgumentChecks.ensureNonNullElement;
* by a large amount of {@link ModifiableMetadata}.
*
* @author Martin Desruisseaux (Geomatys)
- * @version 1.2
+ * @version 1.3
*
* @see AbstractMetadata
*
@@ -116,23 +116,34 @@ public class MetadataStandard implements Serializable {
static final boolean IMPLEMENTATION_CAN_ALTER_API = false;
/**
- * Metadata instances defined in this class. The current implementation does not yet
- * contains the user-defined instances. However this may be something we will need to
- * do in the future.
+ * Metadata instances defined in this class. Standards will be tested in the order they appear in this array.
+ * So if {@link #isSupported(String)} may return {@code true} for two or more standards, the standard which
+ * should have precedence should be declared first.
+ *
+ * <p>The current implementation does not yet contains the user-defined instances.
+ * However it may be something that we will need to do in the future.</p>
*/
private static final MetadataStandard[] INSTANCES;
/**
- * An instance working on ISO 19111 standard as defined by GeoAPI interfaces
- * in the {@link org.opengis.referencing} package and sub-packages.
+ * An instance working on ISO 19115 standard as defined by GeoAPI interfaces
+ * in the {@link org.opengis.metadata} package and sub-packages, except {@code quality}.
*/
- public static final MetadataStandard ISO_19111;
+ public static final MetadataStandard ISO_19115;
/**
- * An instance working on ISO 19115 standard as defined by GeoAPI interfaces
- * in the {@link org.opengis.metadata} package and sub-packages.
+ * An instance working on ISO 19157 standard as defined by GeoAPI interfaces
+ * in the {@link org.opengis.metadata.quality} package.
+ *
+ * @since 1.3
*/
- public static final MetadataStandard ISO_19115;
+ public static final MetadataStandard ISO_19157;
+
+ /**
+ * An instance working on ISO 19111 standard as defined by GeoAPI interfaces
+ * in the {@link org.opengis.referencing} package and sub-packages.
+ */
+ public static final MetadataStandard ISO_19111;
/**
* An instance working on ISO 19123 standard as defined by GeoAPI interfaces
@@ -143,12 +154,14 @@ public class MetadataStandard implements Serializable {
final String[] acronyms = {"CoordinateSystem", "CS", "CoordinateReferenceSystem", "CRS"};
// If new StandardImplementation instances are added below, please update StandardImplementation.readResolve().
- ISO_19115 = new StandardImplementation("ISO 19115", "org.opengis.metadata.", "org.apache.sis.metadata.iso.", null, null);
- ISO_19111 = new StandardImplementation("ISO 19111", "org.opengis.referencing.", "org.apache.sis.referencing.", acronyms, new MetadataStandard[] {ISO_19115});
- ISO_19123 = new MetadataStandard ("ISO 19123", "org.opengis.coverage.", new MetadataStandard[] {ISO_19111});
+ ISO_19115 = new StandardImplementation("ISO 19115", "org.opengis.metadata.", "org.apache.sis.metadata.iso.", null, (MetadataStandard[]) null);
+ ISO_19157 = new StandardImplementation("ISO 19157", "org.opengis.metadata.quality.", "org.apache.sis.metadata.iso.quality.", null, ISO_19115);
+ ISO_19111 = new StandardImplementation("ISO 19111", "org.opengis.referencing.", "org.apache.sis.referencing.", acronyms, ISO_19157, ISO_19115);
+ ISO_19123 = new MetadataStandard ("ISO 19123", "org.opengis.coverage.", ISO_19111);
INSTANCES = new MetadataStandard[] {
- ISO_19111,
+ ISO_19157, // Need to be declared before ISO 19115.
ISO_19115,
+ ISO_19111,
ISO_19123
};
SystemListener.add(new SystemListener(Modules.METADATA) {
@@ -173,8 +186,11 @@ public class MetadataStandard implements Serializable {
/**
* The dependencies, or {@code null} if none.
+ * If non-null, dependencies will be tested in the order they appear in this array.
+ * Consequently if {@link #isMetadata(Class)} may return {@code true} for two or more
+ * dependencies, then the dependency which should have precedence should be declared first.
*
- * Note: the {@code null} value is for serialization compatibility.
+ * <p>Note: the {@code null} value is for serialization compatibility.</p>
*/
private final MetadataStandard[] dependencies;
@@ -188,13 +204,18 @@ public class MetadataStandard implements Serializable {
* <li>{@link PropertyAccessor} otherwise.</li>
* </ul>
*/
- private final transient ConcurrentMap<CacheKey,Object> accessors; // written by reflection on deserialization.
+ private final transient ConcurrentMap<CacheKey,Object> accessors; // Written by reflection on deserialization.
/**
* Creates a new instance working on implementation of interfaces defined in the specified package.
+ * If this {@code MetadataStandard} does not support a given class, then the dependencies will be
+ * tested in the order declared to this constructor. Consequently if {@link #isMetadata(Class)} may
+ * return {@code true} for two or more dependencies, then the dependency which should have precedence
+ * should be declared first.
*
- * <div class="note"><b>Example:</b>: For the ISO 19115 standard reflected by GeoAPI interfaces,
- * {@code interfacePackage} shall be the {@link org.opengis.metadata} package.</div>
+ * <div class="note"><b>Example:</b>: For the ISO 19157 standard reflected by GeoAPI interfaces,
+ * {@code interfacePackage} shall be the {@link org.opengis.metadata.quality} package.
+ * Its dependency is {@link #ISO_19115} in the {@link org.opengis.metadata} package.</div>
*
* @param citation bibliographical reference to the international standard.
* @param interfacePackage the root package for metadata interfaces.
@@ -225,7 +246,7 @@ public class MetadataStandard implements Serializable {
* @param interfacePackage the root package for metadata interfaces.
* @param dependencies the dependencies to other metadata standards, or {@code null} if none.
*/
- MetadataStandard(final String citation, final String interfacePackage, final MetadataStandard[] dependencies) {
+ MetadataStandard(final String citation, final String interfacePackage, final MetadataStandard... dependencies) {
this.citation = new SimpleCitation(citation);
this.interfacePackage = interfacePackage;
this.accessors = new ConcurrentHashMap<>();
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java
index 0ee1c89c63..a703710bbf 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/PropertyAccessor.java
@@ -79,7 +79,7 @@ import static org.apache.sis.util.collection.Containers.hashMapCapacity;
* {@link ModifiableMetadata} instances.
*
* @author Martin Desruisseaux (Geomatys)
- * @version 1.0
+ * @version 1.3
* @since 0.3
* @module
*/
@@ -419,7 +419,7 @@ class PropertyAccessor {
for (Method candidate : getters) {
if (Classes.isPossibleGetter(candidate)) {
final String name = candidate.getName();
- if (name.startsWith(SET)) { // Paranoiac check.
+ if (name.startsWith(SET) || SpecialCases.exclude(type, name)) {
continue;
}
/*
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/SpecialCases.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/SpecialCases.java
index a60883060d..326f510c64 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/SpecialCases.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/SpecialCases.java
@@ -16,6 +16,7 @@
*/
package org.apache.sis.metadata;
+import org.opengis.metadata.quality.Element;
import org.opengis.metadata.extent.GeographicBoundingBox;
import org.apache.sis.measure.Latitude;
import org.apache.sis.measure.Longitude;
@@ -29,7 +30,7 @@ import org.apache.sis.util.collection.BackingStoreException;
* which are returned as {@link Longitude} or {@link Latitude} instances instead of {@link Double}.
*
* @author Martin Desruisseaux (Geomatys)
- * @version 1.1
+ * @version 1.3
* @since 0.4
* @module
*/
@@ -67,6 +68,18 @@ final class SpecialCases extends PropertyAccessor {
return type == GeographicBoundingBox.class;
}
+ /**
+ * Returns {@code true} if the given method should be excluded in current Apache SIS version.
+ * A future SIS version may handle that property as a special case instead.
+ *
+ * @param type the class or interface containing the method.
+ * @param method the method to test for exclusion.
+ * @return {@code true} if the given method should be excluded.
+ */
+ static boolean exclude(final Class<?> type, final String method) {
+ return method.equals("getMeasure") && Element.class.isAssignableFrom(type);
+ }
+
/**
* Delegates to {@link PropertyAccessor#type(int, TypeValuePolicy)},
* then substitutes the type for the properties handled in a special way.
@@ -166,8 +179,8 @@ final class SpecialCases extends PropertyAccessor {
/**
* Returns the identifier to use in replacement of the identifier given in {@link org.opengis.annotation.UML} annotations.
- * We usually want to use those identifiers as-is because they were specified by ISO standards, but we may an exception if
- * the identifier is actually a construction of two or more identifiers like {@code "defaultLocale+otherLocale"}.
+ * We usually want to use those identifiers as-is because they were specified by ISO standards, but we may do an exception
+ * if the identifier is actually a construction of two or more identifiers like {@code "defaultLocale+otherLocale"}.
*
* @param name the UML identifier(s) from ISO specification.
* @return the potentially simplified identifier to use for displaying purpose.
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/StandardImplementation.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/StandardImplementation.java
index b54389bc7b..c254319109 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/StandardImplementation.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/StandardImplementation.java
@@ -71,8 +71,8 @@ final class StandardImplementation extends MetadataStandard {
private final transient Map<Class<?>,Class<?>> implementations; // written by reflection on deserialization.
/**
- * Creates a new instance working on implementation of interfaces defined in the
- * specified package. This constructor is used only for the pre-defined constants.
+ * Creates a new instance working on implementation of interfaces defined in the specified package.
+ * This constructor is used only for the predefined constants.
*
* @param citation the title of the standard.
* @param interfacePackage the root package for metadata interfaces, with a trailing {@code '.'}.
@@ -81,7 +81,7 @@ final class StandardImplementation extends MetadataStandard {
* @param dependencies the dependencies to other metadata standards, or {@code null} if none.
*/
StandardImplementation(final String citation, final String interfacePackage, final String implementationPackage,
- final String[] acronyms, final MetadataStandard[] dependencies)
+ final String[] acronyms, final MetadataStandard... dependencies)
{
super(citation, interfacePackage, dependencies);
this.implementationPackage = implementationPackage;
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractCompleteness.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractCompleteness.java
index 543c44ab68..1f35c277b8 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractCompleteness.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractCompleteness.java
@@ -26,7 +26,7 @@ import org.opengis.metadata.quality.CompletenessCommission;
/**
* Presence and absence of features, their attributes and their relationships.
- * The following property is mandatory in a well-formed metadata according ISO 19115:
+ * The following property is mandatory in a well-formed metadata according ISO 19157:
*
* <div class="preformat">{@code DQ_Completeness}
* {@code └─result……………} Value obtained from applying a data quality measure.</div>
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractResult.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractDataEvaluation.java
similarity index 59%
copy from core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractResult.java
copy to core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractDataEvaluation.java
index eb3f97f9e8..1e1e04860f 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractResult.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractDataEvaluation.java
@@ -17,17 +17,17 @@
package org.apache.sis.metadata.iso.quality;
import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlRootElement;
-import org.opengis.metadata.quality.Result;
-import org.opengis.metadata.quality.CoverageResult;
-import org.opengis.metadata.quality.ConformanceResult;
-import org.opengis.metadata.quality.QuantitativeResult;
-import org.apache.sis.metadata.iso.ISOMetadata;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import org.opengis.metadata.quality.DataEvaluation;
+import org.opengis.metadata.quality.FullInspection;
+import org.opengis.metadata.quality.IndirectEvaluation;
+import org.opengis.metadata.quality.SampleBasedInspection;
/**
- * Type of test applied to the data specified by a data quality scope.
+ * Data evaluation method.
+ * See the {@link DataEvaluation} GeoAPI interface for more details.
*
* <h2>Limitations</h2>
* <ul>
@@ -38,29 +38,29 @@ import org.apache.sis.metadata.iso.ISOMetadata;
* same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
* </ul>
*
- * @author Martin Desruisseaux (IRD, Geomatys)
- * @author Touraïvane (IRD)
- * @version 1.0
- * @since 0.3
+ * @author Alexis Gaillard (Geomatys)
+ * @author Martin Desruisseaux (Geomatys)
+ * @version 1.3
+ * @since 1.3
* @module
*/
-@XmlType(name = "AbstractDQ_Result_Type")
-@XmlRootElement(name = "AbstractDQ_Result")
+@XmlType(name = "AbstractDQ_DataEvaluation_Type")
+@XmlRootElement(name = "AbstractDQ_DataEvaluation")
@XmlSeeAlso({
- DefaultConformanceResult.class,
- DefaultQuantitativeResult.class,
- DefaultCoverageResult.class
+ DefaultFullInspection.class,
+ DefaultIndirectEvaluation .class,
+ DefaultSampleBasedInspection.class
})
-public class AbstractResult extends ISOMetadata implements Result {
+public class AbstractDataEvaluation extends DefaultEvaluationMethod implements DataEvaluation {
/**
* Serial number for inter-operability with different versions.
*/
- private static final long serialVersionUID = 3510023908820052467L;
+ private static final long serialVersionUID = 6572802343890855687L;
/**
- * Constructs an initially empty result.
+ * Constructs an initially empty Evaluation for data.
*/
- public AbstractResult() {
+ public AbstractDataEvaluation() {
}
/**
@@ -70,9 +70,9 @@ public class AbstractResult extends ISOMetadata implements Result {
*
* @param object the metadata to copy values from, or {@code null} if none.
*
- * @see #castOrCopy(Result)
+ * @see #castOrCopy(DataEvaluation)
*/
- public AbstractResult(final Result object) {
+ public AbstractDataEvaluation(final DataEvaluation object) {
super(object);
}
@@ -82,16 +82,16 @@ public class AbstractResult extends ISOMetadata implements Result {
*
* <ul>
* <li>If the given object is {@code null}, then this method returns {@code null}.</li>
- * <li>Otherwise if the given object is an instance of {@link ConformanceResult},
- * {@link QuantitativeResult}or {@link CoverageResult}, then this method delegates to
+ * <li>Otherwise if the given object is an instance of {@link IndirectEvaluation},
+ * {@link SampleBasedInspection} or {@link FullInspection}, then this method delegates to
* the {@code castOrCopy(…)} method of the corresponding SIS subclass.
* Note that if the given object implements more than one of the above-cited interfaces,
* then the {@code castOrCopy(…)} method to be used is unspecified.</li>
* <li>Otherwise if the given object is already an instance of
- * {@code AbstractResult}, then it is returned unchanged.</li>
- * <li>Otherwise a new {@code AbstractResult} instance is created using the
- * {@linkplain #AbstractResult(Result) copy constructor}
- * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * {@code AbstractDataEvaluation}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code AbstractDataEvaluation} instance is created using the
+ * {@linkplain #AbstractDataEvaluation(DataEvaluation) copy constructor} and returned.
+ * Note that this is a <cite>shallow</cite> copy operation, since the other
* metadata contained in the given object are not recursively copied.</li>
* </ul>
*
@@ -99,20 +99,19 @@ public class AbstractResult extends ISOMetadata implements Result {
* @return a SIS implementation containing the values of the given object (may be the
* given object itself), or {@code null} if the argument was null.
*/
- public static AbstractResult castOrCopy(final Result object) {
- if (object instanceof CoverageResult) {
- return DefaultCoverageResult.castOrCopy((CoverageResult) object);
+ public static AbstractDataEvaluation castOrCopy(final DataEvaluation object) {
+ if (object instanceof FullInspection) {
+ return DefaultFullInspection.castOrCopy((FullInspection) object);
}
- if (object instanceof QuantitativeResult) {
- return DefaultQuantitativeResult.castOrCopy((QuantitativeResult) object);
+ if (object instanceof SampleBasedInspection) {
+ return DefaultSampleBasedInspection.castOrCopy((SampleBasedInspection) object);
}
- if (object instanceof ConformanceResult) {
- return DefaultConformanceResult.castOrCopy((ConformanceResult) object);
+ if (object instanceof IndirectEvaluation) {
+ return DefaultIndirectEvaluation.castOrCopy((IndirectEvaluation) object);
}
- // Intentionally tested after the sub-interfaces.
- if (object == null || object instanceof AbstractResult) {
- return (AbstractResult) object;
+ if (object == null || object instanceof AbstractDataEvaluation) {
+ return (AbstractDataEvaluation) object;
}
- return new AbstractResult(object);
+ return new AbstractDataEvaluation(object);
}
}
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java
index 5febb30461..1a426d8151 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java
@@ -17,10 +17,10 @@
package org.apache.sis.metadata.iso.quality;
import java.util.Date;
-import java.util.Iterator;
import java.util.Collection;
-import java.util.AbstractList;
-import java.io.Serializable;
+import java.util.Collections;
+import java.util.function.Function;
+import java.util.function.BiConsumer;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@@ -29,28 +29,28 @@ import org.opengis.metadata.Identifier;
import org.opengis.metadata.citation.Citation;
import org.opengis.metadata.quality.Result;
import org.opengis.metadata.quality.Element;
-import org.opengis.metadata.quality.Usability;
+import org.opengis.metadata.quality.UsabilityElement;
import org.opengis.metadata.quality.Completeness;
-import org.opengis.metadata.quality.TemporalAccuracy;
+import org.opengis.metadata.quality.TemporalQuality;
import org.opengis.metadata.quality.ThematicAccuracy;
import org.opengis.metadata.quality.PositionalAccuracy;
import org.opengis.metadata.quality.LogicalConsistency;
import org.opengis.metadata.quality.EvaluationMethodType;
+import org.opengis.metadata.quality.EvaluationMethod;
+import org.opengis.metadata.quality.MeasureReference;
+import org.opengis.metadata.quality.Metaquality;
import org.opengis.util.InternationalString;
-import org.apache.sis.metadata.iso.ISOMetadata;
-import org.apache.sis.internal.system.Semaphores;
import org.apache.sis.internal.jaxb.FilterByVersion;
+import org.apache.sis.internal.metadata.Dependencies;
import org.apache.sis.internal.xml.LegacyNamespaces;
-import org.apache.sis.util.collection.CheckedContainer;
-import org.apache.sis.util.resources.Errors;
import static org.apache.sis.util.collection.Containers.isNullOrEmpty;
-import static org.apache.sis.internal.metadata.ImplementationHelper.valueIfDefined;
/**
- * Type of test applied to the data specified by a data quality scope.
- * The following property is mandatory in a well-formed metadata according ISO 19115:
+ * Aspect of quantitative quality information.
+ * See the {@link Element} GeoAPI interface for more details.
+ * The following property is mandatory in a well-formed metadata according ISO 19157:
*
* <div class="preformat">{@code DQ_Element}
* {@code └─result……………} Value obtained from applying a data quality measure.</div>
@@ -67,11 +67,15 @@ import static org.apache.sis.internal.metadata.ImplementationHelper.valueIfDefin
* @author Martin Desruisseaux (IRD, Geomatys)
* @author Touraïvane (IRD)
* @author Guilhem Legal (Geomatys)
- * @version 1.0
+ * @author Alexis Gaillard (Geomatys)
+ * @version 1.3
* @since 0.3
* @module
*/
@XmlType(name = "AbstractDQ_Element_Type", propOrder = {
+ "standaloneQualityReportDetails",
+ "measureReference",
+ "evaluationMethod",
"namesOfMeasure",
"measureIdentification",
"measureDescription",
@@ -79,7 +83,8 @@ import static org.apache.sis.internal.metadata.ImplementationHelper.valueIfDefin
"evaluationMethodDescription",
"evaluationProcedure",
"dates",
- "results"
+ "results",
+ "derivedElements"
})
@XmlRootElement(name = "AbstractDQ_Element")
@XmlSeeAlso({
@@ -87,226 +92,46 @@ import static org.apache.sis.internal.metadata.ImplementationHelper.valueIfDefin
AbstractLogicalConsistency.class,
AbstractPositionalAccuracy.class,
AbstractThematicAccuracy.class,
- AbstractTemporalAccuracy.class,
- DefaultUsability.class
+ AbstractTemporalQuality.class,
+ DefaultUsabilityElement.class,
+ AbstractMetaquality.class,
+ DefaultMeasure.class // Not a subclass, but "weakly" associated.
})
public class AbstractElement extends ISOMetadata implements Element {
/**
* Serial number for inter-operability with different versions.
*/
- private static final long serialVersionUID = 3963454452767190970L;
+ private static final long serialVersionUID = -406229448295586970L;
/**
- * Name of the test applied to the data.
+ * Clause in the standalone quality report where this data quality element is described.
*/
@SuppressWarnings("serial")
- private Collection<InternationalString> namesOfMeasure;
+ private InternationalString standaloneQualityReportDetails;
/**
- * Code identifying a registered standard procedure, or {@code null} if none.
+ * Reference to measure used.
*/
@SuppressWarnings("serial")
- private Identifier measureIdentification;
+ private MeasureReference measureReference;
/**
- * Description of the measure being determined.
+ * Evaluation information.
*/
@SuppressWarnings("serial")
- private InternationalString measureDescription;
+ private EvaluationMethod evaluationMethod;
/**
- * Type of method used to evaluate quality of the dataset, or {@code null} if unspecified.
+ * Value (or set of values) obtained from applying a data quality measure.
*/
@SuppressWarnings("serial")
- private EvaluationMethodType evaluationMethodType;
-
- /**
- * Description of the evaluation method.
- */
- @SuppressWarnings("serial")
- private InternationalString evaluationMethodDescription;
-
- /**
- * Reference to the procedure information, or {@code null} if none.
- */
- @SuppressWarnings("serial")
- private Citation evaluationProcedure;
-
- /**
- * Start time ({@code date1}) and end time ({@code date2}) on which a data quality measure was applied.
- *
- * @todo Needs to be made unmodifiable after transition to {@link State#FINAL}.
- */
- private Dates dates;
-
- /**
- * The start and end times as a list of O, 1 or 2 elements.
- */
- private static final class Dates extends AbstractList<Date>
- implements CheckedContainer<Date>, Cloneable, Serializable
- {
- /**
- * For cross-version compatibility.
- */
- private static final long serialVersionUID = 1210175223467194009L;
-
- /**
- * Start time ({@code date1}) and end time ({@code date2}) on which a data quality measure
- * was applied. Value is {@link Long#MIN_VALUE} if this information is not available.
- */
- private long date1, date2;
-
- /**
- * Creates a new list initialized with no dates.
- */
- Dates() {
- clear();
- }
-
- /**
- * Returns the type of elements in this list.
- */
- @Override
- public Class<Date> getElementType() {
- return Date.class;
- }
-
- /**
- * Removes all dates in this list.
- */
- @Override
- public void clear() {
- date1 = Long.MIN_VALUE;
- date2 = Long.MIN_VALUE;
- }
-
- /**
- * Returns the number of elements in this list.
- */
- @Override
- public int size() {
- if (date2 != Long.MIN_VALUE) return 2;
- if (date1 != Long.MIN_VALUE) return 1;
- return 0;
- }
-
- /**
- * Returns the value at the given index.
- */
- @Override
- @SuppressWarnings("fallthrough")
- public Date get(final int index) {
- long date = date1;
- switch (index) {
- case 1: date = date2; // Fall through
- case 0: if (date != Long.MIN_VALUE) return new Date(date); // else fallthrough.
- default: throw new IndexOutOfBoundsException(Errors.format(Errors.Keys.IndexOutOfBounds_1, index));
- }
- }
-
- /**
- * Sets the value at the given index.
- * Null values are not allowed.
- */
- @Override
- public Date set(final int index, final Date value) {
- final long date = value.getTime();
- final Date previous = get(index);
- switch (index) {
- case 0: date1 = date; break;
- case 1: date2 = date; break;
- }
- modCount++;
- return previous;
- }
-
- /**
- * Removes the value at the given index.
- */
- @Override
- @SuppressWarnings("fallthrough")
- public Date remove(final int index) {
- final Date previous = get(index);
- switch (index) {
- case 0: date1 = date2; // Fallthrough
- case 1: date2 = Long.MIN_VALUE; break;
- }
- modCount++;
- return previous;
- }
-
- /**
- * Adds a date at the given position.
- * Null values are not allowed.
- */
- @Override
- public void add(final int index, final Date value) {
- final long date = value.getTime();
- if (date2 == Long.MIN_VALUE) {
- switch (index) {
- case 0: {
- date2 = date1;
- date1 = date;
- modCount++;
- return;
- }
- case 1: {
- if (date1 == Long.MIN_VALUE) {
- break; // Exception will be thrown below.
- }
- date2 = date;
- modCount++;
- return;
- }
- }
- }
- throw new IndexOutOfBoundsException(Errors.format(Errors.Keys.IndexOutOfBounds_1, index));
- }
-
- /**
- * Adds all content from the given collection into this collection.
- */
- @Override
- @SuppressWarnings("fallthrough")
- public boolean addAll(final Collection<? extends Date> dates) {
- final int c = modCount;
- if (dates != null) {
- final Iterator<? extends Date> it = dates.iterator();
- switch (size()) { // Fallthrough everywhere.
- case 0: if (!it.hasNext()) break;
- date1 = it.next().getTime();
- modCount++;
- case 1: if (!it.hasNext()) break;
- date2 = it.next().getTime();
- modCount++;
- default: if (!it.hasNext()) break;
- throw new IllegalArgumentException(Errors.format(
- Errors.Keys.TooManyCollectionElements_3, "dates", 2, dates.size()));
- }
- }
- return modCount != c;
- }
-
- /**
- * Returns a clone of this list.
- */
- @Override
- public Object clone() {
- try {
- return super.clone();
- } catch (CloneNotSupportedException e) {
- throw new AssertionError(e);
- }
- }
- }
+ private Collection<Result> results;
/**
- * Value (or set of values) obtained from applying a data quality measure or the out
- * come of evaluating the obtained value (or set of values) against a specified
- * acceptable conformance quality level.
+ * In case of aggregation or derivation, indicates the original element.
*/
@SuppressWarnings("serial")
- private Collection<Result> results;
+ private Collection<Element> derivedElements;
/**
* Constructs an initially empty element.
@@ -336,14 +161,14 @@ public class AbstractElement extends ISOMetadata implements Element {
public AbstractElement(final Element object) {
super(object);
if (object != null) {
- namesOfMeasure = copyCollection(object.getNamesOfMeasure(), InternationalString.class);
- measureIdentification = object.getMeasureIdentification();
- measureDescription = object.getMeasureDescription();
- evaluationMethodType = object.getEvaluationMethodType();
- evaluationMethodDescription = object.getEvaluationMethodDescription();
- evaluationProcedure = object.getEvaluationProcedure();
- results = copyCollection(object.getResults(), Result.class);
- writeDates(object.getDates());
+ standaloneQualityReportDetails = object.getStandaloneQualityReportDetails();
+ if ((measureReference = object.getMeasureReference()) == null) {
+ DefaultMeasureReference candidate = new DefaultMeasureReference();
+ if (candidate.setLegacy(object)) measureReference = candidate;
+ }
+ evaluationMethod = object.getEvaluationMethod();
+ results = copyCollection(object.getResults(), Result.class);
+ derivedElements = copyCollection(object.getDerivedElements(), Element.class);
}
}
@@ -354,16 +179,16 @@ public class AbstractElement extends ISOMetadata implements Element {
* <ul>
* <li>If the given object is {@code null}, then this method returns {@code null}.</li>
* <li>Otherwise if the given object is an instance of {@link PositionalAccuracy},
- * {@link TemporalAccuracy}, {@link ThematicAccuracy}, {@link LogicalConsistency},
- * {@link Completeness} or {@link Usability}, then this method delegates to the
- * {@code castOrCopy(…)} method of the corresponding SIS subclass.
+ * {@link TemporalQuality}, {@link ThematicAccuracy}, {@link LogicalConsistency},
+ * {@link Completeness}, {@link UsabilityElement} or {@link Metaquality},
+ * then this method delegates to the {@code castOrCopy(…)} method of the corresponding SIS subclass.
* Note that if the given object implements more than one of the above-cited interfaces,
* then the {@code castOrCopy(…)} method to be used is unspecified.</li>
* <li>Otherwise if the given object is already an instance of
* {@code AbstractElement}, then it is returned unchanged.</li>
* <li>Otherwise a new {@code AbstractElement} instance is created using the
- * {@linkplain #AbstractElement(Element) copy constructor}
- * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * {@linkplain #AbstractElement(Element) copy constructor} and returned.
+ * Note that this is a <cite>shallow</cite> copy operation, since the other
* metadata contained in the given object are not recursively copied.</li>
* </ul>
*
@@ -375,8 +200,8 @@ public class AbstractElement extends ISOMetadata implements Element {
if (object instanceof PositionalAccuracy) {
return AbstractPositionalAccuracy.castOrCopy((PositionalAccuracy) object);
}
- if (object instanceof TemporalAccuracy) {
- return AbstractTemporalAccuracy.castOrCopy((TemporalAccuracy) object);
+ if (object instanceof TemporalQuality) {
+ return AbstractTemporalQuality.castOrCopy((TemporalQuality) object);
}
if (object instanceof ThematicAccuracy) {
return AbstractThematicAccuracy.castOrCopy((ThematicAccuracy) object);
@@ -387,8 +212,11 @@ public class AbstractElement extends ISOMetadata implements Element {
if (object instanceof Completeness) {
return AbstractCompleteness.castOrCopy((Completeness) object);
}
- if (object instanceof Usability) {
- return DefaultUsability.castOrCopy((Usability) object);
+ if (object instanceof UsabilityElement) {
+ return DefaultUsabilityElement.castOrCopy((UsabilityElement) object);
+ }
+ if (object instanceof Metaquality) {
+ return AbstractMetaquality.castOrCopy((Metaquality) object);
}
// Intentionally tested after the sub-interfaces.
if (object == null || object instanceof AbstractElement) {
@@ -397,27 +225,122 @@ public class AbstractElement extends ISOMetadata implements Element {
return new AbstractElement(object);
}
+ /**
+ * Returns the clause in the standalone quality report where this data quality element is described.
+ * May apply to any related data quality element (original results in case of derivation or aggregation).
+ *
+ * @return clause where this data quality element is described, or {@code null} if none.
+ *
+ * @since 1.3
+ */
+ @Override
+ @XmlElement(name = "standaloneQualityReportDetails")
+ public InternationalString getStandaloneQualityReportDetails() {
+ return FilterByVersion.CURRENT_METADATA.accept() ? standaloneQualityReportDetails : null;
+ }
+
+ /**
+ * Sets the clause in the standalone quality report where this data quality element is described.
+ *
+ * @param newValue the clause in the standalone quality report.
+ *
+ * @since 1.3
+ */
+ public void setStandaloneQualityReportDetails(final InternationalString newValue) {
+ checkWritePermission(standaloneQualityReportDetails);
+ standaloneQualityReportDetails = newValue;
+ }
+
+ /**
+ * Returns an identifier of a measure fully described elsewhere.
+ *
+ * @return reference to the measure used, or {@code null} if none.
+ *
+ * @since 1.3
+ */
+ @Override
+ @XmlElement(name = "measure", required = false)
+ public MeasureReference getMeasureReference() {
+ if (FilterByVersion.CURRENT_METADATA.accept()) {
+ return (measureReference != null) ? measureReference : Element.super.getMeasureReference();
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Sets an identifier of a measure fully described elsewhere.
+ *
+ * @param newValues the new measure identifier.
+ *
+ * @since 1.3
+ */
+ public void setMeasureReference(final MeasureReference newValues) {
+ checkWritePermission(measureReference);
+ measureReference = newValues;
+ }
+
+ /**
+ * Returns the value of a {@link #measureReference} property.
+ * This is used only for deprecated setter methods from older ISO 19115 version.
+ *
+ * @see #getEvaluationMethodProperty(Function)
+ */
+ private <V> V getMeasureReferenceProperty(final Function<MeasureReference,V> getter) {
+ final MeasureReference m = measureReference;
+ return (m != null) && FilterByVersion.LEGACY_METADATA.accept() ? getter.apply(m) : null;
+ }
+
+ /**
+ * Sets the value of a {@link #measureReference} property.
+ * This is used only for deprecated setter methods from older ISO 19115 version.
+ *
+ * @see #setEvaluationMethodProperty(BiConsumer, Object)
+ */
+ private <V> void setMeasureReferenceProperty(final BiConsumer<DefaultMeasureReference,V> setter, final V newValue) {
+ if (newValue != null) {
+ if (!(measureReference instanceof DefaultEvaluationMethod)) {
+ measureReference = new DefaultMeasureReference(measureReference);
+ }
+ setter.accept((DefaultMeasureReference) measureReference, newValue);
+ }
+ }
+
/**
* Returns the name of the test applied to the data.
*
* @return name of the test applied to the data.
*
- * @see <a href="https://issues.apache.org/jira/browse/SIS-394">Issue SIS-394</a>
+ * @deprecated Replaced by {@link DefaultMeasureReference#getNamesOfMeasure()}.
*/
@Override
+ @Deprecated
@XmlElement(name = "nameOfMeasure", namespace = LegacyNamespaces.GMD)
public Collection<InternationalString> getNamesOfMeasure() {
- if (!FilterByVersion.LEGACY_METADATA.accept()) return null;
- return namesOfMeasure = nonNullCollection(namesOfMeasure, InternationalString.class);
+ if (!FilterByVersion.LEGACY_METADATA.accept()) {
+ return null;
+ }
+ if (measureReference == null) {
+ measureReference = new DefaultMeasureReference();
+ }
+ if (measureReference instanceof DefaultMeasureReference) {
+ return ((DefaultMeasureReference) measureReference).getNamesOfMeasure();
+ }
+ return Collections.unmodifiableCollection(measureReference.getNamesOfMeasure());
}
/**
* Sets the name of the test applied to the data.
*
* @param newValues the new name of measures.
+ *
+ * @deprecated Replaced by {@link DefaultMeasureReference#setNamesOfMeasure(Collection)}.
*/
+ @Deprecated
public void setNamesOfMeasure(final Collection<? extends InternationalString> newValues) {
- namesOfMeasure = writeCollection(newValues, namesOfMeasure, InternationalString.class);
+ if (!isNullOrEmpty(newValues)) {
+ setMeasureReferenceProperty(DefaultMeasureReference::setNamesOfMeasure, newValues);
+ }
}
/**
@@ -425,22 +348,25 @@ public class AbstractElement extends ISOMetadata implements Element {
*
* @return code identifying a registered standard procedure, or {@code null}.
*
- * @see <a href="https://issues.apache.org/jira/browse/SIS-394">Issue SIS-394</a>
+ * @deprecated Replaced by {@link DefaultMeasureReference#getMeasureIdentification()}.
*/
@Override
+ @Deprecated
@XmlElement(name = "measureIdentification", namespace = LegacyNamespaces.GMD)
public Identifier getMeasureIdentification() {
- return FilterByVersion.LEGACY_METADATA.accept() ? measureIdentification : null;
+ return getMeasureReferenceProperty(MeasureReference::getMeasureIdentification);
}
/**
* Sets the code identifying a registered standard procedure.
*
* @param newValue the new measure identification.
+ *
+ * @deprecated Replaced by {@link DefaultMeasureReference#setMeasureIdentification(Identifier)}.
*/
+ @Deprecated
public void setMeasureIdentification(final Identifier newValue) {
- checkWritePermission(measureIdentification);
- measureIdentification = newValue;
+ setMeasureReferenceProperty(DefaultMeasureReference::setMeasureIdentification, newValue);
}
/**
@@ -448,22 +374,76 @@ public class AbstractElement extends ISOMetadata implements Element {
*
* @return description of the measure being determined, or {@code null}.
*
- * @see <a href="https://issues.apache.org/jira/browse/SIS-394">Issue SIS-394</a>
+ * @deprecated Replaced by {@link DefaultMeasureReference#getMeasureDescription()}.
*/
@Override
+ @Deprecated
@XmlElement(name = "measureDescription", namespace = LegacyNamespaces.GMD)
public InternationalString getMeasureDescription() {
- return FilterByVersion.LEGACY_METADATA.accept() ? measureDescription : null;
+ return getMeasureReferenceProperty(MeasureReference::getMeasureDescription);
}
/**
* Sets the description of the measure being determined.
*
* @param newValue the new measure description.
+ *
+ * @deprecated Replaced by {@link DefaultMeasureReference#setMeasureDescription(InternationalString)}.
*/
+ @Deprecated
public void setMeasureDescription(final InternationalString newValue) {
- checkWritePermission(measureDescription);
- measureDescription = newValue;
+ setMeasureReferenceProperty(DefaultMeasureReference::setMeasureDescription, newValue);
+ }
+
+ /**
+ * Returns the evaluation information.
+ *
+ * @return information about the evaluation method, or {@code null} if none.
+ *
+ * @since 1.3
+ */
+ @Override
+ @XmlElement(name = "evaluationMethod", required = false)
+ public EvaluationMethod getEvaluationMethod() {
+ return FilterByVersion.CURRENT_METADATA.accept() ? evaluationMethod : null;
+ }
+
+ /**
+ * Sets the evaluation information.
+ *
+ * @param newValue the new evaluation information.
+ *
+ * @since 1.3
+ */
+ public void setEvaluationMethod(final EvaluationMethod newValue) {
+ checkWritePermission(evaluationMethod);
+ evaluationMethod = newValue;
+ }
+
+ /**
+ * Returns the value of a {@link #evaluationMethod} property.
+ * This is used only for deprecated setter methods from older ISO 19115 version.
+ *
+ * @see #getMeasureReferenceProperty(Function)
+ */
+ private <V> V getEvaluationMethodProperty(final Function<EvaluationMethod,V> getter) {
+ final EvaluationMethod m = evaluationMethod;
+ return (m != null) && FilterByVersion.LEGACY_METADATA.accept() ? getter.apply(m) : null;
+ }
+
+ /**
+ * Sets the value of a {@link #evaluationMethod} property.
+ * This is used only for deprecated setter methods from older ISO 19115 version.
+ *
+ * @see #setMeasureReferenceProperty(BiConsumer, Object)
+ */
+ private <V> void setEvaluationMethodProperty(final BiConsumer<DefaultEvaluationMethod,V> setter, final V newValue) {
+ if (newValue != null) {
+ if (!(evaluationMethod instanceof DefaultEvaluationMethod)) {
+ evaluationMethod = new DefaultEvaluationMethod(evaluationMethod);
+ }
+ setter.accept((DefaultEvaluationMethod) evaluationMethod, newValue);
+ }
}
/**
@@ -471,22 +451,25 @@ public class AbstractElement extends ISOMetadata implements Element {
*
* @return type of method used to evaluate quality, or {@code null}.
*
- * @see <a href="https://issues.apache.org/jira/browse/SIS-394">Issue SIS-394</a>
+ * @deprecated Replaced by {@link DefaultEvaluationMethod#getEvaluationMethodType()}.
*/
@Override
+ @Deprecated
@XmlElement(name = "evaluationMethodType", namespace = LegacyNamespaces.GMD)
public EvaluationMethodType getEvaluationMethodType() {
- return FilterByVersion.LEGACY_METADATA.accept() ? evaluationMethodType : null;
+ return getEvaluationMethodProperty(EvaluationMethod::getEvaluationMethodType);
}
/**
* Sets the type of method used to evaluate quality of the dataset.
*
* @param newValue the new evaluation method type.
+ *
+ * @deprecated Replaced by {@link DefaultEvaluationMethod#setEvaluationMethodType(EvaluationMethodType)}.
*/
+ @Deprecated
public void setEvaluationMethodType(final EvaluationMethodType newValue) {
- checkWritePermission(evaluationMethodType);
- evaluationMethodType = newValue;
+ setEvaluationMethodProperty(DefaultEvaluationMethod::setEvaluationMethodType, newValue);
}
/**
@@ -494,22 +477,25 @@ public class AbstractElement extends ISOMetadata implements Element {
*
* @return description of the evaluation method, or {@code null}.
*
- * @see <a href="https://issues.apache.org/jira/browse/SIS-394">Issue SIS-394</a>
+ * @deprecated Replaced by {@link DefaultEvaluationMethod#getEvaluationMethodDescription()}.
*/
@Override
+ @Deprecated
@XmlElement(name = "evaluationMethodDescription", namespace = LegacyNamespaces.GMD)
public InternationalString getEvaluationMethodDescription() {
- return FilterByVersion.LEGACY_METADATA.accept() ? evaluationMethodDescription : null;
+ return getEvaluationMethodProperty(EvaluationMethod::getEvaluationMethodDescription);
}
/**
* Sets the description of the evaluation method.
*
* @param newValue the new evaluation method description.
+ *
+ * @deprecated Replaced by {@link DefaultEvaluationMethod#setEvaluationMethodDescription(InternationalString)}.
*/
+ @Deprecated
public void setEvaluationMethodDescription(final InternationalString newValue) {
- checkWritePermission(evaluationMethodDescription);
- evaluationMethodDescription = newValue;
+ setEvaluationMethodProperty(DefaultEvaluationMethod::setEvaluationMethodDescription, newValue);
}
/**
@@ -517,22 +503,25 @@ public class AbstractElement extends ISOMetadata implements Element {
*
* @return reference to the procedure information, or {@code null}.
*
- * @see <a href="https://issues.apache.org/jira/browse/SIS-394">Issue SIS-394</a>
+ * @deprecated Replaced by {@link DefaultEvaluationMethod#getEvaluationProcedure()}.
*/
@Override
+ @Deprecated
@XmlElement(name = "evaluationProcedure", namespace = LegacyNamespaces.GMD)
public Citation getEvaluationProcedure() {
- return FilterByVersion.LEGACY_METADATA.accept() ? evaluationProcedure : null;
+ return getEvaluationMethodProperty(EvaluationMethod::getEvaluationProcedure);
}
/**
* Sets the reference to the procedure information.
*
* @param newValue the new evaluation procedure.
+ *
+ * @deprecated Replaced by {@link DefaultEvaluationMethod#setEvaluationProcedure(Citation)}.
*/
+ @Deprecated
public void setEvaluationProcedure(final Citation newValue) {
- checkWritePermission(evaluationProcedure);
- evaluationProcedure = newValue;
+ setEvaluationMethodProperty(DefaultEvaluationMethod::setEvaluationProcedure, newValue);
}
/**
@@ -541,18 +530,24 @@ public class AbstractElement extends ISOMetadata implements Element {
* Returns an empty collection if this information is not available.
*
* @return date or range of dates on which a data quality measure was applied.
+ *
+ * @deprecated Replaced by {@link DefaultEvaluationMethod#getDates()}.
*/
@Override
+ @Deprecated
+ @Dependencies("getEvaluationMethod")
@XmlElement(name = "dateTime", namespace = LegacyNamespaces.GMD)
- @SuppressWarnings("ReturnOfCollectionOrArrayField")
public Collection<Date> getDates() {
- if (Semaphores.query(Semaphores.NULL_COLLECTION)) {
- return isNullOrEmpty(dates) ? null : dates;
+ if (!FilterByVersion.LEGACY_METADATA.accept()) {
+ return null;
}
- if (dates == null) {
- dates = new Dates();
+ if (evaluationMethod == null) {
+ evaluationMethod = new DefaultEvaluationMethod();
}
- return dates;
+ if (evaluationMethod instanceof DefaultEvaluationMethod) {
+ return ((DefaultEvaluationMethod) evaluationMethod).getDates();
+ }
+ return Collections.unmodifiableCollection(evaluationMethod.getDates());
}
/**
@@ -560,33 +555,20 @@ public class AbstractElement extends ISOMetadata implements Element {
* The collection size is 1 for a single date, or 2 for a range.
*
* @param newValues the new dates, or {@code null}.
+ *
+ * @deprecated Replaced by {@link DefaultEvaluationMethod#setDates(Collection)}.
*/
+ @Deprecated
public void setDates(final Collection<? extends Date> newValues) {
- if (newValues != dates) { // Mandatory check for avoiding the call to 'dates.clear()'.
- checkWritePermission(valueIfDefined(dates));
- writeDates(newValues);
- }
- }
-
- /**
- * Implementation of {@link #setDates(Collection)}.
- */
- private void writeDates(final Collection<? extends Date> newValues) {
- if (isNullOrEmpty(newValues)) {
- dates = null;
- } else {
- if (dates == null) {
- dates = new Dates();
- }
- dates.clear();
- dates.addAll(newValues);
+ if (!isNullOrEmpty(newValues)) {
+ setEvaluationMethodProperty(DefaultEvaluationMethod::setDates, newValues);
}
}
/**
- * Returns the value (or set of values) obtained from applying a data quality measure or
- * the out come of evaluating the obtained value (or set of values) against a specified
- * acceptable conformance quality level.
+ * Returns the value(s) obtained from applying a data quality measure.
+ * May be an outcome of evaluating the obtained value (or set of values)
+ * against a specified acceptable conformance quality level.
*
* @return set of values obtained from applying a data quality measure.
*/
@@ -597,13 +579,36 @@ public class AbstractElement extends ISOMetadata implements Element {
}
/**
- * Sets the value (or set of values) obtained from applying a data quality measure or
- * the out come of evaluating the obtained value (or set of values) against a specified
- * acceptable conformance quality level.
+ * Sets the value(s) obtained from applying a data quality measure.
*
- * @param newValues the new results.
+ * @param newValues the new set of value.
*/
public void setResults(final Collection<? extends Result> newValues) {
results = writeCollection(newValues, results, Result.class);
}
+
+ /**
+ * Returns the original elements in case of aggregation or derivation.
+ *
+ * @return original element(s) when there is an aggregation or derivation.
+ *
+ * @since 1.3
+ */
+ @Override
+ @XmlElement(name = "derivedElement")
+ public Collection<Element> getDerivedElements() {
+ if (!FilterByVersion.CURRENT_METADATA.accept()) return null;
+ return derivedElements = nonNullCollection(derivedElements, Element.class);
+ }
+
+ /**
+ * Sets the original elements in case of aggregation or derivation.
+ *
+ * @param newValues the new elements.
+ *
+ * @since 1.3
+ */
+ public void setDerivedElements(final Collection<? extends Element> newValues) {
+ derivedElements = writeCollection(newValues, derivedElements, Element.class);
+ }
}
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractLogicalConsistency.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractLogicalConsistency.java
index 0a68158115..9b38deacdb 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractLogicalConsistency.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractLogicalConsistency.java
@@ -29,7 +29,7 @@ import org.opengis.metadata.quality.ConceptualConsistency;
/**
* Degree of adherence to logical rules of data structure, attribution and relationships.
* Data structure can be conceptual, logical or physical.
- * The following property is mandatory in a well-formed metadata according ISO 19115:
+ * The following property is mandatory in a well-formed metadata according ISO 19157:
*
* <div class="preformat">{@code DQ_LogicalConsistency}
* {@code └─result……………} Value obtained from applying a data quality measure.</div>
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractResult.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractMetaquality.java
similarity index 56%
copy from core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractResult.java
copy to core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractMetaquality.java
index eb3f97f9e8..79bf5758ba 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractResult.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractMetaquality.java
@@ -17,17 +17,21 @@
package org.apache.sis.metadata.iso.quality;
import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlRootElement;
-import org.opengis.metadata.quality.Result;
-import org.opengis.metadata.quality.CoverageResult;
-import org.opengis.metadata.quality.ConformanceResult;
-import org.opengis.metadata.quality.QuantitativeResult;
-import org.apache.sis.metadata.iso.ISOMetadata;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import org.opengis.metadata.quality.Metaquality;
+import org.opengis.metadata.quality.Confidence;
+import org.opengis.metadata.quality.Representativity;
+import org.opengis.metadata.quality.Homogeneity;
/**
- * Type of test applied to the data specified by a data quality scope.
+ * Information about the reliability of data quality results.
+ * The following properties are mandatory in a well-formed metadata according ISO 19157:
+ *
+ * <div class="preformat">{@code DQ_Metaquality}
+ * {@code ├─result…………………………} Value obtained from applying a data quality measure.
+ * {@code └─derivedElement……} Derived element.</div>
*
* <h2>Limitations</h2>
* <ul>
@@ -38,29 +42,29 @@ import org.apache.sis.metadata.iso.ISOMetadata;
* same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
* </ul>
*
- * @author Martin Desruisseaux (IRD, Geomatys)
- * @author Touraïvane (IRD)
- * @version 1.0
- * @since 0.3
+ * @author Alexis Gaillard (Geomatys)
+ * @author Martin Desruisseaux (Geomatys)
+ * @version 1.3
+ * @since 1.3
* @module
*/
-@XmlType(name = "AbstractDQ_Result_Type")
-@XmlRootElement(name = "AbstractDQ_Result")
+@XmlType(name = "AbstractDQ_Metaquality_Type")
+@XmlRootElement(name = "AbstractDQ_Metaquality")
@XmlSeeAlso({
- DefaultConformanceResult.class,
- DefaultQuantitativeResult.class,
- DefaultCoverageResult.class
+ DefaultConfidence.class,
+ DefaultRepresentativity.class,
+ DefaultHomogeneity.class
})
-public class AbstractResult extends ISOMetadata implements Result {
+public class AbstractMetaquality extends AbstractElement implements Metaquality {
/**
* Serial number for inter-operability with different versions.
*/
- private static final long serialVersionUID = 3510023908820052467L;
+ private static final long serialVersionUID = -3672977971960830867L;
/**
- * Constructs an initially empty result.
+ * Constructs an initially empty metaquality.
*/
- public AbstractResult() {
+ public AbstractMetaquality() {
}
/**
@@ -70,9 +74,10 @@ public class AbstractResult extends ISOMetadata implements Result {
*
* @param object the metadata to copy values from, or {@code null} if none.
*
- * @see #castOrCopy(Result)
+ * @see #castOrCopy(Metaquality)
*/
- public AbstractResult(final Result object) {
+ @SuppressWarnings("unchecked")
+ public AbstractMetaquality(final Metaquality object) {
super(object);
}
@@ -82,16 +87,15 @@ public class AbstractResult extends ISOMetadata implements Result {
*
* <ul>
* <li>If the given object is {@code null}, then this method returns {@code null}.</li>
- * <li>Otherwise if the given object is an instance of {@link ConformanceResult},
- * {@link QuantitativeResult}or {@link CoverageResult}, then this method delegates to
- * the {@code castOrCopy(…)} method of the corresponding SIS subclass.
+ * <li>Otherwise if the given object is an instance of {@link Confidence}, {@link Representativity} or {@link Homogeneity},
+ * then this method delegates to the {@code castOrCopy(…)} method of the corresponding SIS subclass.
* Note that if the given object implements more than one of the above-cited interfaces,
* then the {@code castOrCopy(…)} method to be used is unspecified.</li>
* <li>Otherwise if the given object is already an instance of
- * {@code AbstractResult}, then it is returned unchanged.</li>
- * <li>Otherwise a new {@code AbstractResult} instance is created using the
- * {@linkplain #AbstractResult(Result) copy constructor}
- * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * {@code AbstractMetaquality}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code AbstractMetaquality} instance is created using the
+ * {@linkplain #AbstractMetaquality(Metaquality) copy constructor} and returned.
+ * Note that this is a <cite>shallow</cite> copy operation, since the other
* metadata contained in the given object are not recursively copied.</li>
* </ul>
*
@@ -99,20 +103,20 @@ public class AbstractResult extends ISOMetadata implements Result {
* @return a SIS implementation containing the values of the given object (may be the
* given object itself), or {@code null} if the argument was null.
*/
- public static AbstractResult castOrCopy(final Result object) {
- if (object instanceof CoverageResult) {
- return DefaultCoverageResult.castOrCopy((CoverageResult) object);
+ public static AbstractMetaquality castOrCopy(final Metaquality object) {
+ if (object instanceof Confidence) {
+ return DefaultConfidence.castOrCopy((Confidence) object);
}
- if (object instanceof QuantitativeResult) {
- return DefaultQuantitativeResult.castOrCopy((QuantitativeResult) object);
+ if (object instanceof Representativity) {
+ return DefaultRepresentativity.castOrCopy((Representativity) object);
}
- if (object instanceof ConformanceResult) {
- return DefaultConformanceResult.castOrCopy((ConformanceResult) object);
+ if (object instanceof Homogeneity) {
+ return DefaultHomogeneity.castOrCopy((Homogeneity) object);
}
// Intentionally tested after the sub-interfaces.
- if (object == null || object instanceof AbstractResult) {
- return (AbstractResult) object;
+ if (object == null || object instanceof AbstractMetaquality) {
+ return (AbstractMetaquality) object;
}
- return new AbstractResult(object);
+ return new AbstractMetaquality(object);
}
}
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractPositionalAccuracy.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractPositionalAccuracy.java
index 0e1f8a7a4d..acd210bd22 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractPositionalAccuracy.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractPositionalAccuracy.java
@@ -28,7 +28,7 @@ import org.opengis.metadata.quality.RelativeInternalPositionalAccuracy;
/**
* Accuracy of the position of features.
- * The following property is mandatory in a well-formed metadata according ISO 19115:
+ * The following property is mandatory in a well-formed metadata according ISO 19157:
*
* <div class="preformat">{@code DQ_PositionalAccuracy}
* {@code └─result……………} Value obtained from applying a data quality measure.</div>
@@ -52,8 +52,8 @@ import org.opengis.metadata.quality.RelativeInternalPositionalAccuracy;
@XmlRootElement(name = "AbstractDQ_PositionalAccuracy")
@XmlSeeAlso({
DefaultAbsoluteExternalPositionalAccuracy.class,
- DefaultGriddedDataPositionalAccuracy.class,
- DefaultRelativeInternalPositionalAccuracy.class
+ DefaultRelativeInternalPositionalAccuracy.class,
+ DefaultGriddedDataPositionalAccuracy.class
})
public class AbstractPositionalAccuracy extends AbstractElement implements PositionalAccuracy {
/**
@@ -117,12 +117,12 @@ public class AbstractPositionalAccuracy extends AbstractElement implements Posit
if (object instanceof AbsoluteExternalPositionalAccuracy) {
return DefaultAbsoluteExternalPositionalAccuracy.castOrCopy((AbsoluteExternalPositionalAccuracy) object);
}
- if (object instanceof GriddedDataPositionalAccuracy) {
- return DefaultGriddedDataPositionalAccuracy.castOrCopy((GriddedDataPositionalAccuracy) object);
- }
if (object instanceof RelativeInternalPositionalAccuracy) {
return DefaultRelativeInternalPositionalAccuracy.castOrCopy((RelativeInternalPositionalAccuracy) object);
}
+ if (object instanceof GriddedDataPositionalAccuracy) {
+ return DefaultGriddedDataPositionalAccuracy.castOrCopy((GriddedDataPositionalAccuracy) object);
+ }
// Intentionally tested after the sub-interfaces.
if (object == null || object instanceof AbstractPositionalAccuracy) {
return (AbstractPositionalAccuracy) object;
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractResult.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractResult.java
index eb3f97f9e8..f1ca9dcf32 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractResult.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractResult.java
@@ -16,18 +16,22 @@
*/
package org.apache.sis.metadata.iso.quality;
+import java.util.Date;
+import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlRootElement;
+import org.apache.sis.internal.metadata.ImplementationHelper;
import org.opengis.metadata.quality.Result;
import org.opengis.metadata.quality.CoverageResult;
import org.opengis.metadata.quality.ConformanceResult;
import org.opengis.metadata.quality.QuantitativeResult;
-import org.apache.sis.metadata.iso.ISOMetadata;
+import org.opengis.metadata.quality.DescriptiveResult;
+import org.opengis.metadata.maintenance.Scope;
/**
- * Type of test applied to the data specified by a data quality scope.
+ * Base class of more specific result classes.
*
* <h2>Limitations</h2>
* <ul>
@@ -40,15 +44,20 @@ import org.apache.sis.metadata.iso.ISOMetadata;
*
* @author Martin Desruisseaux (IRD, Geomatys)
* @author Touraïvane (IRD)
- * @version 1.0
+ * @author Alexis Gaillard (Geomatys)
+ * @version 1.3
* @since 0.3
* @module
*/
-@XmlType(name = "AbstractDQ_Result_Type")
+@XmlType(name = "AbstractDQ_Result_Type", propOrder = {
+ "resultScope",
+ "dateTime"
+})
@XmlRootElement(name = "AbstractDQ_Result")
@XmlSeeAlso({
DefaultConformanceResult.class,
DefaultQuantitativeResult.class,
+ DefaultDescriptiveResult.class,
DefaultCoverageResult.class
})
public class AbstractResult extends ISOMetadata implements Result {
@@ -57,10 +66,22 @@ public class AbstractResult extends ISOMetadata implements Result {
*/
private static final long serialVersionUID = 3510023908820052467L;
+ /**
+ * Scope of the result.
+ */
+ @SuppressWarnings("serial")
+ private Scope resultScope;
+
+ /**
+ * Date when the result was generated, or {@link Long#MIN_VALUE} if none.
+ */
+ private long dateTime;
+
/**
* Constructs an initially empty result.
*/
public AbstractResult() {
+ dateTime = Long.MIN_VALUE;
}
/**
@@ -74,6 +95,12 @@ public class AbstractResult extends ISOMetadata implements Result {
*/
public AbstractResult(final Result object) {
super(object);
+ if (object != null) {
+ resultScope = object.getResultScope();
+ dateTime = ImplementationHelper.toMilliseconds(object.getDateTime());
+ } else {
+ dateTime = Long.MIN_VALUE;
+ }
}
/**
@@ -83,15 +110,15 @@ public class AbstractResult extends ISOMetadata implements Result {
* <ul>
* <li>If the given object is {@code null}, then this method returns {@code null}.</li>
* <li>Otherwise if the given object is an instance of {@link ConformanceResult},
- * {@link QuantitativeResult}or {@link CoverageResult}, then this method delegates to
- * the {@code castOrCopy(…)} method of the corresponding SIS subclass.
+ * {@link QuantitativeResult}, {@link DescriptiveResult} or {@link CoverageResult},
+ * then this method delegates to the {@code castOrCopy(…)} method of the corresponding SIS subclass.
* Note that if the given object implements more than one of the above-cited interfaces,
* then the {@code castOrCopy(…)} method to be used is unspecified.</li>
* <li>Otherwise if the given object is already an instance of
* {@code AbstractResult}, then it is returned unchanged.</li>
* <li>Otherwise a new {@code AbstractResult} instance is created using the
- * {@linkplain #AbstractResult(Result) copy constructor}
- * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * {@linkplain #AbstractResult(Result) copy constructor} and returned.
+ * Note that this is a <cite>shallow</cite> copy operation, since the other
* metadata contained in the given object are not recursively copied.</li>
* </ul>
*
@@ -100,19 +127,70 @@ public class AbstractResult extends ISOMetadata implements Result {
* given object itself), or {@code null} if the argument was null.
*/
public static AbstractResult castOrCopy(final Result object) {
- if (object instanceof CoverageResult) {
- return DefaultCoverageResult.castOrCopy((CoverageResult) object);
- }
if (object instanceof QuantitativeResult) {
return DefaultQuantitativeResult.castOrCopy((QuantitativeResult) object);
}
if (object instanceof ConformanceResult) {
return DefaultConformanceResult.castOrCopy((ConformanceResult) object);
}
+ if (object instanceof DescriptiveResult) {
+ return DefaultDescriptiveResult.castOrCopy((DescriptiveResult) object);
+ }
+ if (object instanceof CoverageResult) {
+ return DefaultCoverageResult.castOrCopy((CoverageResult) object);
+ }
// Intentionally tested after the sub-interfaces.
if (object == null || object instanceof AbstractResult) {
return (AbstractResult) object;
}
return new AbstractResult(object);
}
+
+ /**
+ * Returns the scope of the result.
+ *
+ * @return scope of the result, or {@code null} if unspecified.
+ *
+ * @since 1.3
+ */
+ @Override
+ @XmlElement(name = "resultScope")
+ public Scope getResultScope() {
+ return resultScope;
+ }
+
+ /**
+ * Sets the scope of the result.
+ *
+ * @param newValue the new evaluation procedure.
+ *
+ * @since 1.3
+ */
+ public void setResultScope(final Scope newValue) {
+ resultScope = newValue;
+ }
+
+ /**
+ * Returns the date when the result was generated.
+ *
+ * @return date of the result, or {@code null} if none.
+ *
+ * @since 1.3
+ */
+ @Override
+ @XmlElement(name = "dateTime")
+ public Date getDateTime() {
+ return ImplementationHelper.toDate(dateTime);
+ }
+
+ /**
+ * Sets the date when the result was generated.
+ *
+ * @param newValue the new date, or {@code null}.
+ *
+ * @since 1.3
+ */
+ public void setDateTime(final Date newValue) {
+ dateTime = ImplementationHelper.toMilliseconds(newValue);
+ }
}
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractTemporalAccuracy.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractTemporalAccuracy.java
index 4efd56c06c..b06f75b03c 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractTemporalAccuracy.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractTemporalAccuracy.java
@@ -18,44 +18,28 @@ package org.apache.sis.metadata.iso.quality;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlSeeAlso;
+import org.apache.sis.xml.Namespaces;
import org.opengis.metadata.quality.TemporalAccuracy;
import org.opengis.metadata.quality.TemporalValidity;
import org.opengis.metadata.quality.TemporalConsistency;
import org.opengis.metadata.quality.AccuracyOfATimeMeasurement;
-import org.apache.sis.internal.xml.LegacyNamespaces;
/**
* Accuracy of the temporal attributes and temporal relationships of features.
- * The following property is mandatory in a well-formed metadata according ISO 19115:
- *
- * <div class="preformat">{@code DQ_TemporalAccuracy}
- * {@code └─result……………} Value obtained from applying a data quality measure.</div>
- *
- * <h2>Limitations</h2>
- * <ul>
- * <li>Instances of this class are not synchronized for multi-threading.
- * Synchronization, if needed, is caller's responsibility.</li>
- * <li>Serialized objects of this class are not guaranteed to be compatible with future Apache SIS releases.
- * Serialization support is appropriate for short term storage or RMI between applications running the
- * same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
- * </ul>
*
* @author Martin Desruisseaux (IRD, Geomatys)
* @author Touraïvane (IRD)
- * @version 1.0
+ * @version 1.3
* @since 0.3
* @module
+ *
+ * @deprecated Renamed {@link AbstractTemporalQuality} for following a renaming in ISO 19157:2013.
*/
-@XmlType(name = "AbstractDQ_TemporalAccuracy_Type", namespace = LegacyNamespaces.GMD) // TODO: renamed TemporalQuality
-@XmlRootElement(name = "AbstractDQ_TemporalAccuracy", namespace = LegacyNamespaces.GMD)
-@XmlSeeAlso({
- DefaultAccuracyOfATimeMeasurement.class,
- DefaultTemporalConsistency.class,
- DefaultTemporalValidity.class
-})
-public class AbstractTemporalAccuracy extends AbstractElement implements TemporalAccuracy {
+@Deprecated
+@XmlType(name = "AbstractDQ_TemporalAccuracy_Type", namespace = Namespaces.GMD)
+@XmlRootElement(name = "AbstractDQ_TemporalAccuracy", namespace = Namespaces.GMD)
+public class AbstractTemporalAccuracy extends AbstractTemporalQuality implements TemporalAccuracy {
/**
* Serial number for inter-operability with different versions.
*/
@@ -104,16 +88,6 @@ public class AbstractTemporalAccuracy extends AbstractElement implements Tempora
* given object itself), or {@code null} if the argument was null.
*/
public static AbstractTemporalAccuracy castOrCopy(final TemporalAccuracy object) {
- if (object instanceof AccuracyOfATimeMeasurement) {
- return DefaultAccuracyOfATimeMeasurement.castOrCopy((AccuracyOfATimeMeasurement) object);
- }
- if (object instanceof TemporalConsistency) {
- return DefaultTemporalConsistency.castOrCopy((TemporalConsistency) object);
- }
- if (object instanceof TemporalValidity) {
- return DefaultTemporalValidity.castOrCopy((TemporalValidity) object);
- }
- // Intentionally tested after the sub-interfaces.
if (object == null || object instanceof AbstractTemporalAccuracy) {
return (AbstractTemporalAccuracy) object;
}
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractTemporalAccuracy.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractTemporalQuality.java
similarity index 75%
copy from core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractTemporalAccuracy.java
copy to core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractTemporalQuality.java
index 4efd56c06c..18267041b7 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractTemporalAccuracy.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractTemporalQuality.java
@@ -19,18 +19,18 @@ package org.apache.sis.metadata.iso.quality;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSeeAlso;
-import org.opengis.metadata.quality.TemporalAccuracy;
+import org.opengis.metadata.quality.TemporalQuality;
import org.opengis.metadata.quality.TemporalValidity;
import org.opengis.metadata.quality.TemporalConsistency;
import org.opengis.metadata.quality.AccuracyOfATimeMeasurement;
-import org.apache.sis.internal.xml.LegacyNamespaces;
+import org.opengis.metadata.quality.TemporalAccuracy;
/**
* Accuracy of the temporal attributes and temporal relationships of features.
- * The following property is mandatory in a well-formed metadata according ISO 19115:
+ * The following property is mandatory in a well-formed metadata according ISO 19157:
*
- * <div class="preformat">{@code DQ_TemporalAccuracy}
+ * <div class="preformat">{@code DQ_TemporalQuality}
* {@code └─result……………} Value obtained from applying a data quality measure.</div>
*
* <h2>Limitations</h2>
@@ -42,29 +42,30 @@ import org.apache.sis.internal.xml.LegacyNamespaces;
* same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
* </ul>
*
- * @author Martin Desruisseaux (IRD, Geomatys)
- * @author Touraïvane (IRD)
- * @version 1.0
- * @since 0.3
+ * @author Martin Desruisseaux (Geomatys)
+ * @author Alexis Gaillard (Geomatys)
+ * @version 1.3
+ * @since 1.3
* @module
*/
-@XmlType(name = "AbstractDQ_TemporalAccuracy_Type", namespace = LegacyNamespaces.GMD) // TODO: renamed TemporalQuality
-@XmlRootElement(name = "AbstractDQ_TemporalAccuracy", namespace = LegacyNamespaces.GMD)
+@XmlType(name = "AbstractDQ_TemporalQuality_Type")
+@XmlRootElement(name = "AbstractDQ_TemporalQuality")
@XmlSeeAlso({
+ AbstractTemporalAccuracy.class,
DefaultAccuracyOfATimeMeasurement.class,
DefaultTemporalConsistency.class,
DefaultTemporalValidity.class
})
-public class AbstractTemporalAccuracy extends AbstractElement implements TemporalAccuracy {
+public class AbstractTemporalQuality extends AbstractElement implements TemporalQuality {
/**
* Serial number for inter-operability with different versions.
*/
- private static final long serialVersionUID = -6273519060177989201L;
+ private static final long serialVersionUID = -442029273458043017L;
/**
* Constructs an initially empty temporal accuracy.
*/
- public AbstractTemporalAccuracy() {
+ public AbstractTemporalQuality() {
}
/**
@@ -74,9 +75,9 @@ public class AbstractTemporalAccuracy extends AbstractElement implements Tempora
*
* @param object the metadata to copy values from, or {@code null} if none.
*
- * @see #castOrCopy(TemporalAccuracy)
+ * @see #castOrCopy(TemporalQuality)
*/
- public AbstractTemporalAccuracy(final TemporalAccuracy object) {
+ public AbstractTemporalQuality(final TemporalQuality object) {
super(object);
}
@@ -92,10 +93,10 @@ public class AbstractTemporalAccuracy extends AbstractElement implements Tempora
* Note that if the given object implements more than one of the above-cited interfaces,
* then the {@code castOrCopy(…)} method to be used is unspecified.</li>
* <li>Otherwise if the given object is already an instance of
- * {@code AbstractTemporalAccuracy}, then it is returned unchanged.</li>
- * <li>Otherwise a new {@code AbstractTemporalAccuracy} instance is created using the
- * {@linkplain #AbstractTemporalAccuracy(TemporalAccuracy) copy constructor}
- * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * {@code AbstractTemporalQuality}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code AbstractTemporalQuality} instance is created using the
+ * {@linkplain #AbstractTemporalQuality(TemporalQuality) copy constructor} and returned.
+ * Note that this is a <cite>shallow</cite> copy operation, since the other
* metadata contained in the given object are not recursively copied.</li>
* </ul>
*
@@ -103,7 +104,8 @@ public class AbstractTemporalAccuracy extends AbstractElement implements Tempora
* @return a SIS implementation containing the values of the given object (may be the
* given object itself), or {@code null} if the argument was null.
*/
- public static AbstractTemporalAccuracy castOrCopy(final TemporalAccuracy object) {
+ @SuppressWarnings("deprecation")
+ public static AbstractTemporalQuality castOrCopy(final TemporalQuality object) {
if (object instanceof AccuracyOfATimeMeasurement) {
return DefaultAccuracyOfATimeMeasurement.castOrCopy((AccuracyOfATimeMeasurement) object);
}
@@ -113,10 +115,12 @@ public class AbstractTemporalAccuracy extends AbstractElement implements Tempora
if (object instanceof TemporalValidity) {
return DefaultTemporalValidity.castOrCopy((TemporalValidity) object);
}
- // Intentionally tested after the sub-interfaces.
- if (object == null || object instanceof AbstractTemporalAccuracy) {
- return (AbstractTemporalAccuracy) object;
+ if (object instanceof TemporalAccuracy) {
+ return AbstractTemporalAccuracy.castOrCopy((TemporalAccuracy) object);
+ }
+ if (object == null || object instanceof AbstractTemporalQuality) {
+ return (AbstractTemporalQuality) object;
}
- return new AbstractTemporalAccuracy(object);
+ return new AbstractTemporalQuality(object);
}
}
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractThematicAccuracy.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractThematicAccuracy.java
index 7bf8f7c992..314b3859e5 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractThematicAccuracy.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractThematicAccuracy.java
@@ -21,14 +21,13 @@ import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlRootElement;
import org.opengis.metadata.quality.ThematicAccuracy;
import org.opengis.metadata.quality.ThematicClassificationCorrectness;
-import org.opengis.metadata.quality.NonQuantitativeAttributeAccuracy;
+import org.opengis.metadata.quality.NonQuantitativeAttributeCorrectness;
import org.opengis.metadata.quality.QuantitativeAttributeAccuracy;
/**
- * Accuracy of quantitative attributes and the correctness of non-quantitative attributes
- * and of the classifications of features and their relationships.
- * The following property is mandatory in a well-formed metadata according ISO 19115:
+ * Accuracy and correctness of attributes and classification of features.
+ * The following property is mandatory in a well-formed metadata according ISO 19157:
*
* <div class="preformat">{@code DQ_ThematicAccuracy}
* {@code └─result……………} Value obtained from applying a data quality measure.</div>
@@ -44,7 +43,7 @@ import org.opengis.metadata.quality.QuantitativeAttributeAccuracy;
*
* @author Martin Desruisseaux (IRD, Geomatys)
* @author Touraïvane (IRD)
- * @version 1.0
+ * @version 1.3
* @since 0.3
* @module
*/
@@ -52,7 +51,7 @@ import org.opengis.metadata.quality.QuantitativeAttributeAccuracy;
@XmlRootElement(name = "AbstractDQ_ThematicAccuracy")
@XmlSeeAlso({
DefaultThematicClassificationCorrectness.class,
- DefaultNonQuantitativeAttributeAccuracy.class,
+ DefaultNonQuantitativeAttributeCorrectness.class,
DefaultQuantitativeAttributeAccuracy.class
})
public class AbstractThematicAccuracy extends AbstractElement implements ThematicAccuracy {
@@ -87,7 +86,7 @@ public class AbstractThematicAccuracy extends AbstractElement implements Themati
* <ul>
* <li>If the given object is {@code null}, then this method returns {@code null}.</li>
* <li>Otherwise if the given object is an instance of {@link QuantitativeAttributeAccuracy},
- * {@link NonQuantitativeAttributeAccuracy} or {@link ThematicClassificationCorrectness},
+ * {@link NonQuantitativeAttributeCorrectness} or {@link ThematicClassificationCorrectness},
* then this method delegates to the {@code castOrCopy(…)} method of the corresponding
* SIS subclass. Note that if the given object implements more than one of the above-cited
* interfaces, then the {@code castOrCopy(…)} method to be used is unspecified.</li>
@@ -107,8 +106,8 @@ public class AbstractThematicAccuracy extends AbstractElement implements Themati
if (object instanceof QuantitativeAttributeAccuracy) {
return DefaultQuantitativeAttributeAccuracy.castOrCopy((QuantitativeAttributeAccuracy) object);
}
- if (object instanceof NonQuantitativeAttributeAccuracy) {
- return DefaultNonQuantitativeAttributeAccuracy.castOrCopy((NonQuantitativeAttributeAccuracy) object);
+ if (object instanceof NonQuantitativeAttributeCorrectness) {
+ return DefaultNonQuantitativeAttributeCorrectness.castOrCopy((NonQuantitativeAttributeCorrectness) object);
}
if (object instanceof ThematicClassificationCorrectness) {
return DefaultThematicClassificationCorrectness.castOrCopy((ThematicClassificationCorrectness) object);
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAbsoluteExternalPositionalAccuracy.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAbsoluteExternalPositionalAccuracy.java
index c4d6101020..7a986098c4 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAbsoluteExternalPositionalAccuracy.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAbsoluteExternalPositionalAccuracy.java
@@ -24,7 +24,8 @@ import org.opengis.metadata.quality.AbsoluteExternalPositionalAccuracy;
/**
* Closeness of reported coordinate values to values accepted as or being true.
- * The following property is mandatory in a well-formed metadata according ISO 19115:
+ * See the {@link AbsoluteExternalPositionalAccuracy} GeoAPI interface for more details.
+ * The following property is mandatory in a well-formed metadata according ISO 19157:
*
* <div class="preformat">{@code DQ_AbsoluteExternalPositionalAccuracy}
* {@code └─result……………} Value obtained from applying a data quality measure.</div>
@@ -47,7 +48,7 @@ import org.opengis.metadata.quality.AbsoluteExternalPositionalAccuracy;
@XmlType(name = "DQ_AbsoluteExternalPositionalAccuracy_Type")
@XmlRootElement(name = "DQ_AbsoluteExternalPositionalAccuracy")
public class DefaultAbsoluteExternalPositionalAccuracy extends AbstractPositionalAccuracy
- implements AbsoluteExternalPositionalAccuracy
+ implements AbsoluteExternalPositionalAccuracy
{
/**
* Serial number for inter-operability with different versions.
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAccuracyOfATimeMeasurement.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAccuracyOfATimeMeasurement.java
index c6391ca70b..4e5627da58 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAccuracyOfATimeMeasurement.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAccuracyOfATimeMeasurement.java
@@ -23,7 +23,8 @@ import org.opengis.metadata.quality.AccuracyOfATimeMeasurement;
/**
* Correctness of the temporal references of an item (reporting of error in time measurement).
- * The following property is mandatory in a well-formed metadata according ISO 19115:
+ * See the {@link AccuracyOfATimeMeasurement} GeoAPI interface for more details.
+ * The following property is mandatory in a well-formed metadata according ISO 19157:
*
* <div class="preformat">{@code DQ_AccuracyOfATimeMeasurement}
* {@code └─result……………} Value obtained from applying a data quality measure.</div>
@@ -39,15 +40,14 @@ import org.opengis.metadata.quality.AccuracyOfATimeMeasurement;
*
* @author Martin Desruisseaux (IRD, Geomatys)
* @author Touraïvane (IRD)
- * @version 1.0
+ * @author Alexis Gaillard (Geomatys)
+ * @version 1.3
* @since 0.3
* @module
*/
@XmlType(name = "DQ_AccuracyOfATimeMeasurement_Type")
@XmlRootElement(name = "DQ_AccuracyOfATimeMeasurement")
-public class DefaultAccuracyOfATimeMeasurement extends AbstractTemporalAccuracy
- implements AccuracyOfATimeMeasurement
-{
+public class DefaultAccuracyOfATimeMeasurement extends AbstractTemporalQuality implements AccuracyOfATimeMeasurement {
/**
* Serial number for inter-operability with different versions.
*/
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultUsability.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAggregationDerivation.java
similarity index 66%
copy from core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultUsability.java
copy to core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAggregationDerivation.java
index 5b97a6dcee..cc1290f709 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultUsability.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAggregationDerivation.java
@@ -18,16 +18,12 @@ package org.apache.sis.metadata.iso.quality;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlRootElement;
-import org.opengis.metadata.quality.Usability;
-import org.apache.sis.internal.xml.LegacyNamespaces;
+import org.opengis.metadata.quality.AggregationDerivation;
/**
- * Degree of adherence of a dataset to a specific set of user requirements.
- * The following property is mandatory in a well-formed metadata according ISO 19115:
- *
- * <div class="preformat">{@code QE_Usability}
- * {@code └─result……………} Value obtained from applying a data quality measure.</div>
+ * Aggregation or derivation method.
+ * See the {@link AggregationDerivation} GeoAPI interface for more details.
*
* <h2>Limitations</h2>
* <ul>
@@ -38,27 +34,24 @@ import org.apache.sis.internal.xml.LegacyNamespaces;
* same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
* </ul>
*
- * @author Cédric Briançon (Geomatys)
+ * @author Alexis Gaillard (Geomatys)
* @author Martin Desruisseaux (Geomatys)
- * @version 1.0
- * @since 0.3
+ * @version 1.3
+ * @since 1.3
* @module
- *
- * @deprecated Not found in ISO 19115-3:2016 schemas.
*/
-@Deprecated
-@XmlType(name = "QE_Usability_Type", namespace = LegacyNamespaces.GMI)
-@XmlRootElement(name = "QE_Usability", namespace = LegacyNamespaces.GMI)
-public class DefaultUsability extends AbstractElement implements Usability {
+@XmlType(name = "DQ_AggregationDerivation_Type")
+@XmlRootElement(name = "DQ_AggregationDerivation")
+public class DefaultAggregationDerivation extends DefaultEvaluationMethod implements AggregationDerivation {
/**
* Serial number for inter-operability with different versions.
*/
- private static final long serialVersionUID = -7316059750787640719L;
+ private static final long serialVersionUID = -4384680754006555546L;
/**
- * Constructs an initially empty usability.
+ * Constructs an initially empty aggregation derivation.
*/
- public DefaultUsability() {
+ public DefaultAggregationDerivation() {
}
/**
@@ -68,9 +61,9 @@ public class DefaultUsability extends AbstractElement implements Usability {
*
* @param object the metadata to copy values from, or {@code null} if none.
*
- * @see #castOrCopy(Usability)
+ * @see #castOrCopy(DefaultAggregationDerivation)
*/
- public DefaultUsability(final Usability object) {
+ public DefaultAggregationDerivation(final AggregationDerivation object) {
super(object);
}
@@ -81,9 +74,9 @@ public class DefaultUsability extends AbstractElement implements Usability {
* <ul>
* <li>If the given object is {@code null}, then this method returns {@code null}.</li>
* <li>Otherwise if the given object is already an instance of
- * {@code DefaultUsability}, then it is returned unchanged.</li>
- * <li>Otherwise a new {@code DefaultUsability} instance is created using the
- * {@linkplain #DefaultUsability(Usability) copy constructor}
+ * {@code DefaultAggregationDerivation}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultAggregationDerivation} instance is created using the
+ * {@linkplain #DefaultAggregationDerivation(AggregationDerivation) copy constructor}
* and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
* metadata contained in the given object are not recursively copied.</li>
* </ul>
@@ -92,10 +85,10 @@ public class DefaultUsability extends AbstractElement implements Usability {
* @return a SIS implementation containing the values of the given object (may be the
* given object itself), or {@code null} if the argument was null.
*/
- public static DefaultUsability castOrCopy(final Usability object) {
- if (object == null || object instanceof DefaultUsability) {
- return (DefaultUsability) object;
+ public static DefaultAggregationDerivation castOrCopy(final AggregationDerivation object) {
+ if (object == null || object instanceof DefaultAggregationDerivation) {
+ return (DefaultAggregationDerivation) object;
}
- return new DefaultUsability(object);
+ return new DefaultAggregationDerivation(object);
}
}
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultBasicMeasure.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultBasicMeasure.java
new file mode 100644
index 0000000000..df1ea55daf
--- /dev/null
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultBasicMeasure.java
@@ -0,0 +1,225 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.metadata.iso.quality;
+
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import org.opengis.util.TypeName;
+import org.opengis.util.InternationalString;
+import org.opengis.metadata.quality.Description;
+import org.opengis.metadata.quality.BasicMeasure;
+import org.apache.sis.xml.Namespaces;
+
+
+/**
+ * Data quality basic measure.
+ * See the {@link BasicMeasure} GeoAPI interface for more details.
+ * The following property is mandatory in a well-formed metadata according ISO 19157:
+ *
+ * <div class="preformat">{@code DQM_BasicMeasure}
+ * {@code ├─name……………………} Name of the data quality basic measure applied to the data.
+ * {@code ├─definition……} Definition of the data quality basic measure.
+ * {@code ├─example……………} Illustration of the use of a data quality measure.
+ * {@code └─valueType………} Value type for the result of the basic measure (shall be one of the data types defined in ISO/TS 19103:2005).</div>
+ *
+ * <h2>Limitations</h2>
+ * <ul>
+ * <li>Instances of this class are not synchronized for multi-threading.
+ * Synchronization, if needed, is caller's responsibility.</li>
+ * <li>Serialized objects of this class are not guaranteed to be compatible with future Apache SIS releases.
+ * Serialization support is appropriate for short term storage or RMI between applications running the
+ * same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
+ * </ul>
+ *
+ * @author Alexis Gaillard (Geomatys)
+ * @author Martin Desruisseaux (Geomatys)
+ * @version 1.3
+ * @since 1.3
+ * @module
+ */
+@XmlType(name = "DQM_BasicMeasure_Type", namespace = Namespaces.DQM, propOrder = {
+ "name",
+ "definition",
+ "example",
+ "valueType"
+})
+@XmlRootElement(name = "DQM_BasicMeasure", namespace = Namespaces.DQM)
+public class DefaultBasicMeasure extends ISOMetadata implements BasicMeasure {
+ /**
+ * Serial number for inter-operability with different versions.
+ */
+ private static final long serialVersionUID = -1665043206717367320L;
+
+ /**
+ * Name of the data quality basic measure applied to the data.
+ */
+ @SuppressWarnings("serial")
+ private InternationalString name;
+
+ /**
+ * Definition of the data quality basic measure.
+ */
+ @SuppressWarnings("serial")
+ private InternationalString definition;
+
+ /**
+ * Illustration of the use of a data quality measure.
+ */
+ @SuppressWarnings("serial")
+ private Description example;
+
+ /**
+ * Value type for the result of the basic measure.
+ */
+ @SuppressWarnings("serial")
+ private TypeName valueType;
+
+ /**
+ * Constructs an initially empty basic measure.
+ */
+ public DefaultBasicMeasure() {
+ }
+
+ /**
+ * Constructs a new instance initialized with the values from the specified metadata object.
+ * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
+ * given object are not recursively copied.
+ *
+ * @param object the metadata to copy values from, or {@code null} if none.
+ *
+ * @see #castOrCopy(BasicMeasure)
+ */
+ public DefaultBasicMeasure(final BasicMeasure object) {
+ super(object);
+ if (object != null) {
+ name = object.getName();
+ definition = object.getDefinition();
+ example = object.getExample();
+ valueType = object.getValueType();
+ }
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable action in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code BasicMeasure}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code BasicMeasure} instance is created using the
+ * {@linkplain #BasicMeasure(Measure) copy constructor} and returned.
+ * Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
+ *
+ * @param object the object to get as a SIS implementation, or {@code null} if none.
+ * @return a SIS implementation containing the values of the given object (may be the
+ * given object itself), or {@code null} if the argument was null.
+ */
+ public static DefaultBasicMeasure castOrCopy(final BasicMeasure object) {
+ if (object == null || object instanceof DefaultBasicMeasure) {
+ return (DefaultBasicMeasure) object;
+ }
+ return new DefaultBasicMeasure(object);
+ }
+
+ /**
+ * Returns the name of the data quality basic measure.
+ *
+ * @return name of the data quality basic measure.
+ */
+ @Override
+ @XmlElement(name = "name", required = true)
+ public InternationalString getName() {
+ return name;
+ }
+
+ /**
+ * Sets the name of the data quality basic measure.
+ *
+ * @param newValue the new basic measure name.
+ */
+ public void setName(final InternationalString newValue) {
+ checkWritePermission(name);
+ name = newValue;
+ }
+
+ /**
+ * Returns the definition of the data quality basic measure.
+ *
+ * @return definition of the data quality basic measure.
+ */
+ @Override
+ @XmlElement(name = "definition", required = true)
+ public InternationalString getDefinition() {
+ return definition;
+ }
+
+ /**
+ * Sets the definition of the data quality basic measure.
+ *
+ * @param newValue the new basic measure definition.
+ */
+ public void setDefinition(final InternationalString newValue) {
+ checkWritePermission(definition);
+ definition = newValue;
+ }
+
+ /**
+ * Returns the illustration of the use of a data quality measure.
+ *
+ * @return usage example, or {@code null} if none.
+ */
+ @Override
+ @XmlElement(name = "example")
+ public Description getExample() {
+ return example;
+ }
+
+ /**
+ * Sets the illustration of the use of a data quality measure.
+ *
+ * @param newValues the new basic measure example.
+ */
+ public void setExample(final Description newValues) {
+ checkWritePermission(example);
+ example = newValues;
+ }
+
+ /**
+ * Returns the value type for the result of the basic measure.
+ *
+ * @return value type of the result for the basic measure.
+ */
+ @Override
+ @XmlElement(name = "valueType", required = true)
+ public TypeName getValueType() {
+ return valueType;
+ }
+
+ /**
+ * Sets the value type for the result of the basic measure.
+ *
+ * @param newValue the new basic measure value type.
+ */
+ public void setValueType(final TypeName newValue) {
+ checkWritePermission(valueType);
+ valueType = newValue;
+ }
+}
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessCommission.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessCommission.java
index ba4d3fa3b7..8ba8bf6299 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessCommission.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessCommission.java
@@ -23,7 +23,8 @@ import org.opengis.metadata.quality.CompletenessCommission;
/**
* Excess data present in the dataset, as described by the scope.
- * The following property is mandatory in a well-formed metadata according ISO 19115:
+ * See the {@link CompletenessCommission} GeoAPI interface for more details.
+ * The following property is mandatory in a well-formed metadata according ISO 19157:
*
* <div class="preformat">{@code DQ_CompletenessCommission}
* {@code └─result……………} Value obtained from applying a data quality measure.</div>
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessOmission.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessOmission.java
index bcebfe32d0..e26db3f839 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessOmission.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessOmission.java
@@ -23,7 +23,8 @@ import org.opengis.metadata.quality.CompletenessOmission;
/**
* Data absent from the dataset, as described by the scope.
- * The following property is mandatory in a well-formed metadata according ISO 19115:
+ * See the {@link CompletenessOmission} GeoAPI interface for more details.
+ * The following property is mandatory in a well-formed metadata according ISO 19157:
*
* <div class="preformat">{@code DQ_CompletenessOmission}
* {@code └─result……………} Value obtained from applying a data quality measure.</div>
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConceptualConsistency.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConceptualConsistency.java
index a366d77693..4682f2b916 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConceptualConsistency.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConceptualConsistency.java
@@ -23,7 +23,8 @@ import org.opengis.metadata.quality.ConceptualConsistency;
/**
* Adherence to rules of the conceptual schema.
- * The following property is mandatory in a well-formed metadata according ISO 19115:
+ * See the {@link ConceptualConsistency} GeoAPI interface for more details.
+ * The following property is mandatory in a well-formed metadata according ISO 19157:
*
* <div class="preformat">{@code DQ_ConceptualConsistency}
* {@code └─result……………} Value obtained from applying a data quality measure.</div>
@@ -45,9 +46,7 @@ import org.opengis.metadata.quality.ConceptualConsistency;
*/
@XmlType(name = "DQ_ConceptualConsistency_Type")
@XmlRootElement(name = "DQ_ConceptualConsistency")
-public class DefaultConceptualConsistency extends AbstractLogicalConsistency
- implements ConceptualConsistency
-{
+public class DefaultConceptualConsistency extends AbstractLogicalConsistency implements ConceptualConsistency {
/**
* Serial number for inter-operability with different versions.
*/
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultUsability.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConfidence.java
similarity index 66%
copy from core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultUsability.java
copy to core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConfidence.java
index 5b97a6dcee..959f34e61c 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultUsability.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConfidence.java
@@ -18,16 +18,17 @@ package org.apache.sis.metadata.iso.quality;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlRootElement;
-import org.opengis.metadata.quality.Usability;
-import org.apache.sis.internal.xml.LegacyNamespaces;
+import org.opengis.metadata.quality.Confidence;
/**
- * Degree of adherence of a dataset to a specific set of user requirements.
- * The following property is mandatory in a well-formed metadata according ISO 19115:
+ * Trustworthiness of a data quality result.
+ * See the {@link Confidence} GeoAPI interface for more details.
+ * The following properties are mandatory in a well-formed metadata according ISO 19157:
*
- * <div class="preformat">{@code QE_Usability}
- * {@code └─result……………} Value obtained from applying a data quality measure.</div>
+ * <div class="preformat">{@code DQ_Confidence}
+ * {@code ├─result…………………………} Value obtained from applying a data quality measure.
+ * {@code └─derivedElement……} Derived element.</div>
*
* <h2>Limitations</h2>
* <ul>
@@ -38,27 +39,23 @@ import org.apache.sis.internal.xml.LegacyNamespaces;
* same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
* </ul>
*
- * @author Cédric Briançon (Geomatys)
+ * @author Alexis Gaillard (Geomatys)
* @author Martin Desruisseaux (Geomatys)
- * @version 1.0
- * @since 0.3
+ * @version 1.3
+ * @since 1.3
* @module
- *
- * @deprecated Not found in ISO 19115-3:2016 schemas.
*/
-@Deprecated
-@XmlType(name = "QE_Usability_Type", namespace = LegacyNamespaces.GMI)
-@XmlRootElement(name = "QE_Usability", namespace = LegacyNamespaces.GMI)
-public class DefaultUsability extends AbstractElement implements Usability {
+@XmlType(name = "DQ_Confidence_Type")
+@XmlRootElement(name = "DQ_Confidence")
+public class DefaultConfidence extends AbstractMetaquality implements Confidence {
/**
* Serial number for inter-operability with different versions.
*/
- private static final long serialVersionUID = -7316059750787640719L;
-
+ private static final long serialVersionUID = -6402647913250621833L;
/**
- * Constructs an initially empty usability.
+ * Constructs an initially empty aggregation derivation.
*/
- public DefaultUsability() {
+ public DefaultConfidence() {
}
/**
@@ -68,9 +65,9 @@ public class DefaultUsability extends AbstractElement implements Usability {
*
* @param object the metadata to copy values from, or {@code null} if none.
*
- * @see #castOrCopy(Usability)
+ * @see #castOrCopy(Confidence)
*/
- public DefaultUsability(final Usability object) {
+ public DefaultConfidence(final Confidence object) {
super(object);
}
@@ -81,9 +78,9 @@ public class DefaultUsability extends AbstractElement implements Usability {
* <ul>
* <li>If the given object is {@code null}, then this method returns {@code null}.</li>
* <li>Otherwise if the given object is already an instance of
- * {@code DefaultUsability}, then it is returned unchanged.</li>
- * <li>Otherwise a new {@code DefaultUsability} instance is created using the
- * {@linkplain #DefaultUsability(Usability) copy constructor}
+ * {@code DefaultConfidence}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultConfidence} instance is created using the
+ * {@linkplain #DefaultConfidence(Confidence) copy constructor}
* and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
* metadata contained in the given object are not recursively copied.</li>
* </ul>
@@ -92,10 +89,10 @@ public class DefaultUsability extends AbstractElement implements Usability {
* @return a SIS implementation containing the values of the given object (may be the
* given object itself), or {@code null} if the argument was null.
*/
- public static DefaultUsability castOrCopy(final Usability object) {
- if (object == null || object instanceof DefaultUsability) {
- return (DefaultUsability) object;
+ public static DefaultConfidence castOrCopy(final Confidence object) {
+ if (object == null || object instanceof DefaultConfidence) {
+ return (DefaultConfidence) object;
}
- return new DefaultUsability(object);
+ return new DefaultConfidence(object);
}
}
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConformanceResult.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConformanceResult.java
index 8dce57bca1..4853bded29 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConformanceResult.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConformanceResult.java
@@ -26,15 +26,14 @@ import org.apache.sis.util.iso.Types;
/**
- * Information about the outcome of evaluating the obtained value (or set of values) against
- * a specified acceptable conformance quality level.
- * The following properties are mandatory in a well-formed metadata according ISO 19115:
+ * Information about the outcome of evaluating the value(s) against a specified acceptable conformance quality level.
+ * See the {@link ConformanceResult} GeoAPI interface for more details.
+ * The following properties are mandatory in a well-formed metadata according ISO 19157:
*
* <div class="preformat">{@code DQ_ConformanceResult}
* {@code ├─specification……………} Citation of product specification or user requirement against which data is being evaluated.
* {@code │ ├─title………………………} Name by which the cited resource is known.
* {@code │ └─date…………………………} Reference date for the cited resource.
- * {@code ├─explanation…………………} Explanation of the meaning of conformance for this result.
* {@code └─pass……………………………………} Indication of the conformance result.</div>
*
* <h2>Limitations</h2>
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCoverageResult.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCoverageResult.java
index c5ff4a8eda..ef87d901d4 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCoverageResult.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCoverageResult.java
@@ -16,26 +16,28 @@
*/
package org.apache.sis.metadata.iso.quality;
+import java.util.Collection;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
+import org.opengis.metadata.quality.CoverageResult;
import org.opengis.metadata.content.CoverageDescription;
+import org.opengis.metadata.content.RangeDimension;
import org.opengis.metadata.distribution.Format;
-import org.opengis.metadata.quality.CoverageResult;
import org.opengis.metadata.distribution.DataFile;
import org.opengis.metadata.spatial.SpatialRepresentation;
import org.opengis.metadata.spatial.SpatialRepresentationType;
+import org.apache.sis.internal.xml.LegacyNamespaces;
/**
* Result of a data quality measure organising the measured values as a coverage.
- * The following properties are mandatory in a well-formed metadata according ISO 19115:
+ * The following properties are mandatory or conditional in a well-formed metadata according ISO 19157:
*
- * <div class="preformat">{@code QE_CoverageResult}
+ * <div class="preformat">{@code DQ_CoverageResult}
* {@code ├─spatialRepresentationType……………………} Method used to spatially represent the coverage result.
* {@code ├─resultSpatialRepresentation………………} Digital representation of data quality measures composing the coverage result.
- * {@code ├─resultContentDescription………………………} Description of the content of the result coverage, i.e. semantic definition of the data quality measures.
- * {@code │ └─attributeDescription………………………} Description of the attribute described by the measurement value.
+ * {@code ├─resultContent……………………………………………………} Description of the content of the result coverage, i.e. semantic definition of the data quality measures.
* {@code ├─resultFormat………………………………………………………} Information about the format of the result coverage data.
* {@code │ └─formatSpecificationCitation……} Citation/URL of the specification format.
* {@code │ ├─title……………………………………………………} Name by which the cited resource is known.
@@ -54,7 +56,7 @@ import org.opengis.metadata.spatial.SpatialRepresentationType;
*
* @author Cédric Briançon (Geomatys)
* @author Martin Desruisseaux (Geomatys)
- * @version 1.0
+ * @version 1.3
* @since 0.3
* @module
*/
@@ -65,7 +67,7 @@ import org.opengis.metadata.spatial.SpatialRepresentationType;
"resultFormat",
"resultFile"
})
-@XmlRootElement(name = "QE_CoverageResult")
+@XmlRootElement(name = "QE_CoverageResult") // "DQ_" in abstract model but "QE_" in XML.
public class DefaultCoverageResult extends AbstractResult implements CoverageResult {
/**
* Serial number for inter-operability with different versions.
@@ -84,9 +86,17 @@ public class DefaultCoverageResult extends AbstractResult implements CoverageRes
private SpatialRepresentation resultSpatialRepresentation;
/**
- * Provides the description of the content of the result coverage, i.e. semantic definition
- * of the data quality measures.
+ * Provides the description of the content of the result coverage.
+ */
+ @SuppressWarnings("serial")
+ private Collection<RangeDimension> resultContent;
+
+ /**
+ * Provides the description of the content of the result coverage.
+ *
+ * @deprecated Replaced by {@link #resultContent}.
*/
+ @Deprecated
@SuppressWarnings("serial")
private CoverageDescription resultContentDescription;
@@ -117,12 +127,14 @@ public class DefaultCoverageResult extends AbstractResult implements CoverageRes
*
* @see #castOrCopy(CoverageResult)
*/
+ @SuppressWarnings("deprecation")
public DefaultCoverageResult(final CoverageResult object) {
super(object);
if (object != null) {
spatialRepresentationType = object.getSpatialRepresentationType();
resultSpatialRepresentation = object.getResultSpatialRepresentation();
resultContentDescription = object.getResultContentDescription();
+ resultContent = copyCollection(object.getResultContent(), RangeDimension.class);
resultFormat = object.getResultFormat();
resultFile = object.getResultFile();
}
@@ -156,7 +168,7 @@ public class DefaultCoverageResult extends AbstractResult implements CoverageRes
/**
* Returns the method used to spatially represent the coverage result.
*
- * @return spatial representation of the coverage result, or {@code null}.
+ * @return spatial representation of the coverage result.
*/
@Override
@XmlElement(name = "spatialRepresentationType", required = true)
@@ -177,7 +189,7 @@ public class DefaultCoverageResult extends AbstractResult implements CoverageRes
/**
* Returns the digital representation of data quality measures composing the coverage result.
*
- * @return digital representation of data quality measures composing the coverage result, or {@code null}.
+ * @return digital representation of data quality measures composing the coverage result.
*/
@Override
@XmlElement(name = "resultSpatialRepresentation", required = true)
@@ -195,14 +207,42 @@ public class DefaultCoverageResult extends AbstractResult implements CoverageRes
resultSpatialRepresentation = newValue;
}
+ /**
+ * Provides the description of the content of the result coverage.
+ * This is the semantic definition of the data quality measures.
+ *
+ * @return description of the content of the result coverage.
+ *
+ * @since 1.3
+ */
+ @Override
+// @XmlElement(name = "resultContent") // Pending new ISO 19157 version.
+ public Collection<RangeDimension> getResultContent() {
+ return resultContent = nonNullCollection(resultContent, RangeDimension.class);
+ }
+
+ /**
+ * Sets the description of the content of the result coverage.
+ *
+ * @param newValues the new descriptions.
+ *
+ * @since 1.3
+ */
+ public void setResultContent(final Collection<RangeDimension> newValues) {
+ resultContent = writeCollection(newValues, resultContent, RangeDimension.class);
+ }
+
/**
* Returns the description of the content of the result coverage, i.e. semantic definition
* of the data quality measures.
*
* @return description of the content of the result coverage, or {@code null}.
+ *
+ * @deprecated Replaced by {@link #getResultContent()}.
*/
@Override
- @XmlElement(name = "resultContentDescription", required = true)
+ @Deprecated
+ @XmlElement(name = "resultContentDescription", namespace = LegacyNamespaces.GMI)
public CoverageDescription getResultContentDescription() {
return resultContentDescription;
}
@@ -212,7 +252,10 @@ public class DefaultCoverageResult extends AbstractResult implements CoverageRes
* of the data quality measures.
*
* @param newValue the new content description value.
+ *
+ * @deprecated Replaced by {@link #setResultContent(Collection)}.
*/
+ @Deprecated
public void setResultContentDescription(final CoverageDescription newValue) {
checkWritePermission(resultContentDescription);
resultContentDescription = newValue;
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDataQuality.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDataQuality.java
index 40ad04e689..6389f6eb7a 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDataQuality.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDataQuality.java
@@ -23,9 +23,9 @@ import javax.xml.bind.annotation.XmlRootElement;
import org.opengis.metadata.lineage.Lineage;
import org.opengis.metadata.quality.DataQuality;
import org.opengis.metadata.quality.Element;
+import org.opengis.metadata.quality.StandaloneQualityReportInformation;
import org.opengis.metadata.maintenance.Scope;
import org.opengis.metadata.maintenance.ScopeCode;
-import org.apache.sis.metadata.iso.ISOMetadata;
import org.apache.sis.metadata.iso.maintenance.DefaultScope;
import org.apache.sis.internal.jaxb.FilterByVersion;
import org.apache.sis.internal.xml.LegacyNamespaces;
@@ -33,15 +33,12 @@ import org.apache.sis.internal.xml.LegacyNamespaces;
/**
* Quality information for the data specified by a data quality scope.
- * The following properties are mandatory in a well-formed metadata according ISO 19115:
+ * The following properties are mandatory in a well-formed metadata according ISO 19157:
*
* <div class="preformat">{@code DQ_DataQuality}
- * {@code └─scope………………} The specific data to which the data quality information applies.
- * {@code └─level……} Hierarchical level of the data specified by the scope.</div>
- *
- * In addition, ISO requires that at least one of {@linkplain #getLineage() lineage}
- * and {@linkplain #getReports() reports} is provided. Those properties are declared
- * {@linkplain org.opengis.annotation.Obligation#CONDITIONAL conditional}.
+ * {@code ├─scope………………} The specific data to which the data quality information applies.
+ * {@code │ └─level……} Hierarchical level of the data specified by the scope.
+ * {@code └─report……………} Quantitative quality information for the data specified by the scope.</div>
*
* <h2>Limitations</h2>
* <ul>
@@ -54,13 +51,15 @@ import org.apache.sis.internal.xml.LegacyNamespaces;
*
* @author Martin Desruisseaux (IRD, Geomatys)
* @author Touraïvane (IRD)
- * @version 1.0
+ * @author Alexis Gaillard (Geomatys)
+ * @version 1.3
* @since 0.3
* @module
*/
@XmlType(name = "DQ_DataQuality_Type", propOrder = {
"scope",
"reports",
+ "standaloneQualityReport",
"lineage"
})
@XmlRootElement(name = "DQ_DataQuality")
@@ -77,21 +76,27 @@ public class DefaultDataQuality extends ISOMetadata implements DataQuality {
private Scope scope;
/**
- * Quantitative quality information for the data specified by the scope.
- * Should be provided only if {@linkplain Scope#getLevel scope level} is
- * {@linkplain org.opengis.metadata.maintenance.ScopeCode#DATASET dataset}.
+ * Quality information for the data specified by the scope.
*/
@SuppressWarnings("serial")
private Collection<Element> reports;
/**
* Non-quantitative quality information about the lineage of the data specified by the scope.
- * Should be provided only if {@linkplain Scope#getLevel scope level} is
- * {@linkplain org.opengis.metadata.maintenance.ScopeCode#DATASET dataset}.
+ *
+ * @deprecated Removed from ISO 19157:2013.
*/
+ @Deprecated
@SuppressWarnings("serial")
private Lineage lineage;
+ /**
+ * Reference to an external standalone quality report.
+ * Can be used for providing more details than reported as standard metadata.
+ */
+ @SuppressWarnings("serial")
+ private StandaloneQualityReportInformation standaloneQualityReport;
+
/**
* Constructs an initially empty data quality.
*/
@@ -133,9 +138,10 @@ public class DefaultDataQuality extends ISOMetadata implements DataQuality {
public DefaultDataQuality(final DataQuality object) {
super(object);
if (object != null) {
- scope = object.getScope();
- reports = copyCollection(object.getReports(), Element.class);
- lineage = object.getLineage();
+ scope = object.getScope();
+ reports = copyCollection(object.getReports(), Element.class);
+ standaloneQualityReport = object.getStandaloneQualityReport();
+ lineage = object.getLineage();
}
}
@@ -167,7 +173,7 @@ public class DefaultDataQuality extends ISOMetadata implements DataQuality {
/**
* Returns the specific data to which the data quality information applies.
*
- * @return the specific data to which the data quality information applies, or {@code null}.
+ * @return the specific data to which the data quality information applies.
*/
@Override
@XmlElement(name = "scope", required = true)
@@ -186,9 +192,9 @@ public class DefaultDataQuality extends ISOMetadata implements DataQuality {
}
/**
- * Returns the quantitative quality information for the data specified by the scope.
+ * Returns the quality information for the data specified by the scope.
*
- * @return quantitative quality information for the data.
+ * @return quality information for the data specified by the scope.
*/
@Override
@XmlElement(name = "report", required = true)
@@ -197,7 +203,7 @@ public class DefaultDataQuality extends ISOMetadata implements DataQuality {
}
/**
- * Sets the quantitative quality information for the data specified by the scope.
+ * Sets the quality information for the data specified by the scope.
*
* @param newValues the new reports.
*/
@@ -205,14 +211,41 @@ public class DefaultDataQuality extends ISOMetadata implements DataQuality {
reports = writeCollection(newValues, reports, Element.class);
}
+ /**
+ * Returns the reference to an external standalone quality report.
+ * Can be used for providing more details than reported as standard metadata.
+ *
+ * @return reference to an external standalone quality report, or {@code null} if none.
+ *
+ * @since 1.3
+ */
+ @Override
+ @XmlElement(name = "standaloneQualityReport")
+ public StandaloneQualityReportInformation getStandaloneQualityReport() {
+ return FilterByVersion.CURRENT_METADATA.accept() ? standaloneQualityReport : null;
+ }
+
+ /**
+ * Sets the quality of the reported information.
+ *
+ * @param newValue the new quality information.
+ *
+ * @since 1.3
+ */
+ public void setStandaloneQualityReport(final StandaloneQualityReportInformation newValue) {
+ checkWritePermission(standaloneQualityReport);
+ standaloneQualityReport = newValue;
+ }
+
/**
* Returns non-quantitative quality information about the lineage of the data specified by the scope.
*
* @return non-quantitative quality information about the lineage of the data specified, or {@code null}.
*
- * @see <a href="https://issues.apache.org/jira/browse/SIS-394">Issue SIS-394</a>
+ * @deprecated Removed from ISO 19157:2013.
*/
@Override
+ @Deprecated
@XmlElement(name = "lineage", namespace = LegacyNamespaces.GMD)
public Lineage getLineage() {
return FilterByVersion.LEGACY_METADATA.accept() ? lineage : null;
@@ -222,7 +255,10 @@ public class DefaultDataQuality extends ISOMetadata implements DataQuality {
* Sets the non-quantitative quality information about the lineage of the data specified by the scope.
*
* @param newValue the new lineage.
+ *
+ * @deprecated Removed from ISO 19157:2013.
*/
+ @Deprecated
public void setLineage(final Lineage newValue) {
checkWritePermission(lineage);
lineage = newValue;
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDescription.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDescription.java
new file mode 100644
index 0000000000..5e55eaf6e0
--- /dev/null
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDescription.java
@@ -0,0 +1,162 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.metadata.iso.quality;
+
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import org.opengis.util.InternationalString;
+import org.opengis.metadata.quality.Description;
+import org.opengis.metadata.identification.BrowseGraphic;
+import org.apache.sis.xml.Namespaces;
+
+
+/**
+ * Data quality measure description.
+ * The following property is mandatory in a well-formed metadata according ISO 19157:
+ *
+ * <div class="preformat">{@code DQM_Description}
+ * {@code └─textDescription……………} Text description.</div>
+ *
+ * <h2>Limitations</h2>
+ * <ul>
+ * <li>Instances of this class are not synchronized for multi-threading.
+ * Synchronization, if needed, is caller's responsibility.</li>
+ * <li>Serialized objects of this class are not guaranteed to be compatible with future Apache SIS releases.
+ * Serialization support is appropriate for short term storage or RMI between applications running the
+ * same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
+ * </ul>
+ *
+ * @author Alexis Gaillard (Geomatys)
+ * @author Martin Desruisseaux (Geomatys)
+ * @version 1.3
+ * @since 1.3
+ * @module
+ */
+@XmlType(name = "DQM_Description_Type", namespace = Namespaces.DQM, propOrder = {
+ "textDescription",
+ "extendedDescription"
+})
+@XmlRootElement(name = "DQM_Description", namespace = Namespaces.DQM)
+public class DefaultDescription extends ISOMetadata implements Description {
+ /**
+ * Serial number for inter-operability with different versions.
+ */
+ private static final long serialVersionUID = 4878784271547209576L;
+
+ /**
+ * Text description.
+ */
+ @SuppressWarnings("serial")
+ private InternationalString textDescription;
+
+ /**
+ * Illustration.
+ */
+ @SuppressWarnings("serial")
+ private BrowseGraphic extendedDescription;
+
+ /**
+ * Constructs an initially empty description.
+ */
+ public DefaultDescription() {
+ }
+
+ /**
+ * Constructs a new instance initialized with the values from the specified metadata object.
+ * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
+ * given object are not recursively copied.
+ *
+ * @param object the metadata to copy values from, or {@code null} if none.
+ *
+ * @see #castOrCopy(Description)
+ */
+ public DefaultDescription(final Description object) {
+ super(object);
+ if (object != null) {
+ textDescription = object.getTextDescription();
+ extendedDescription = object.getExtendedDescription();
+ }
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable action in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultDescription}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultDescription} instance is created using the
+ * {@linkplain #DefaultDescription(Description) copy constructor} and returned.
+ * Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
+ *
+ * @param object the object to get as a SIS implementation, or {@code null} if none.
+ * @return a SIS implementation containing the values of the given object (may be the
+ * given object itself), or {@code null} if the argument was null.
+ */
+ public static DefaultDescription castOrCopy(final Description object) {
+ if (object == null || object instanceof DefaultDescription) {
+ return (DefaultDescription) object;
+ }
+ return new DefaultDescription(object);
+ }
+
+ /**
+ * Returns the text description.
+ *
+ * @return text description.
+ */
+ @Override
+ @XmlElement(name = "textDescription", required = true)
+ public InternationalString getTextDescription() {
+ return textDescription;
+ }
+
+ /**
+ * Sets the text description.
+ *
+ * @param newValue the new description text.
+ */
+ public void setTextDescription(final InternationalString newValue) {
+ checkWritePermission(textDescription);
+ textDescription = newValue;
+ }
+
+ /**
+ * Returns the illustration.
+ *
+ * @return description illustration, or {@code null} if none.
+ */
+ @Override
+ @XmlElement(name = "extendedDescription")
+ public BrowseGraphic getExtendedDescription() {
+ return extendedDescription;
+ }
+
+ /**
+ * Sets the illustration.
+ *
+ * @param newValue the new description illustration.
+ */
+ public void setExtendedDescription(final BrowseGraphic newValue) {
+ checkWritePermission(extendedDescription);
+ extendedDescription = newValue;
+ }
+}
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultFormatConsistency.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDescriptiveResult.java
similarity index 50%
copy from core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultFormatConsistency.java
copy to core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDescriptiveResult.java
index 33b0b84fed..d7b7868f33 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultFormatConsistency.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDescriptiveResult.java
@@ -17,16 +17,19 @@
package org.apache.sis.metadata.iso.quality;
import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
-import org.opengis.metadata.quality.FormatConsistency;
+import org.opengis.util.InternationalString;
+import org.opengis.metadata.quality.DescriptiveResult;
/**
- * Degree to which data is stored in accordance with the physical structure of the dataset, as described by the scope.
- * The following property is mandatory in a well-formed metadata according ISO 19115:
+ * Data quality descriptive result.
+ * See the {@link DescriptiveResult} GeoAPI interface for more details.
+ * The following properties are mandatory in a well-formed metadata according ISO 19157:
*
- * <div class="preformat">{@code DQ_FormatConsistency}
- * {@code └─result……………} Value obtained from applying a data quality measure.</div>
+ * <div class="preformat">{@code DQ_DescriptiveResult}
+ * {@code └─statement……………} textual expression of the descriptive result.</div>
*
* <h2>Limitations</h2>
* <ul>
@@ -37,24 +40,41 @@ import org.opengis.metadata.quality.FormatConsistency;
* same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
* </ul>
*
- * @author Martin Desruisseaux (IRD, Geomatys)
- * @author Touraïvane (IRD)
- * @version 1.0
- * @since 0.3
+ * @author Alexis Gaillard (Geomatys)
+ * @author Martin Desruisseaux (Geomatys)
+ * @version 1.3
+ * @since 1.3
* @module
*/
-@XmlType(name = "DQ_FormatConsistency_Type")
-@XmlRootElement(name = "DQ_FormatConsistency")
-public class DefaultFormatConsistency extends AbstractLogicalConsistency implements FormatConsistency {
+@XmlType(name = "DQ_DescriptiveResult_Type", propOrder = {
+ "statement"
+})
+@XmlRootElement(name = "DQ_DescriptiveResult")
+public class DefaultDescriptiveResult extends AbstractResult implements DescriptiveResult {
/**
* Serial number for inter-operability with different versions.
*/
- private static final long serialVersionUID = -1891952351079148415L;
+ private static final long serialVersionUID = 5786649528259918304L;
/**
- * Constructs an initially empty formal consistency.
+ * Textual expression of the descriptive result.
*/
- public DefaultFormatConsistency() {
+ @SuppressWarnings("serial")
+ private InternationalString statement;
+
+ /**
+ * Constructs an initially empty descriptive result.
+ */
+ public DefaultDescriptiveResult() {
+ }
+
+ /**
+ * Creates a conformance result initialized to the given values.
+ *
+ * @param statement statement against which data is being evaluated, or {@code null}.
+ */
+ public DefaultDescriptiveResult(final InternationalString statement) {
+ this.statement = statement;
}
/**
@@ -64,10 +84,13 @@ public class DefaultFormatConsistency extends AbstractLogicalConsistency impleme
*
* @param object the metadata to copy values from, or {@code null} if none.
*
- * @see #castOrCopy(FormatConsistency)
+ * @see #castOrCopy(DescriptiveResult)
*/
- public DefaultFormatConsistency(final FormatConsistency object) {
+ public DefaultDescriptiveResult(final DescriptiveResult object) {
super(object);
+ if (object != null) {
+ statement = object.getStatement();
+ }
}
/**
@@ -77,10 +100,10 @@ public class DefaultFormatConsistency extends AbstractLogicalConsistency impleme
* <ul>
* <li>If the given object is {@code null}, then this method returns {@code null}.</li>
* <li>Otherwise if the given object is already an instance of
- * {@code DefaultFormatConsistency}, then it is returned unchanged.</li>
- * <li>Otherwise a new {@code DefaultFormatConsistency} instance is created using the
- * {@linkplain #DefaultFormatConsistency(FormatConsistency) copy constructor}
- * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * {@code DefaultDescriptiveResult}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultDescriptiveResult} instance is created using the
+ * {@linkplain #DefaultDescriptiveResult(DescriptiveResult) copy constructor} and returned.
+ * Note that this is a <cite>shallow</cite> copy operation, since the other
* metadata contained in the given object are not recursively copied.</li>
* </ul>
*
@@ -88,10 +111,31 @@ public class DefaultFormatConsistency extends AbstractLogicalConsistency impleme
* @return a SIS implementation containing the values of the given object (may be the
* given object itself), or {@code null} if the argument was null.
*/
- public static DefaultFormatConsistency castOrCopy(final FormatConsistency object) {
- if (object == null || object instanceof DefaultFormatConsistency) {
- return (DefaultFormatConsistency) object;
+ public static DefaultDescriptiveResult castOrCopy(final DescriptiveResult object) {
+ if (object == null || object instanceof DefaultDescriptiveResult) {
+ return (DefaultDescriptiveResult) object;
}
- return new DefaultFormatConsistency(object);
+ return new DefaultDescriptiveResult(object);
+ }
+
+ /**
+ * Returns the textual expression of the descriptive result.
+ *
+ * @return textual expression of the result.
+ */
+ @Override
+ @XmlElement(name = "statement", required = true)
+ public InternationalString getStatement() {
+ return statement;
+ }
+
+ /**
+ * Sets the textual expression of the descriptive result.
+ *
+ * @param newValue the new expression.
+ */
+ public void setStatement(final InternationalString newValue) {
+ checkWritePermission(statement);
+ statement = newValue;
}
}
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDomainConsistency.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDomainConsistency.java
index 1a92e185a6..aa77d854f1 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDomainConsistency.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultDomainConsistency.java
@@ -23,7 +23,8 @@ import org.opengis.metadata.quality.DomainConsistency;
/**
* Adherence of values to the value domains.
- * The following property is mandatory in a well-formed metadata according ISO 19115:
+ * See the {@link DomainConsistency} GeoAPI interface for more details.
+ * The following property is mandatory in a well-formed metadata according ISO 19157:
*
* <div class="preformat">{@code DQ_DomainConsistency}
* {@code └─result……………} Value obtained from applying a data quality measure.</div>
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultEvaluationMethod.java
similarity index 57%
copy from core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java
copy to core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultEvaluationMethod.java
index 5febb30461..dc9013c527 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultEvaluationMethod.java
@@ -25,22 +25,13 @@ import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSeeAlso;
-import org.opengis.metadata.Identifier;
+import org.opengis.util.InternationalString;
import org.opengis.metadata.citation.Citation;
-import org.opengis.metadata.quality.Result;
-import org.opengis.metadata.quality.Element;
-import org.opengis.metadata.quality.Usability;
-import org.opengis.metadata.quality.Completeness;
-import org.opengis.metadata.quality.TemporalAccuracy;
-import org.opengis.metadata.quality.ThematicAccuracy;
-import org.opengis.metadata.quality.PositionalAccuracy;
-import org.opengis.metadata.quality.LogicalConsistency;
+import org.opengis.metadata.quality.EvaluationMethod;
import org.opengis.metadata.quality.EvaluationMethodType;
-import org.opengis.util.InternationalString;
-import org.apache.sis.metadata.iso.ISOMetadata;
+import org.opengis.metadata.quality.DataEvaluation;
+import org.opengis.metadata.quality.AggregationDerivation;
import org.apache.sis.internal.system.Semaphores;
-import org.apache.sis.internal.jaxb.FilterByVersion;
-import org.apache.sis.internal.xml.LegacyNamespaces;
import org.apache.sis.util.collection.CheckedContainer;
import org.apache.sis.util.resources.Errors;
@@ -49,11 +40,8 @@ import static org.apache.sis.internal.metadata.ImplementationHelper.valueIfDefin
/**
- * Type of test applied to the data specified by a data quality scope.
- * The following property is mandatory in a well-formed metadata according ISO 19115:
- *
- * <div class="preformat">{@code DQ_Element}
- * {@code └─result……………} Value obtained from applying a data quality measure.</div>
+ * Description of the evaluation method and procedure applied.
+ * See the {@link EvaluationMethod} GeoAPI interface for more details.
*
* <h2>Limitations</h2>
* <ul>
@@ -64,60 +52,33 @@ import static org.apache.sis.internal.metadata.ImplementationHelper.valueIfDefin
* same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
* </ul>
*
- * @author Martin Desruisseaux (IRD, Geomatys)
- * @author Touraïvane (IRD)
- * @author Guilhem Legal (Geomatys)
- * @version 1.0
- * @since 0.3
+ * @author Alexis Gaillard (Geomatys)
+ * @author Martin Desruisseaux (Geomatys)
+ * @version 1.3
+ * @since 1.3
* @module
*/
-@XmlType(name = "AbstractDQ_Element_Type", propOrder = {
- "namesOfMeasure",
- "measureIdentification",
- "measureDescription",
+@XmlType(name = "DQ_EvaluationMethod_Type", propOrder = {
"evaluationMethodType",
"evaluationMethodDescription",
"evaluationProcedure",
- "dates",
- "results"
+ "referenceDocuments",
+ "dates"
})
-@XmlRootElement(name = "AbstractDQ_Element")
+@XmlRootElement(name = "DQ_EvaluationMethod")
@XmlSeeAlso({
- AbstractCompleteness.class,
- AbstractLogicalConsistency.class,
- AbstractPositionalAccuracy.class,
- AbstractThematicAccuracy.class,
- AbstractTemporalAccuracy.class,
- DefaultUsability.class
+ AbstractDataEvaluation.class,
+ DefaultAggregationDerivation.class
})
-public class AbstractElement extends ISOMetadata implements Element {
+public class DefaultEvaluationMethod extends ISOMetadata implements EvaluationMethod {
/**
* Serial number for inter-operability with different versions.
*/
- private static final long serialVersionUID = 3963454452767190970L;
-
- /**
- * Name of the test applied to the data.
- */
- @SuppressWarnings("serial")
- private Collection<InternationalString> namesOfMeasure;
+ private static final long serialVersionUID = 5196994626251088685L;
/**
- * Code identifying a registered standard procedure, or {@code null} if none.
+ * Type of method used to evaluate quality of the data.
*/
- @SuppressWarnings("serial")
- private Identifier measureIdentification;
-
- /**
- * Description of the measure being determined.
- */
- @SuppressWarnings("serial")
- private InternationalString measureDescription;
-
- /**
- * Type of method used to evaluate quality of the dataset, or {@code null} if unspecified.
- */
- @SuppressWarnings("serial")
private EvaluationMethodType evaluationMethodType;
/**
@@ -127,15 +88,19 @@ public class AbstractElement extends ISOMetadata implements Element {
private InternationalString evaluationMethodDescription;
/**
- * Reference to the procedure information, or {@code null} if none.
+ * Reference to the procedure information.
*/
@SuppressWarnings("serial")
private Citation evaluationProcedure;
/**
- * Start time ({@code date1}) and end time ({@code date2}) on which a data quality measure was applied.
- *
- * @todo Needs to be made unmodifiable after transition to {@link State#FINAL}.
+ * Information on documents which are referenced in developing and applying a data quality evaluation method.
+ */
+ @SuppressWarnings("serial")
+ private Collection<Citation> referenceDocuments;
+
+ /**
+ * Date or range of dates on which a data quality measure was applied.
*/
private Dates dates;
@@ -251,9 +216,7 @@ public class AbstractElement extends ISOMetadata implements Element {
return;
}
case 1: {
- if (date1 == Long.MIN_VALUE) {
- break; // Exception will be thrown below.
- }
+ if (date1 == Long.MIN_VALUE) break; // Exception will be thrown below.
date2 = date;
modCount++;
return;
@@ -301,27 +264,9 @@ public class AbstractElement extends ISOMetadata implements Element {
}
/**
- * Value (or set of values) obtained from applying a data quality measure or the out
- * come of evaluating the obtained value (or set of values) against a specified
- * acceptable conformance quality level.
- */
- @SuppressWarnings("serial")
- private Collection<Result> results;
-
- /**
- * Constructs an initially empty element.
+ * Constructs an initially empty evaluation method.
*/
- public AbstractElement() {
- }
-
- /**
- * Creates an element initialized to the given result.
- *
- * @param result the value obtained from applying a data quality measure against a specified
- * acceptable conformance quality level.
- */
- public AbstractElement(final Result result) {
- results = singleton(result, Result.class);
+ public DefaultEvaluationMethod() {
}
/**
@@ -329,20 +274,17 @@ public class AbstractElement extends ISOMetadata implements Element {
* This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
* given object are not recursively copied.
*
- * @param object the metadata to copy values from, or {@code null} if none.
+ * @param object the metadata to copy values from, or {@code null} if none.
*
- * @see #castOrCopy(Element)
+ * @see #castOrCopy(EvaluationMethod)
*/
- public AbstractElement(final Element object) {
+ public DefaultEvaluationMethod(final EvaluationMethod object) {
super(object);
if (object != null) {
- namesOfMeasure = copyCollection(object.getNamesOfMeasure(), InternationalString.class);
- measureIdentification = object.getMeasureIdentification();
- measureDescription = object.getMeasureDescription();
evaluationMethodType = object.getEvaluationMethodType();
evaluationMethodDescription = object.getEvaluationMethodDescription();
evaluationProcedure = object.getEvaluationProcedure();
- results = copyCollection(object.getResults(), Result.class);
+ referenceDocuments = copyCollection(object.getReferenceDocuments(), Citation.class);
writeDates(object.getDates());
}
}
@@ -353,16 +295,14 @@ public class AbstractElement extends ISOMetadata implements Element {
*
* <ul>
* <li>If the given object is {@code null}, then this method returns {@code null}.</li>
- * <li>Otherwise if the given object is an instance of {@link PositionalAccuracy},
- * {@link TemporalAccuracy}, {@link ThematicAccuracy}, {@link LogicalConsistency},
- * {@link Completeness} or {@link Usability}, then this method delegates to the
- * {@code castOrCopy(…)} method of the corresponding SIS subclass.
+ * <li>Otherwise if the given object is an instance of {@link DataEvaluation} or {@link AggregationDerivation},
+ * then this method delegates to the {@code castOrCopy(…)} method of the corresponding SIS subclass.
* Note that if the given object implements more than one of the above-cited interfaces,
* then the {@code castOrCopy(…)} method to be used is unspecified.</li>
* <li>Otherwise if the given object is already an instance of
- * {@code AbstractElement}, then it is returned unchanged.</li>
- * <li>Otherwise a new {@code AbstractElement} instance is created using the
- * {@linkplain #AbstractElement(Element) copy constructor}
+ * {@code DefaultEvaluationMethod}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultEvaluationMethod} instance is created using the
+ * {@linkplain #DefaultEvaluationMethod(EvaluationMethod) copy constructor}
* and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
* metadata contained in the given object are not recursively copied.</li>
* </ul>
@@ -371,116 +311,33 @@ public class AbstractElement extends ISOMetadata implements Element {
* @return a SIS implementation containing the values of the given object (may be the
* given object itself), or {@code null} if the argument was null.
*/
- public static AbstractElement castOrCopy(final Element object) {
- if (object instanceof PositionalAccuracy) {
- return AbstractPositionalAccuracy.castOrCopy((PositionalAccuracy) object);
- }
- if (object instanceof TemporalAccuracy) {
- return AbstractTemporalAccuracy.castOrCopy((TemporalAccuracy) object);
+ public static DefaultEvaluationMethod castOrCopy(final EvaluationMethod object) {
+ if (object instanceof DataEvaluation) {
+ return AbstractDataEvaluation.castOrCopy((DataEvaluation) object);
}
- if (object instanceof ThematicAccuracy) {
- return AbstractThematicAccuracy.castOrCopy((ThematicAccuracy) object);
- }
- if (object instanceof LogicalConsistency) {
- return AbstractLogicalConsistency.castOrCopy((LogicalConsistency) object);
- }
- if (object instanceof Completeness) {
- return AbstractCompleteness.castOrCopy((Completeness) object);
- }
- if (object instanceof Usability) {
- return DefaultUsability.castOrCopy((Usability) object);
+ if (object instanceof AggregationDerivation) {
+ return DefaultAggregationDerivation.castOrCopy((AggregationDerivation) object);
}
// Intentionally tested after the sub-interfaces.
- if (object == null || object instanceof AbstractElement) {
- return (AbstractElement) object;
+ if (object == null || object instanceof DefaultEvaluationMethod) {
+ return (DefaultEvaluationMethod) object;
}
- return new AbstractElement(object);
- }
-
- /**
- * Returns the name of the test applied to the data.
- *
- * @return name of the test applied to the data.
- *
- * @see <a href="https://issues.apache.org/jira/browse/SIS-394">Issue SIS-394</a>
- */
- @Override
- @XmlElement(name = "nameOfMeasure", namespace = LegacyNamespaces.GMD)
- public Collection<InternationalString> getNamesOfMeasure() {
- if (!FilterByVersion.LEGACY_METADATA.accept()) return null;
- return namesOfMeasure = nonNullCollection(namesOfMeasure, InternationalString.class);
- }
-
- /**
- * Sets the name of the test applied to the data.
- *
- * @param newValues the new name of measures.
- */
- public void setNamesOfMeasure(final Collection<? extends InternationalString> newValues) {
- namesOfMeasure = writeCollection(newValues, namesOfMeasure, InternationalString.class);
+ return new DefaultEvaluationMethod(object);
}
/**
- * Returns the code identifying a registered standard procedure, or {@code null} if none.
- *
- * @return code identifying a registered standard procedure, or {@code null}.
+ * Returns the type of method used to evaluate quality of the data.
*
- * @see <a href="https://issues.apache.org/jira/browse/SIS-394">Issue SIS-394</a>
+ * @return type of method used to evaluate quality, or {@code null} if none.
*/
@Override
- @XmlElement(name = "measureIdentification", namespace = LegacyNamespaces.GMD)
- public Identifier getMeasureIdentification() {
- return FilterByVersion.LEGACY_METADATA.accept() ? measureIdentification : null;
- }
-
- /**
- * Sets the code identifying a registered standard procedure.
- *
- * @param newValue the new measure identification.
- */
- public void setMeasureIdentification(final Identifier newValue) {
- checkWritePermission(measureIdentification);
- measureIdentification = newValue;
- }
-
- /**
- * Returns the description of the measure being determined.
- *
- * @return description of the measure being determined, or {@code null}.
- *
- * @see <a href="https://issues.apache.org/jira/browse/SIS-394">Issue SIS-394</a>
- */
- @Override
- @XmlElement(name = "measureDescription", namespace = LegacyNamespaces.GMD)
- public InternationalString getMeasureDescription() {
- return FilterByVersion.LEGACY_METADATA.accept() ? measureDescription : null;
- }
-
- /**
- * Sets the description of the measure being determined.
- *
- * @param newValue the new measure description.
- */
- public void setMeasureDescription(final InternationalString newValue) {
- checkWritePermission(measureDescription);
- measureDescription = newValue;
- }
-
- /**
- * Returns the type of method used to evaluate quality of the dataset.
- *
- * @return type of method used to evaluate quality, or {@code null}.
- *
- * @see <a href="https://issues.apache.org/jira/browse/SIS-394">Issue SIS-394</a>
- */
- @Override
- @XmlElement(name = "evaluationMethodType", namespace = LegacyNamespaces.GMD)
+ @XmlElement(name = "evaluationMethodType")
public EvaluationMethodType getEvaluationMethodType() {
- return FilterByVersion.LEGACY_METADATA.accept() ? evaluationMethodType : null;
+ return evaluationMethodType;
}
/**
- * Sets the type of method used to evaluate quality of the dataset.
+ * Sets the type of method used to evaluate quality of the data.
*
* @param newValue the new evaluation method type.
*/
@@ -492,14 +349,12 @@ public class AbstractElement extends ISOMetadata implements Element {
/**
* Returns the description of the evaluation method.
*
- * @return description of the evaluation method, or {@code null}.
- *
- * @see <a href="https://issues.apache.org/jira/browse/SIS-394">Issue SIS-394</a>
+ * @return description of the evaluation method, or {@code null} if none.
*/
@Override
- @XmlElement(name = "evaluationMethodDescription", namespace = LegacyNamespaces.GMD)
+ @XmlElement(name = "evaluationMethodDescription")
public InternationalString getEvaluationMethodDescription() {
- return FilterByVersion.LEGACY_METADATA.accept() ? evaluationMethodDescription : null;
+ return evaluationMethodDescription;
}
/**
@@ -513,16 +368,14 @@ public class AbstractElement extends ISOMetadata implements Element {
}
/**
- * Returns the reference to the procedure information, or {@code null} if none.
+ * Returns the reference to the procedure information.
*
- * @return reference to the procedure information, or {@code null}.
- *
- * @see <a href="https://issues.apache.org/jira/browse/SIS-394">Issue SIS-394</a>
+ * @return reference to the procedure information, or {@code null} if none.
*/
@Override
- @XmlElement(name = "evaluationProcedure", namespace = LegacyNamespaces.GMD)
+ @XmlElement(name = "evaluationProcedure")
public Citation getEvaluationProcedure() {
- return FilterByVersion.LEGACY_METADATA.accept() ? evaluationProcedure : null;
+ return evaluationProcedure;
}
/**
@@ -535,6 +388,26 @@ public class AbstractElement extends ISOMetadata implements Element {
evaluationProcedure = newValue;
}
+ /**
+ * Returns information on documents which are referenced in developing and applying a data quality evaluation method.
+ *
+ * @return documents referenced in data quality evaluation method.
+ */
+ @Override
+ @XmlElement(name = "referenceDoc")
+ public Collection<Citation> getReferenceDocuments() {
+ return referenceDocuments = nonNullCollection(referenceDocuments, Citation.class);
+ }
+
+ /**
+ * Sets the information on documents referenced in data quality evaluation method.
+ *
+ * @param newValues the new name of measures.
+ */
+ public void setReferenceDocuments(final Collection<? extends Citation> newValues) {
+ referenceDocuments = writeCollection(newValues, referenceDocuments, Citation.class);
+ }
+
/**
* Returns the date or range of dates on which a data quality measure was applied.
* The collection size is 1 for a single date, or 2 for a range.
@@ -543,7 +416,7 @@ public class AbstractElement extends ISOMetadata implements Element {
* @return date or range of dates on which a data quality measure was applied.
*/
@Override
- @XmlElement(name = "dateTime", namespace = LegacyNamespaces.GMD)
+ @XmlElement(name = "dateTime")
@SuppressWarnings("ReturnOfCollectionOrArrayField")
public Collection<Date> getDates() {
if (Semaphores.query(Semaphores.NULL_COLLECTION)) {
@@ -582,28 +455,4 @@ public class AbstractElement extends ISOMetadata implements Element {
dates.addAll(newValues);
}
}
-
- /**
- * Returns the value (or set of values) obtained from applying a data quality measure or
- * the out come of evaluating the obtained value (or set of values) against a specified
- * acceptable conformance quality level.
- *
- * @return set of values obtained from applying a data quality measure.
- */
- @Override
- @XmlElement(name = "result", required = true)
- public Collection<Result> getResults() {
- return results = nonNullCollection(results, Result.class);
- }
-
- /**
- * Sets the value (or set of values) obtained from applying a data quality measure or
- * the out come of evaluating the obtained value (or set of values) against a specified
- * acceptable conformance quality level.
- *
- * @param newValues the new results.
- */
- public void setResults(final Collection<? extends Result> newValues) {
- results = writeCollection(newValues, results, Result.class);
- }
}
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultFormatConsistency.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultFormatConsistency.java
index 33b0b84fed..7710887235 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultFormatConsistency.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultFormatConsistency.java
@@ -22,8 +22,9 @@ import org.opengis.metadata.quality.FormatConsistency;
/**
- * Degree to which data is stored in accordance with the physical structure of the dataset, as described by the scope.
- * The following property is mandatory in a well-formed metadata according ISO 19115:
+ * Degree to which data are stored in accordance with the physical structure of the data set.
+ * See the {@link FormatConsistency} GeoAPI interface for more details.
+ * The following property is mandatory in a well-formed metadata according ISO 19157:
*
* <div class="preformat">{@code DQ_FormatConsistency}
* {@code └─result……………} Value obtained from applying a data quality measure.</div>
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultUsability.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultFullInspection.java
similarity index 65%
copy from core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultUsability.java
copy to core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultFullInspection.java
index 5b97a6dcee..a2c82991a5 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultUsability.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultFullInspection.java
@@ -18,16 +18,12 @@ package org.apache.sis.metadata.iso.quality;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlRootElement;
-import org.opengis.metadata.quality.Usability;
-import org.apache.sis.internal.xml.LegacyNamespaces;
+import org.opengis.metadata.quality.FullInspection;
/**
- * Degree of adherence of a dataset to a specific set of user requirements.
- * The following property is mandatory in a well-formed metadata according ISO 19115:
- *
- * <div class="preformat">{@code QE_Usability}
- * {@code └─result……………} Value obtained from applying a data quality measure.</div>
+ * Full inspection.
+ * See the {@link FullInspection} GeoAPI interface for more details.
*
* <h2>Limitations</h2>
* <ul>
@@ -38,27 +34,24 @@ import org.apache.sis.internal.xml.LegacyNamespaces;
* same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
* </ul>
*
- * @author Cédric Briançon (Geomatys)
+ * @author Alexis Gaillard (Geomatys)
* @author Martin Desruisseaux (Geomatys)
- * @version 1.0
- * @since 0.3
+ * @version 1.3
+ * @since 1.3
* @module
- *
- * @deprecated Not found in ISO 19115-3:2016 schemas.
*/
-@Deprecated
-@XmlType(name = "QE_Usability_Type", namespace = LegacyNamespaces.GMI)
-@XmlRootElement(name = "QE_Usability", namespace = LegacyNamespaces.GMI)
-public class DefaultUsability extends AbstractElement implements Usability {
- /**
+@XmlType(name = "DQ_FullInspection_Type")
+@XmlRootElement(name = "DQ_FullInspection")
+public class DefaultFullInspection extends AbstractDataEvaluation implements FullInspection {
+ /**
* Serial number for inter-operability with different versions.
*/
- private static final long serialVersionUID = -7316059750787640719L;
+ private static final long serialVersionUID = 4610611512901660745L;
/**
- * Constructs an initially empty usability.
+ * Constructs an initially empty Full Inspection.
*/
- public DefaultUsability() {
+ public DefaultFullInspection() {
}
/**
@@ -68,9 +61,9 @@ public class DefaultUsability extends AbstractElement implements Usability {
*
* @param object the metadata to copy values from, or {@code null} if none.
*
- * @see #castOrCopy(Usability)
+ * @see #castOrCopy(FullInspection)
*/
- public DefaultUsability(final Usability object) {
+ public DefaultFullInspection(final FullInspection object) {
super(object);
}
@@ -81,9 +74,9 @@ public class DefaultUsability extends AbstractElement implements Usability {
* <ul>
* <li>If the given object is {@code null}, then this method returns {@code null}.</li>
* <li>Otherwise if the given object is already an instance of
- * {@code DefaultUsability}, then it is returned unchanged.</li>
- * <li>Otherwise a new {@code DefaultUsability} instance is created using the
- * {@linkplain #DefaultUsability(Usability) copy constructor}
+ * {@code DefaultFullInspection}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultFullInspection} instance is created using the
+ * {@linkplain #DefaultFullInspection(FullInspection) copy constructor}
* and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
* metadata contained in the given object are not recursively copied.</li>
* </ul>
@@ -92,10 +85,10 @@ public class DefaultUsability extends AbstractElement implements Usability {
* @return a SIS implementation containing the values of the given object (may be the
* given object itself), or {@code null} if the argument was null.
*/
- public static DefaultUsability castOrCopy(final Usability object) {
- if (object == null || object instanceof DefaultUsability) {
- return (DefaultUsability) object;
+ public static DefaultFullInspection castOrCopy(final FullInspection object) {
+ if (object == null || object instanceof DefaultFullInspection) {
+ return (DefaultFullInspection) object;
}
- return new DefaultUsability(object);
+ return new DefaultFullInspection(object);
}
}
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultGriddedDataPositionalAccuracy.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultGriddedDataPositionalAccuracy.java
index 732ca7860a..38d49c7ec6 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultGriddedDataPositionalAccuracy.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultGriddedDataPositionalAccuracy.java
@@ -23,7 +23,8 @@ import org.opengis.metadata.quality.GriddedDataPositionalAccuracy;
/**
* Closeness of gridded data position values to values accepted as or being true.
- * The following property is mandatory in a well-formed metadata according ISO 19115:
+ * See the {@link GriddedDataPositionalAccuracy} GeoAPI interface for more details.
+ * The following property is mandatory in a well-formed metadata according ISO 19157:
*
* <div class="preformat">{@code DQ_GriddedDataPositionalAccuracy}
* {@code └─result……………} Value obtained from applying a data quality measure.</div>
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultUsability.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultHomogeneity.java
similarity index 65%
copy from core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultUsability.java
copy to core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultHomogeneity.java
index 5b97a6dcee..79b30a6fd3 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultUsability.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultHomogeneity.java
@@ -18,16 +18,17 @@ package org.apache.sis.metadata.iso.quality;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlRootElement;
-import org.opengis.metadata.quality.Usability;
-import org.apache.sis.internal.xml.LegacyNamespaces;
+import org.opengis.metadata.quality.Homogeneity;
/**
- * Degree of adherence of a dataset to a specific set of user requirements.
- * The following property is mandatory in a well-formed metadata according ISO 19115:
+ * Expected or tested uniformity of the results obtained for a data quality evaluation.
+ * See the {@link Homogeneity} GeoAPI interface for more details.
+ * The following properties are mandatory in a well-formed metadata according ISO 19157:
*
- * <div class="preformat">{@code QE_Usability}
- * {@code └─result……………} Value obtained from applying a data quality measure.</div>
+ * <div class="preformat">{@code DQ_Homogeneity}
+ * {@code ├─result…………………………} Value obtained from applying a data quality measure.
+ * {@code └─derivedElement……} Derived element.</div>
*
* <h2>Limitations</h2>
* <ul>
@@ -38,27 +39,23 @@ import org.apache.sis.internal.xml.LegacyNamespaces;
* same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
* </ul>
*
- * @author Cédric Briançon (Geomatys)
+ * @author Alexis Gaillard (Geomatys)
* @author Martin Desruisseaux (Geomatys)
- * @version 1.0
- * @since 0.3
+ * @version 1.3
+ * @since 1.3
* @module
- *
- * @deprecated Not found in ISO 19115-3:2016 schemas.
*/
-@Deprecated
-@XmlType(name = "QE_Usability_Type", namespace = LegacyNamespaces.GMI)
-@XmlRootElement(name = "QE_Usability", namespace = LegacyNamespaces.GMI)
-public class DefaultUsability extends AbstractElement implements Usability {
+@XmlType(name = "DQ_Homogeneity_Type")
+@XmlRootElement(name = "DQ_Homogeneity")
+public class DefaultHomogeneity extends AbstractMetaquality implements Homogeneity {
/**
* Serial number for inter-operability with different versions.
*/
- private static final long serialVersionUID = -7316059750787640719L;
-
+ private static final long serialVersionUID = -8440822895642971849L;
/**
- * Constructs an initially empty usability.
+ * Constructs an initially empty aggregation derivation.
*/
- public DefaultUsability() {
+ public DefaultHomogeneity() {
}
/**
@@ -68,9 +65,9 @@ public class DefaultUsability extends AbstractElement implements Usability {
*
* @param object the metadata to copy values from, or {@code null} if none.
*
- * @see #castOrCopy(Usability)
+ * @see #castOrCopy(Homogeneity)
*/
- public DefaultUsability(final Usability object) {
+ public DefaultHomogeneity(final Homogeneity object) {
super(object);
}
@@ -81,9 +78,9 @@ public class DefaultUsability extends AbstractElement implements Usability {
* <ul>
* <li>If the given object is {@code null}, then this method returns {@code null}.</li>
* <li>Otherwise if the given object is already an instance of
- * {@code DefaultUsability}, then it is returned unchanged.</li>
- * <li>Otherwise a new {@code DefaultUsability} instance is created using the
- * {@linkplain #DefaultUsability(Usability) copy constructor}
+ * {@code DefaultHomogeneity}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultHomogeneity} instance is created using the
+ * {@linkplain #DefaultHomogeneity(Homogeneity) copy constructor}
* and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
* metadata contained in the given object are not recursively copied.</li>
* </ul>
@@ -92,10 +89,10 @@ public class DefaultUsability extends AbstractElement implements Usability {
* @return a SIS implementation containing the values of the given object (may be the
* given object itself), or {@code null} if the argument was null.
*/
- public static DefaultUsability castOrCopy(final Usability object) {
- if (object == null || object instanceof DefaultUsability) {
- return (DefaultUsability) object;
+ public static DefaultHomogeneity castOrCopy(final Homogeneity object) {
+ if (object == null || object instanceof DefaultHomogeneity) {
+ return (DefaultHomogeneity) object;
}
- return new DefaultUsability(object);
+ return new DefaultHomogeneity(object);
}
}
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultUsability.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultIndirectEvaluation.java
similarity index 50%
copy from core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultUsability.java
copy to core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultIndirectEvaluation.java
index 5b97a6dcee..05fa85596b 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultUsability.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultIndirectEvaluation.java
@@ -17,17 +17,19 @@
package org.apache.sis.metadata.iso.quality;
import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
-import org.opengis.metadata.quality.Usability;
-import org.apache.sis.internal.xml.LegacyNamespaces;
+import org.opengis.util.InternationalString;
+import org.opengis.metadata.quality.IndirectEvaluation;
/**
- * Degree of adherence of a dataset to a specific set of user requirements.
- * The following property is mandatory in a well-formed metadata according ISO 19115:
+ * Indirect evaluation.
+ * See the {@link IndirectEvaluation} GeoAPI interface for more details.
+ * The following properties are mandatory in a well-formed metadata according ISO 19157:
*
- * <div class="preformat">{@code QE_Usability}
- * {@code └─result……………} Value obtained from applying a data quality measure.</div>
+ * <div class="preformat">{@code DQ_IndirectEvaluation}
+ * {@code └─deductiveSource……………} Information on which data are used as sources in deductive evaluation method.</div>
*
* <h2>Limitations</h2>
* <ul>
@@ -38,27 +40,41 @@ import org.apache.sis.internal.xml.LegacyNamespaces;
* same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
* </ul>
*
- * @author Cédric Briançon (Geomatys)
+ * @author Alexis Gaillard (Geomatys)
* @author Martin Desruisseaux (Geomatys)
- * @version 1.0
- * @since 0.3
+ * @version 1.3
+ * @since 1.3
* @module
- *
- * @deprecated Not found in ISO 19115-3:2016 schemas.
*/
-@Deprecated
-@XmlType(name = "QE_Usability_Type", namespace = LegacyNamespaces.GMI)
-@XmlRootElement(name = "QE_Usability", namespace = LegacyNamespaces.GMI)
-public class DefaultUsability extends AbstractElement implements Usability {
+@XmlType(name = "DQ_IndirectEvaluation_Type", propOrder = {
+ "deductiveSource"
+})
+@XmlRootElement(name = "DQ_IndirectEvaluation")
+public class DefaultIndirectEvaluation extends AbstractDataEvaluation implements IndirectEvaluation {
/**
* Serial number for inter-operability with different versions.
*/
- private static final long serialVersionUID = -7316059750787640719L;
+ private static final long serialVersionUID = 5634950981839012526L;
+
+ /**
+ * Information on which data are used as sources in deductive evaluation method.
+ */
+ @SuppressWarnings("serial")
+ private InternationalString deductiveSource;
+
+ /**
+ * Constructs an initially empty descriptive result.
+ */
+ public DefaultIndirectEvaluation() {
+ }
/**
- * Constructs an initially empty usability.
+ * Creates a conformance result initialized to the given values.
+ *
+ * @param source information on which data are used as sources, or {@code null}.
*/
- public DefaultUsability() {
+ public DefaultIndirectEvaluation(final InternationalString source) {
+ deductiveSource = source;
}
/**
@@ -68,10 +84,13 @@ public class DefaultUsability extends AbstractElement implements Usability {
*
* @param object the metadata to copy values from, or {@code null} if none.
*
- * @see #castOrCopy(Usability)
+ * @see #castOrCopy(IndirectEvaluation)
*/
- public DefaultUsability(final Usability object) {
+ public DefaultIndirectEvaluation(final IndirectEvaluation object) {
super(object);
+ if (object != null) {
+ deductiveSource = object.getDeductiveSource();
+ }
}
/**
@@ -81,9 +100,9 @@ public class DefaultUsability extends AbstractElement implements Usability {
* <ul>
* <li>If the given object is {@code null}, then this method returns {@code null}.</li>
* <li>Otherwise if the given object is already an instance of
- * {@code DefaultUsability}, then it is returned unchanged.</li>
- * <li>Otherwise a new {@code DefaultUsability} instance is created using the
- * {@linkplain #DefaultUsability(Usability) copy constructor}
+ * {@code DefaultIndirectEvaluation}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultIndirectEvaluation} instance is created using the
+ * {@linkplain #DefaultIndirectEvaluation(IndirectEvaluation) copy constructor}
* and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
* metadata contained in the given object are not recursively copied.</li>
* </ul>
@@ -92,10 +111,31 @@ public class DefaultUsability extends AbstractElement implements Usability {
* @return a SIS implementation containing the values of the given object (may be the
* given object itself), or {@code null} if the argument was null.
*/
- public static DefaultUsability castOrCopy(final Usability object) {
- if (object == null || object instanceof DefaultUsability) {
- return (DefaultUsability) object;
+ public static DefaultIndirectEvaluation castOrCopy(final IndirectEvaluation object) {
+ if (object == null || object instanceof DefaultIndirectEvaluation) {
+ return (DefaultIndirectEvaluation) object;
}
- return new DefaultUsability(object);
+ return new DefaultIndirectEvaluation(object);
+ }
+
+ /**
+ * Returns the information on which data are used as sources in deductive evaluation method.
+ *
+ * @return information on which data are used.
+ */
+ @Override
+ @XmlElement(name = "deductiveSource", required = true)
+ public InternationalString getDeductiveSource() {
+ return deductiveSource;
+ }
+
+ /**
+ * Sets the information on which data are used as sources in deductive evaluation method.
+ *
+ * @param newValue the new information.
+ */
+ public void setDeductiveSource(final InternationalString newValue) {
+ checkWritePermission(deductiveSource);
+ deductiveSource = newValue;
}
}
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultMeasure.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultMeasure.java
new file mode 100644
index 0000000000..374afc1e82
--- /dev/null
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultMeasure.java
@@ -0,0 +1,467 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.metadata.iso.quality;
+
+import java.util.Collection;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import org.opengis.util.TypeName;
+import org.opengis.util.InternationalString;
+import org.opengis.metadata.Identifier;
+import org.opengis.metadata.quality.Measure;
+import org.opengis.metadata.quality.BasicMeasure;
+import org.opengis.metadata.quality.Description;
+import org.opengis.metadata.quality.Parameter;
+import org.opengis.metadata.quality.SourceReference;
+import org.opengis.metadata.quality.ValueStructure;
+import org.apache.sis.xml.Namespaces;
+
+
+/**
+ * Data quality measure.
+ * See the {@link Measure} GeoAPI interface for more details.
+ * The following properties are mandatory in a well-formed metadata according ISO 19157:
+ *
+ * <div class="preformat">{@code DQM_Measure}
+ * {@code ├─measureIdentifier……} Value uniquely identifying the measure within a namespace.
+ * {@code ├─name………………………………………} Name of the data quality measure applied to the data.
+ * {@code ├─elementName……………………} Name of the data quality element for which quality is reported.
+ * {@code ├─definition………………………} Definition of the fundamental concept for the data quality measure.
+ * {@code └─valueType…………………………} Value type for reporting a data quality result (shall be one of the data types defined in ISO/19103:2005).</div>
+ *
+ * <h2>Limitations</h2>
+ * <ul>
+ * <li>Instances of this class are not synchronized for multi-threading.
+ * Synchronization, if needed, is caller's responsibility.</li>
+ * <li>Serialized objects of this class are not guaranteed to be compatible with future Apache SIS releases.
+ * Serialization support is appropriate for short term storage or RMI between applications running the
+ * same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
+ * </ul>
+ *
+ * @author Alexis Gaillard (Geomatys)
+ * @author Martin Desruisseaux (Geomatys)
+ * @version 1.3
+ * @since 1.3
+ * @module
+ */
+@XmlType(name = "DQM_Measure_Type", namespace = Namespaces.DQM, propOrder = {
+ "measureIdentifier",
+ "name",
+ "aliases",
+ "elementNames",
+ "definition",
+ "description",
+ "valueType",
+ "valueStructure",
+ "examples",
+ "basicMeasure",
+ "sourceReferences",
+ "parameters"
+})
+@XmlRootElement(name = "DQM_Measure", namespace = Namespaces.DQM)
+public class DefaultMeasure extends ISOMetadata implements Measure {
+ /**
+ * Serial number for inter-operability with different versions.
+ */
+ private static final long serialVersionUID = -2004468907779670827L;
+
+ /**
+ * Value uniquely identifying the measure within a namespace.
+ */
+ @SuppressWarnings("serial")
+ private Identifier measureIdentifier;
+
+ /**
+ * Name of the data quality measure applied to the data.
+ */
+ @SuppressWarnings("serial")
+ private InternationalString name;
+
+ /**
+ * Another recognized name, an abbreviation or a short name for the same data quality measure.
+ */
+ @SuppressWarnings("serial")
+ private Collection<InternationalString> aliases;
+
+ /**
+ * Name of the data quality element for which quality is reported.
+ */
+ @SuppressWarnings("serial")
+ private Collection<TypeName> elementNames;
+
+ /**
+ * Definition of the fundamental concept for the data quality measure.
+ */
+ @SuppressWarnings("serial")
+ private BasicMeasure basicMeasure;
+
+ /**
+ * Definition of the fundamental concept for the data quality measure.
+ */
+ @SuppressWarnings("serial")
+ private InternationalString definition;
+
+ /**
+ * Description of the data quality measure.
+ * Includes methods of calculation, with all formulae and/or illustrations
+ * needed to establish the result of applying the measure.
+ */
+ @SuppressWarnings("serial")
+ private Description description;
+
+ /**
+ * Reference to the source of an item that has been adopted from an external source.
+ */
+ @SuppressWarnings("serial")
+ private Collection<SourceReference> sourceReferences;
+
+ /**
+ * Value type for reporting a data quality result.
+ */
+ @SuppressWarnings("serial")
+ private TypeName valueType;
+
+ /**
+ * Structure for reporting a complex data quality result.
+ */
+ private ValueStructure valueStructure;
+
+ /**
+ * Auxiliary variable used by the data quality measure, including its name, definition and optionally its description.
+ */
+ @SuppressWarnings("serial")
+ private Collection<Parameter> parameters;
+
+ /**
+ * Illustration of the use of a data quality measure.
+ */
+ @SuppressWarnings("serial")
+ private Collection<Description> examples;
+
+ /**
+ * Constructs an initially empty element.
+ */
+ public DefaultMeasure() {
+ }
+
+ /**
+ * Constructs a new instance initialized with the values from the specified metadata object.
+ * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
+ * given object are not recursively copied.
+ *
+ * @param object the metadata to copy values from, or {@code null} if none.
+ *
+ * @see #castOrCopy(Measure)
+ */
+ @SuppressWarnings("unchecked")
+ public DefaultMeasure(final Measure object) {
+ super(object);
+ if (object != null) {
+ measureIdentifier = object.getMeasureIdentifier();
+ name = object.getName();
+ aliases = copyCollection(object.getAliases(), InternationalString.class);
+ elementNames = copyCollection(object.getElementNames(), TypeName.class);
+ definition = object.getDefinition();
+ description = object.getDescription();
+ valueType = object.getValueType();
+ valueStructure = object.getValueStructure();
+ examples = copyCollection(object.getExamples(), Description.class);
+ basicMeasure = object.getBasicMeasure();
+ sourceReferences = copyCollection(object.getSourceReferences(), SourceReference.class);
+ parameters = copyCollection(object.getParameters(), Parameter.class);
+ }
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable action in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultMeasure}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultMeasure} instance is created using the
+ * {@linkplain #DefaultMeasure(Measure) copy constructor} and returned.
+ * Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
+ *
+ * @param object the object to get as a SIS implementation, or {@code null} if none.
+ * @return a SIS implementation containing the values of the given object (may be the
+ * given object itself), or {@code null} if the argument was null.
+ */
+ public static DefaultMeasure castOrCopy(final Measure object) {
+ if (object instanceof DefaultMeasure) {
+ return (DefaultMeasure) object;
+ }
+ return new DefaultMeasure(object);
+ }
+
+ /**
+ * Returns the value uniquely identifying the measure within a namespace.
+ *
+ * @return value uniquely identifying the measure within a namespace.
+ */
+ @Override
+ @XmlElement(name = "measureIdentifier", required = true)
+ public Identifier getMeasureIdentifier() {
+ return measureIdentifier;
+ }
+
+ /**
+ * Sets the value uniquely identifying the measure within a namespace.
+ *
+ * @param newValue the new measure identification.
+ */
+ public void setMeasureIdentifier(final Identifier newValue) {
+ checkWritePermission(measureIdentifier);
+ measureIdentifier = newValue;
+ }
+
+ /**
+ * Returns the name of the data quality measure applied to the data.
+ *
+ * @return name of the data quality measure applied to the data.
+ */
+ @Override
+ @XmlElement(name = "name", required = true)
+ public InternationalString getName() {
+ return name;
+ }
+
+ /**
+ * Sets the name of the data quality measure applied to the data.
+ *
+ * @param newValue the new quality measure name.
+ */
+ public void setName(final InternationalString newValue) {
+ checkWritePermission(name);
+ name = newValue;
+ }
+
+ /**
+ * Returns other recognized names, abbreviations or short names for the same data quality measure.
+ * It may be a different commonly used name, or an abbreviation, or a short name.
+ *
+ * @return others recognized names, abbreviations or short names.
+ */
+ @Override
+ @XmlElement(name = "alias")
+ public Collection<InternationalString> getAliases() {
+ return aliases = nonNullCollection(aliases, InternationalString.class);
+ }
+
+ /**
+ * Sets other recognized names or abbreviations for the same data quality measure.
+ *
+ * @param newValues the new measure aliases.
+ */
+ public void setAliases(final Collection<? extends InternationalString> newValues) {
+ aliases = writeCollection(newValues, aliases, InternationalString.class);
+ }
+
+ /**
+ * Returns the names of the data quality element to which a measure applies.
+ *
+ * @return names of the data quality element for which quality is reported.
+ */
+ @Override
+ @XmlElement(name = "elementName", required = true)
+ public Collection<TypeName> getElementNames() {
+ return elementNames = nonNullCollection(elementNames, TypeName.class);
+ }
+
+ /**
+ * Sets the name of the data quality element for which quality is reported.
+ *
+ * @param newValues the new measure element names.
+ */
+ public void setElementNames(final Collection<? extends TypeName> newValues) {
+ elementNames = writeCollection(newValues, elementNames, TypeName.class);
+ }
+
+ /**
+ * Returns predefined basic measure on which this measure is based.
+ *
+ * @return predefined basic measure on which this measure is based, or {@code null} if none.
+ */
+ @Override
+ @XmlElement(name = "basicMeasure")
+ public BasicMeasure getBasicMeasure() {
+ return basicMeasure;
+ }
+
+ /**
+ * Sets the predefined basic measure on which this measure is based.
+ *
+ * @param newValue the new basic measure.
+ */
+ public void setBasicMeasure(final BasicMeasure newValue) {
+ checkWritePermission(basicMeasure);
+ basicMeasure = newValue;
+ }
+
+ /**
+ * Returns the definition of the fundamental concept for the data quality measure.
+ * If the measure is derived from a {@linkplain #getBasicMeasure() basic measure},
+ * the definition is based on the basic measure definition and specialized for this measure.
+ *
+ * @return definition of the fundamental concept for the data quality measure.
+ */
+ @Override
+ @XmlElement(name = "definition", required = true)
+ public InternationalString getDefinition() {
+ return definition;
+ }
+
+ /**
+ * Sets the definition of the fundamental concept for the data quality measure.
+ *
+ * @param newValue the new measure definition.
+ */
+ public void setDefinition(final InternationalString newValue) {
+ checkWritePermission(definition);
+ definition = newValue;
+ }
+
+ /**
+ * Description of the data quality measure.
+ * Includes methods of calculation, with all formulae and/or illustrations
+ * needed to establish the result of applying the measure.
+ *
+ * @return description of data quality measure, or {@code null} if none.
+ */
+ @Override
+ @XmlElement(name = "description")
+ public Description getDescription() {
+ return description;
+ }
+
+ /**
+ * Sets the description of the data quality measure.
+ *
+ * @param newValue the new measure description.
+ */
+ public void setDescription(final Description newValue) {
+ checkWritePermission(description);
+ description = newValue;
+ }
+
+ /**
+ * Returns references to the source of an item that has been adopted from an external source.
+ *
+ * @return references to the source.
+ */
+ @Override
+ @XmlElement(name = "sourceReference")
+ public Collection<SourceReference> getSourceReferences() {
+ return sourceReferences = nonNullCollection(sourceReferences, SourceReference.class);
+ }
+
+ /**
+ * Sets the reference to the source of an item that has been adopted from an external source.
+ *
+ * @param newValues the new source references.
+ */
+ public void setSourceReferences(final Collection<? extends SourceReference> newValues) {
+ sourceReferences = writeCollection(newValues, sourceReferences, SourceReference.class);
+ }
+
+ /**
+ * Returns the value type for reporting a data quality result.
+ *
+ * @return value type for reporting a data quality result.
+ */
+ @Override
+ @XmlElement(name = "valueType", required = true)
+ public TypeName getValueType() {
+ return valueType;
+ }
+
+ /**
+ * Sets the value type for reporting a data quality result.
+ *
+ * @param newValue the new measure value type.
+ */
+ public void setValueType(final TypeName newValue) {
+ checkWritePermission(valueType);
+ valueType = newValue;
+ }
+
+ /**
+ * Returns the structure for reporting a complex data quality result.
+ *
+ * @return structure for reporting a complex data quality result, or {@code null} if none.
+ */
+ @Override
+ @XmlElement(name = "valueStructure")
+ public ValueStructure getValueStructure() {
+ return valueStructure;
+ }
+
+ /**
+ * Sets the structure for reporting a complex data quality result.
+ *
+ * @param newValue the new measure value structure.
+ */
+ public void setValueStructure(final ValueStructure newValue) {
+ checkWritePermission(valueStructure);
+ valueStructure = newValue;
+ }
+
+ /**
+ * Returns auxiliary variable(s) used by the data quality measure.
+ * It shall include its name, definition and value type.
+ *
+ * @return auxiliary variable(s) used by data quality measure.
+ */
+ @Override
+ @XmlElement(name = "parameter")
+ public Collection<Parameter> getParameters() {
+ return parameters = nonNullCollection(parameters, Parameter.class);
+ }
+
+ /**
+ * Sets the auxiliary variable used by the data quality measure.
+ *
+ * @param newValues the new measure parameters.
+ */
+ public void setParameters(final Collection<? extends Parameter> newValues) {
+ parameters = writeCollection(newValues, parameters, Parameter.class);
+ }
+
+ /**
+ * Returns illustrations of the use of a data quality measure.
+ *
+ * @return examples of applying the measure or the result obtained for the measure.
+ */
+ @Override
+ @XmlElement(name = "example")
+ public Collection<Description> getExamples() {
+ return examples = nonNullCollection(examples, Description.class);
+ }
+
+ /**
+ * Sets the illustrations of the use of a data quality measure.
+ *
+ * @param newValues the new examples.
+ */
+ public void setExamples(final Collection<? extends Description> newValues) {
+ examples = writeCollection(newValues, examples, Description.class);
+ }
+}
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultMeasureReference.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultMeasureReference.java
new file mode 100644
index 0000000000..60283f4a61
--- /dev/null
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultMeasureReference.java
@@ -0,0 +1,201 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.metadata.iso.quality;
+
+
+import java.util.Collection;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import org.opengis.util.InternationalString;
+import org.opengis.metadata.Identifier;
+import org.opengis.metadata.quality.Element;
+import org.opengis.metadata.quality.MeasureReference;
+import org.apache.sis.internal.util.CollectionsExt;
+
+
+/**
+ * Reference to the measure used.
+ * See the {@link MeasureReference} GeoAPI interface for more details.
+ *
+ * <h2>Limitations</h2>
+ * <ul>
+ * <li>Instances of this class are not synchronized for multi-threading.
+ * Synchronization, if needed, is caller's responsibility.</li>
+ * <li>Serialized objects of this class are not guaranteed to be compatible with future Apache SIS releases.
+ * Serialization support is appropriate for short term storage or RMI between applications running the
+ * same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
+ * </ul>
+ *
+ * @author Alexis Gaillard (Geomatys)
+ * @author Martin Desruisseaux (Geomatys)
+ * @version 1.3
+ * @since 1.3
+ * @module
+ */
+@XmlType(name = "DQ_MeasureReference_Type", propOrder = {
+ "measureIdentification",
+ "namesOfMeasure",
+ "measureDescription"
+})
+@XmlRootElement(name = "DQ_MeasureReference")
+public class DefaultMeasureReference extends ISOMetadata implements MeasureReference {
+ /**
+ * Serial number for inter-operability with different versions.
+ */
+ private static final long serialVersionUID = -1841855681786546466L;
+
+ /**
+ * Value uniquely identifying the measure within a namespace.
+ */
+ @SuppressWarnings("serial")
+ private Identifier measureIdentification;
+
+ /**
+ * Name of the test applied to the data.
+ */
+ @SuppressWarnings("serial")
+ private Collection<InternationalString> namesOfMeasure;
+
+ /**
+ * Description of the measure.
+ */
+ @SuppressWarnings("serial")
+ private InternationalString measureDescription;
+
+ /**
+ * Constructs an initially empty measure reference.
+ */
+ public DefaultMeasureReference() {
+ }
+
+ /**
+ * Constructs a new instance initialized with the values from the specified metadata object.
+ * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
+ * given object are not recursively copied.
+ *
+ * @param object the metadata to copy values from, or {@code null} if none.
+ *
+ * @see #castOrCopy(MeasureReference)
+ */
+ public DefaultMeasureReference(final MeasureReference object) {
+ super(object);
+ if (object != null) {
+ measureIdentification = object.getMeasureIdentification();
+ measureDescription = object.getMeasureDescription();
+ namesOfMeasure = copyCollection(object.getNamesOfMeasure(), InternationalString.class);
+ }
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable action in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultMeasureReference}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultMeasureReference} instance is created using the
+ * {@linkplain #DefaultMeasureReference(MeasureReference) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
+ *
+ * @param object the object to get as a SIS implementation, or {@code null} if none.
+ * @return a SIS implementation containing the values of the given object (may be the
+ * given object itself), or {@code null} if the argument was null.
+ */
+ public static DefaultMeasureReference castOrCopy(final MeasureReference object) {
+ if (object == null || object instanceof DefaultMeasureReference) {
+ return (DefaultMeasureReference) object;
+ }
+ return new DefaultMeasureReference(object);
+ }
+
+ /**
+ * Initializes a measure reference from the deprecated properties of the given element.
+ * This is used for transition from legacy ISO 19115 to newer ISO 19157 model.
+ */
+ @SuppressWarnings("deprecation")
+ final boolean setLegacy(final Element element) {
+ return (null != (measureIdentification = element.getMeasureIdentification()))
+ | (null != (namesOfMeasure = copyCollection(element.getNamesOfMeasure(), InternationalString.class)))
+ | (null != (measureDescription = CollectionsExt.first(element.getNamesOfMeasure())));
+ }
+
+ /**
+ * Returns a value uniquely identifying the measure within a namespace.
+ *
+ * @return code identifying a registered measure, or {@code null} if none.
+ */
+ @Override
+ @XmlElement(name = "measureIdentification")
+ public Identifier getMeasureIdentification() {
+ return measureIdentification;
+ }
+
+ /**
+ * Sets the identifier of the measure.
+ *
+ * @param newValue the new measure identification.
+ */
+ public void setMeasureIdentification(final Identifier newValue) {
+ checkWritePermission(measureIdentification);
+ measureIdentification = newValue;
+ }
+
+ /**
+ * Returns the names of the test applied to the data.
+ *
+ * @return names of the test applied to the data.
+ */
+ @Override
+ @XmlElement(name = "nameOfMeasure")
+ public Collection<InternationalString> getNamesOfMeasure() {
+ return namesOfMeasure = nonNullCollection(namesOfMeasure, InternationalString.class);
+ }
+
+ /**
+ * Sets the names of the test applied to the data.
+ *
+ * @param newValues the new name of measures.
+ */
+ public void setNamesOfMeasure(final Collection<? extends InternationalString> newValues) {
+ namesOfMeasure = writeCollection(newValues, namesOfMeasure, InternationalString.class);
+ }
+
+ /**
+ * Returns the description of the measure.
+ *
+ * @return description of the measure, or {@code null}.
+ */
+ @Override
+ @XmlElement(name = "measureDescription")
+ public InternationalString getMeasureDescription() {
+ return measureDescription;
+ }
+
+ /**
+ * Sets the description of the measure.
+ *
+ * @param newValue the new measure description.
+ */
+ public void setMeasureDescription(final InternationalString newValue) {
+ checkWritePermission(measureDescription);
+ measureDescription = newValue;
+ }
+}
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultNonQuantitativeAttributeAccuracy.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultNonQuantitativeAttributeAccuracy.java
index 98d462774e..b36105a72b 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultNonQuantitativeAttributeAccuracy.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultNonQuantitativeAttributeAccuracy.java
@@ -24,28 +24,18 @@ import org.apache.sis.internal.xml.LegacyNamespaces;
/**
* Accuracy of non-quantitative attributes.
- * The following property is mandatory in a well-formed metadata according ISO 19115:
- *
- * <div class="preformat">{@code DQ_NonQuantitativeAttributeAccuracy}
- * {@code └─result……………} Value obtained from applying a data quality measure.</div>
- *
- * <h2>Limitations</h2>
- * <ul>
- * <li>Instances of this class are not synchronized for multi-threading.
- * Synchronization, if needed, is caller's responsibility.</li>
- * <li>Serialized objects of this class are not guaranteed to be compatible with future Apache SIS releases.
- * Serialization support is appropriate for short term storage or RMI between applications running the
- * same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
- * </ul>
*
* @author Martin Desruisseaux (IRD, Geomatys)
- * @version 1.0
+ * @version 1.3
* @since 0.3
* @module
+ *
+ * @deprecated Renamed {@link DefaultNonQuantitativeAttributeCorrectness} for following a renaming in ISO 19157:2013.
*/
-@XmlType(name = "DQ_NonQuantitativeAttributeAccuracy_Type", namespace = LegacyNamespaces.GMD) // TODO: renamed NonQuantitativeAttributeCorrectness
+@Deprecated
+@XmlType(name = "DQ_NonQuantitativeAttributeAccuracy_Type", namespace = LegacyNamespaces.GMD)
@XmlRootElement(name = "DQ_NonQuantitativeAttributeAccuracy", namespace = LegacyNamespaces.GMD)
-public class DefaultNonQuantitativeAttributeAccuracy extends AbstractThematicAccuracy
+public class DefaultNonQuantitativeAttributeAccuracy extends DefaultNonQuantitativeAttributeCorrectness
implements NonQuantitativeAttributeAccuracy
{
/**
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultNonQuantitativeAttributeAccuracy.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultNonQuantitativeAttributeCorrectness.java
similarity index 62%
copy from core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultNonQuantitativeAttributeAccuracy.java
copy to core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultNonQuantitativeAttributeCorrectness.java
index 98d462774e..c5f707fa2f 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultNonQuantitativeAttributeAccuracy.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultNonQuantitativeAttributeCorrectness.java
@@ -17,16 +17,18 @@
package org.apache.sis.metadata.iso.quality;
import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlRootElement;
import org.opengis.metadata.quality.NonQuantitativeAttributeAccuracy;
-import org.apache.sis.internal.xml.LegacyNamespaces;
+import org.opengis.metadata.quality.NonQuantitativeAttributeCorrectness;
/**
- * Accuracy of non-quantitative attributes.
- * The following property is mandatory in a well-formed metadata according ISO 19115:
+ * Correctness of non-quantitative attributes.
+ * See the {@link NonQuantitativeAttributeCorrectness} GeoAPI interface for more details.
+ * The following property is mandatory in a well-formed metadata according ISO 19157:
*
- * <div class="preformat">{@code DQ_NonQuantitativeAttributeAccuracy}
+ * <div class="preformat">{@code DQ_CompletenessOmission}
* {@code └─result……………} Value obtained from applying a data quality measure.</div>
*
* <h2>Limitations</h2>
@@ -38,25 +40,29 @@ import org.apache.sis.internal.xml.LegacyNamespaces;
* same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
* </ul>
*
- * @author Martin Desruisseaux (IRD, Geomatys)
- * @version 1.0
- * @since 0.3
+ * @author Martin Desruisseaux (Geomatys)
+ * @author Alexis Gaillard (Geomatys)
+ * @version 1.3
+ * @since 1.3
* @module
*/
-@XmlType(name = "DQ_NonQuantitativeAttributeAccuracy_Type", namespace = LegacyNamespaces.GMD) // TODO: renamed NonQuantitativeAttributeCorrectness
-@XmlRootElement(name = "DQ_NonQuantitativeAttributeAccuracy", namespace = LegacyNamespaces.GMD)
-public class DefaultNonQuantitativeAttributeAccuracy extends AbstractThematicAccuracy
- implements NonQuantitativeAttributeAccuracy
+@XmlType(name = "DQ_NonQuantitativeAttributeCorrectness_Type")
+@XmlRootElement(name = "DQ_NonQuantitativeAttributeCorrectness")
+@XmlSeeAlso({
+ DefaultNonQuantitativeAttributeAccuracy.class
+})
+public class DefaultNonQuantitativeAttributeCorrectness extends AbstractThematicAccuracy
+ implements NonQuantitativeAttributeCorrectness
{
/**
* Serial number for inter-operability with different versions.
*/
- private static final long serialVersionUID = -8777909940058192886L;
+ private static final long serialVersionUID = 6782225824097039360L;
/**
- * Constructs an initially empty non quantitative attribute accuracy.
+ * Constructs an initially empty completeness omission.
*/
- public DefaultNonQuantitativeAttributeAccuracy() {
+ public DefaultNonQuantitativeAttributeCorrectness() {
}
/**
@@ -66,9 +72,9 @@ public class DefaultNonQuantitativeAttributeAccuracy extends AbstractThematicAcc
*
* @param object the metadata to copy values from, or {@code null} if none.
*
- * @see #castOrCopy(NonQuantitativeAttributeAccuracy)
+ * @see #castOrCopy(NonQuantitativeAttributeCorrectness)
*/
- public DefaultNonQuantitativeAttributeAccuracy(final NonQuantitativeAttributeAccuracy object) {
+ public DefaultNonQuantitativeAttributeCorrectness(final NonQuantitativeAttributeCorrectness object) {
super(object);
}
@@ -79,9 +85,9 @@ public class DefaultNonQuantitativeAttributeAccuracy extends AbstractThematicAcc
* <ul>
* <li>If the given object is {@code null}, then this method returns {@code null}.</li>
* <li>Otherwise if the given object is already an instance of
- * {@code DefaultNonQuantitativeAttributeAccuracy}, then it is returned unchanged.</li>
- * <li>Otherwise a new {@code DefaultNonQuantitativeAttributeAccuracy} instance is created using the
- * {@linkplain #DefaultNonQuantitativeAttributeAccuracy(NonQuantitativeAttributeAccuracy) copy constructor}
+ * {@code DefaultNonQuantitativeAttributeCorrectness}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultNonQuantitativeAttributeCorrectness} instance is created using the
+ * {@linkplain #DefaultNonQuantitativeAttributeCorrectness(NonQuantitativeAttributeCorrectness) copy constructor}
* and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
* metadata contained in the given object are not recursively copied.</li>
* </ul>
@@ -90,10 +96,14 @@ public class DefaultNonQuantitativeAttributeAccuracy extends AbstractThematicAcc
* @return a SIS implementation containing the values of the given object (may be the
* given object itself), or {@code null} if the argument was null.
*/
- public static DefaultNonQuantitativeAttributeAccuracy castOrCopy(final NonQuantitativeAttributeAccuracy object) {
- if (object == null || object instanceof DefaultNonQuantitativeAttributeAccuracy) {
- return (DefaultNonQuantitativeAttributeAccuracy) object;
+ @SuppressWarnings("deprecation")
+ public static DefaultNonQuantitativeAttributeCorrectness castOrCopy(final NonQuantitativeAttributeCorrectness object) {
+ if (object instanceof NonQuantitativeAttributeAccuracy) {
+ return DefaultNonQuantitativeAttributeAccuracy.castOrCopy((NonQuantitativeAttributeAccuracy) object);
}
- return new DefaultNonQuantitativeAttributeAccuracy(object);
+ if (object == null || object instanceof DefaultNonQuantitativeAttributeCorrectness) {
+ return (DefaultNonQuantitativeAttributeCorrectness) object;
+ }
+ return new DefaultNonQuantitativeAttributeCorrectness(object);
}
}
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultParameter.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultParameter.java
new file mode 100644
index 0000000000..0c6f649cba
--- /dev/null
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultParameter.java
@@ -0,0 +1,252 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.metadata.iso.quality;
+
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import org.opengis.util.TypeName;
+import org.opengis.util.InternationalString;
+import org.opengis.metadata.quality.Parameter;
+import org.opengis.metadata.quality.Description;
+import org.opengis.metadata.quality.ValueStructure;
+import org.apache.sis.xml.Namespaces;
+
+
+/**
+ * Data quality parameter.
+ * The following property is mandatory in a well-formed metadata according ISO 19157:
+ *
+ * <div class="preformat">{@code DQM_Parameter}
+ * {@code ├─name……………………} Name of the data quality parameter.
+ * {@code ├─definition……} Definition of the data quality parameter.
+ * {@code └─valueType………} Value type of the data quality parameter (shall be one of the data types defined in ISO/TS 19103:2005).</div>
+ *
+ * <h2>Limitations</h2>
+ * <ul>
+ * <li>Instances of this class are not synchronized for multi-threading.
+ * Synchronization, if needed, is caller's responsibility.</li>
+ * <li>Serialized objects of this class are not guaranteed to be compatible with future Apache SIS releases.
+ * Serialization support is appropriate for short term storage or RMI between applications running the
+ * same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
+ * </ul>
+ *
+ * @author Alexis Gaillard (Geomatys)
+ * @author Martin Desruisseaux (Geomatys)
+ * @version 1.3
+ * @since 1.3
+ * @module
+ */
+@XmlType(name = "DQM_Parameter_Type", namespace = Namespaces.DQM, propOrder = {
+ "name",
+ "definition",
+ "description",
+ "valueType",
+ "valueStructure"
+})
+@XmlRootElement(name = "DQM_Parameter", namespace = Namespaces.DQM)
+public class DefaultParameter extends ISOMetadata implements Parameter {
+ /**
+ * Serial number for inter-operability with different versions.
+ */
+ private static final long serialVersionUID = -5063371334668144677L;
+
+ /**
+ * Name of the data quality parameter.
+ */
+ @SuppressWarnings("serial")
+ private InternationalString name;
+
+ /**
+ * Definition of the data quality parameter.
+ */
+ @SuppressWarnings("serial")
+ private InternationalString definition;
+
+ /**
+ * Description of the data quality parameter.
+ */
+ @SuppressWarnings("serial")
+ private Description description;
+
+ /**
+ * Value type of the data quality parameter (shall be one of the data types defined in ISO/TS 19103:2005).
+ */
+ @SuppressWarnings("serial")
+ private TypeName valueType;
+
+ /**
+ * Structure of the data quality parameter.
+ */
+ private ValueStructure valueStructure;
+
+ /**
+ * Constructs an initially empty element.
+ */
+ public DefaultParameter() {
+ }
+
+ /**
+ * Constructs a new instance initialized with the values from the specified metadata object.
+ * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
+ * given object are not recursively copied.
+ *
+ * @param object the metadata to copy values from, or {@code null} if none.
+ *
+ * @see #castOrCopy(Parameter)
+ */
+ public DefaultParameter(final Parameter object) {
+ super(object);
+ if (object != null) {
+ name = object.getName();
+ definition = object.getDefinition();
+ description = object.getDescription();
+ valueType = object.getValueType();
+ valueStructure = object.getValueStructure();
+ }
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable action in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultParameter}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultParameter} instance is created using the
+ * {@linkplain #DefaultParameter(Parameter) copy constructor} and returned.
+ * Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
+ *
+ * @param object the object to get as a SIS implementation, or {@code null} if none.
+ * @return a SIS implementation containing the values of the given object (may be the
+ * given object itself), or {@code null} if the argument was null.
+ */
+ public static DefaultParameter castOrCopy(final Parameter object) {
+ if (object == null || object instanceof DefaultParameter) {
+ return (DefaultParameter) object;
+ }
+ return new DefaultParameter(object);
+ }
+
+ /**
+ * Returns the name of the data quality parameter.
+ *
+ * @return name of the data quality parameter.
+ */
+ @Override
+ @XmlElement(name = "name", required = true)
+ public InternationalString getName() {
+ return name;
+ }
+
+ /**
+ * Sets the name of the data quality parameter.
+ *
+ * @param newValue the new parameter name.
+ */
+ public void setName(final InternationalString newValue) {
+ checkWritePermission(name);
+ name = newValue;
+ }
+
+ /**
+ * Returns the definition of the data quality parameter.
+ *
+ * @return definition of the data quality parameter.
+ */
+ @Override
+ @XmlElement(name = "definition", required = true)
+ public InternationalString getDefinition() {
+ return definition;
+ }
+
+ /**
+ * Sets the definition of the data quality parameter.
+ *
+ * @param newValue the new parameter definition.
+ */
+ public void setDefinition(final InternationalString newValue) {
+ checkWritePermission(definition);
+ definition = newValue;
+ }
+
+ /**
+ * Returns the description of the data quality parameter.
+ *
+ * @return description of the data quality parameter, or {@code null} if none.
+ */
+ @Override
+ @XmlElement(name = "description")
+ public Description getDescription() {
+ return description;
+ }
+
+ /**
+ * Sets the description of the data quality parameter.
+ *
+ * @param newValue the new parameter description.
+ */
+ public void setDescription(final Description newValue) {
+ checkWritePermission(description);
+ description = newValue;
+ }
+
+ /**
+ * Returns the value type of the data quality parameter.
+ *
+ * @return value type of the data quality parameter.
+ */
+ @Override
+ @XmlElement(name = "valueType", required = true)
+ public TypeName getValueType() {
+ return valueType;
+ }
+
+ /**
+ * Sets the value type of the data quality parameter.
+ *
+ * @param newValue the new parameter value type.
+ */
+ public void setValueType(final TypeName newValue) {
+ checkWritePermission(valueType);
+ valueType = newValue;
+ }
+
+ /**
+ * Returns the structure of the data quality parameter.
+ *
+ * @return structure of the data quality parameter, or {@code null} if none.
+ */
+ @Override
+ @XmlElement(name = "valueStructure")
+ public ValueStructure getValueStructure() {
+ return valueStructure;
+ }
+
+ /**
+ * Sets the structure of the data quality parameter.
+ *
+ * @param newValue the new parameter value structure.
+ */
+ public void setValueStructure(final ValueStructure newValue) {
+ checkWritePermission(valueStructure);
+ valueStructure = newValue;
+ }
+}
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeAttributeAccuracy.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeAttributeAccuracy.java
index b08a743f23..5ca3d7ba28 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeAttributeAccuracy.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeAttributeAccuracy.java
@@ -23,7 +23,8 @@ import org.opengis.metadata.quality.QuantitativeAttributeAccuracy;
/**
* Accuracy of quantitative attributes.
- * The following property is mandatory in a well-formed metadata according ISO 19115:
+ * See the {@link QuantitativeAttributeAccuracy} GeoAPI interface for more details.
+ * The following property is mandatory in a well-formed metadata according ISO 19157:
*
* <div class="preformat">{@code DQ_QuantitativeAttributeAccuracy}
* {@code └─result……………} Value obtained from applying a data quality measure.</div>
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeResult.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeResult.java
index 7e66020722..d92e2565c0 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeResult.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultQuantitativeResult.java
@@ -31,7 +31,8 @@ import org.apache.sis.internal.xml.LegacyNamespaces;
/**
* Information about the value (or set of values) obtained from applying a data quality measure.
- * The following properties are mandatory in a well-formed metadata according ISO 19115:
+ * See the {@link QuantitativeResult} GeoAPI interface for more details.
+ * The following properties are mandatory in a well-formed metadata according ISO 19157:
*
* <div class="preformat">{@code DQ_QuantitativeResult}
* {@code ├─valueUnit……………………} Value unit for reporting a data quality result.
@@ -49,7 +50,8 @@ import org.apache.sis.internal.xml.LegacyNamespaces;
* @author Martin Desruisseaux (IRD, Geomatys)
* @author Touraïvane (IRD)
* @author Cullen Rombach (Image Matters)
- * @version 1.0
+ * @author Alexis Gaillard (Geomatys)
+ * @version 1.3
* @since 0.3
* @module
*/
@@ -86,7 +88,10 @@ public class DefaultQuantitativeResult extends AbstractResult implements Quantit
/**
* Statistical method used to determine the value, or {@code null} if none.
+ *
+ * @deprecated Removed from ISO 19157:2013.
*/
+ @Deprecated
@SuppressWarnings("serial")
private InternationalString errorStatistic;
@@ -161,7 +166,7 @@ public class DefaultQuantitativeResult extends AbstractResult implements Quantit
}
/**
- * Return the value type for reporting a data quality result.
+ * Returns the value type for reporting a data quality result.
*
* <h4>Default value</h4>
* If no type has been set but all {@linkplain #getValues() values} are of the same type,
@@ -227,9 +232,10 @@ public class DefaultQuantitativeResult extends AbstractResult implements Quantit
*
* @return statistical method used to determine the value, or {@code null}.
*
- * @see <a href="https://issues.apache.org/jira/browse/SIS-394">Issue SIS-394</a>
+ * @deprecated Removed from ISO_19157:2013.
*/
@Override
+ @Deprecated
@XmlElement(name = "errorStatistic", namespace = LegacyNamespaces.GMD)
public InternationalString getErrorStatistic() {
return FilterByVersion.LEGACY_METADATA.accept() ? errorStatistic : null;
@@ -239,7 +245,10 @@ public class DefaultQuantitativeResult extends AbstractResult implements Quantit
* Sets the statistical method used to determine the value, or {@code null} if none.
*
* @param newValue the new error statistic.
+ *
+ * @deprecated Removed from ISO_19157:2013.
*/
+ @Deprecated
public void setErrorStatistic(final InternationalString newValue) {
checkWritePermission(errorStatistic);
errorStatistic = newValue;
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultRelativeInternalPositionalAccuracy.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultRelativeInternalPositionalAccuracy.java
index b7bffe8d96..07ee7bdabc 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultRelativeInternalPositionalAccuracy.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultRelativeInternalPositionalAccuracy.java
@@ -24,7 +24,8 @@ import org.opengis.metadata.quality.RelativeInternalPositionalAccuracy;
/**
* Closeness of the relative positions of features in the scope to their respective
* relative positions accepted as or being true.
- * The following property is mandatory in a well-formed metadata according ISO 19115:
+ * See the {@link RelativeInternalPositionalAccuracy} GeoAPI interface for more details.
+ * The following property is mandatory in a well-formed metadata according ISO 19157:
*
* <div class="preformat">{@code DQ_RelativeInternalPositionalAccuracy}
* {@code └─result……………} Value obtained from applying a data quality measure.</div>
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTemporalValidity.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultRepresentativity.java
similarity index 64%
copy from core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTemporalValidity.java
copy to core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultRepresentativity.java
index eea7029a01..b5a09faada 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTemporalValidity.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultRepresentativity.java
@@ -18,15 +18,17 @@ package org.apache.sis.metadata.iso.quality;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlRootElement;
-import org.opengis.metadata.quality.TemporalValidity;
+import org.opengis.metadata.quality.Representativity;
/**
- * Validity of data specified by the scope with respect to time.
- * The following property is mandatory in a well-formed metadata according ISO 19115:
+ * Degree to which the sample used has produced a result which is representation of the data.
+ * See the {@link Representativity} GeoAPI interface for more details.
+ * The following properties are mandatory in a well-formed metadata according ISO 19157:
*
- * <div class="preformat">{@code DQ_TemporalValidity}
- * {@code └─result……………} Value obtained from applying a data quality measure.</div>
+ * <div class="preformat">{@code DQ_Representativity}
+ * {@code ├─result…………………………} Value obtained from applying a data quality measure.
+ * {@code └─derivedElement……} Derived element.</div>
*
* <h2>Limitations</h2>
* <ul>
@@ -37,24 +39,23 @@ import org.opengis.metadata.quality.TemporalValidity;
* same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
* </ul>
*
- * @author Martin Desruisseaux (IRD, Geomatys)
- * @author Touraïvane (IRD)
- * @version 1.0
- * @since 0.3
+ * @author Alexis Gaillard (Geomatys)
+ * @author Martin Desruisseaux (Geomatys)
+ * @version 1.3
+ * @since 1.3
* @module
*/
-@XmlType(name = "DQ_TemporalValidity_Type")
-@XmlRootElement(name = "DQ_TemporalValidity")
-public class DefaultTemporalValidity extends AbstractTemporalAccuracy implements TemporalValidity {
+@XmlType(name = "DQ_Representativity_Type")
+@XmlRootElement(name = "DQ_Representativity")
+public class DefaultRepresentativity extends AbstractMetaquality implements Representativity {
/**
* Serial number for inter-operability with different versions.
*/
- private static final long serialVersionUID = 7271555924670981058L;
-
+ private static final long serialVersionUID = 5570834596540938580L;
/**
- * Constructs an initially empty temporal validity.
+ * Constructs an initially empty aggregation derivation.
*/
- public DefaultTemporalValidity() {
+ public DefaultRepresentativity() {
}
/**
@@ -64,9 +65,9 @@ public class DefaultTemporalValidity extends AbstractTemporalAccuracy implements
*
* @param object the metadata to copy values from, or {@code null} if none.
*
- * @see #castOrCopy(TemporalValidity)
+ * @see #castOrCopy(Representativity)
*/
- public DefaultTemporalValidity(final TemporalValidity object) {
+ public DefaultRepresentativity(final Representativity object) {
super(object);
}
@@ -77,9 +78,9 @@ public class DefaultTemporalValidity extends AbstractTemporalAccuracy implements
* <ul>
* <li>If the given object is {@code null}, then this method returns {@code null}.</li>
* <li>Otherwise if the given object is already an instance of
- * {@code DefaultTemporalValidity}, then it is returned unchanged.</li>
- * <li>Otherwise a new {@code DefaultTemporalValidity} instance is created using the
- * {@linkplain #DefaultTemporalValidity(TemporalValidity) copy constructor}
+ * {@code DefaultRepresentativity}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultRepresentativity} instance is created using the
+ * {@linkplain #DefaultRepresentativity(Representativity) copy constructor}
* and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
* metadata contained in the given object are not recursively copied.</li>
* </ul>
@@ -88,10 +89,10 @@ public class DefaultTemporalValidity extends AbstractTemporalAccuracy implements
* @return a SIS implementation containing the values of the given object (may be the
* given object itself), or {@code null} if the argument was null.
*/
- public static DefaultTemporalValidity castOrCopy(final TemporalValidity object) {
- if (object == null || object instanceof DefaultTemporalValidity) {
- return (DefaultTemporalValidity) object;
+ public static DefaultRepresentativity castOrCopy(final Representativity object) {
+ if (object == null || object instanceof DefaultRepresentativity) {
+ return (DefaultRepresentativity) object;
}
- return new DefaultTemporalValidity(object);
+ return new DefaultRepresentativity(object);
}
}
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultSampleBasedInspection.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultSampleBasedInspection.java
new file mode 100644
index 0000000000..b26cba5ff6
--- /dev/null
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultSampleBasedInspection.java
@@ -0,0 +1,191 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.metadata.iso.quality;
+
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import org.opengis.util.InternationalString;
+import org.opengis.metadata.quality.SampleBasedInspection;
+
+
+/**
+ * Sample based inspection.
+ * The following properties are mandatory in a well-formed metadata according ISO 19157:
+ *
+ * <div class="preformat">{@code DQ_SampleBasedInspection}
+ * {@code ├─samplingScheme……………} Type of sampling scheme and description of the sampling procedure.
+ * {@code ├─lotDescription……………} How lots are defined.
+ * {@code └─samplingRatio………………} How many samples on average are extracted for inspection from each lot of population.</div>
+ *
+ * <h2>Limitations</h2>
+ * <ul>
+ * <li>Instances of this class are not synchronized for multi-threading.
+ * Synchronization, if needed, is caller's responsibility.</li>
+ * <li>Serialized objects of this class are not guaranteed to be compatible with future Apache SIS releases.
+ * Serialization support is appropriate for short term storage or RMI between applications running the
+ * same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
+ * </ul>
+ *
+ * @author Alexis Gaillard (Geomatys)
+ * @author Martin Desruisseaux (Geomatys)
+ * @version 1.3
+ * @since 1.3
+ * @module
+ */
+@XmlType(name = "DQ_SampleBasedInspection_Type", propOrder = {
+ "samplingScheme",
+ "lotDescription",
+ "samplingRatio"
+})
+@XmlRootElement(name = "DQ_SampleBasedInspection")
+public class DefaultSampleBasedInspection extends AbstractDataEvaluation implements SampleBasedInspection {
+ /**
+ * Serial number for inter-operability with different versions.
+ */
+ private static final long serialVersionUID = -811881513591264926L;
+
+ /**
+ * Information of the type of sampling scheme and description of the sampling procedure.
+ */
+ @SuppressWarnings("serial")
+ private InternationalString samplingScheme;
+
+ /**
+ * Information of how lots are defined.
+ */
+ @SuppressWarnings("serial")
+ private InternationalString lotDescription;
+
+ /**
+ * Information on how many samples on average are extracted for inspection from each lot of population.
+ */
+ @SuppressWarnings("serial")
+ private InternationalString samplingRatio;
+
+ /**
+ * Constructs an initially empty sample based description.
+ */
+ public DefaultSampleBasedInspection() {
+ }
+
+ /**
+ * Constructs a new instance initialized with the values from the specified metadata object.
+ * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
+ * given object are not recursively copied.
+ *
+ * @param object the metadata to copy values from, or {@code null} if none.
+ *
+ * @see #castOrCopy(SampleBasedInspection)
+ */
+ public DefaultSampleBasedInspection(final SampleBasedInspection object) {
+ super(object);
+ if (object != null) {
+ samplingScheme = object.getSamplingScheme();
+ lotDescription = object.getLotDescription();
+ samplingRatio = object.getSamplingRatio();
+ }
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable action in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultSampleBasedInspection}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultSampleBasedInspection} instance is created using the
+ * {@linkplain #DefaultSampleBasedInspection(SampleBasedInspection) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
+ *
+ * @param object the object to get as a SIS implementation, or {@code null} if none.
+ * @return a SIS implementation containing the values of the given object (may be the
+ * given object itself), or {@code null} if the argument was null.
+ */
+ public static DefaultSampleBasedInspection castOrCopy(final SampleBasedInspection object) {
+ if (object == null || object instanceof DefaultSampleBasedInspection) {
+ return (DefaultSampleBasedInspection) object;
+ }
+ return new DefaultSampleBasedInspection(object);
+ }
+
+ /**
+ * Returns the information of the type of sampling scheme and description of the sampling procedure.
+ *
+ * @return sampling scheme and sampling procedure.
+ */
+ @Override
+ @XmlElement(name = "samplingScheme", required = true)
+ public InternationalString getSamplingScheme() {
+ return samplingScheme;
+ }
+
+ /**
+ * Sets the information of the type of sampling scheme and description of the sampling procedure.
+ *
+ * @param newValue the new sampling scheme.
+ */
+ public void setSamplingScheme(final InternationalString newValue) {
+ checkWritePermission(samplingScheme);
+ samplingScheme = newValue;
+ }
+
+ /**
+ * Returns the information of how lots are defined.
+ *
+ * @return information on lots.
+ */
+ @Override
+ @XmlElement(name = "lotDescription", required = true)
+ public InternationalString getLotDescription() {
+ return lotDescription;
+ }
+
+ /**
+ * Sets the information of how lots are defined.
+ *
+ * @param newValue the new information.
+ */
+ public void setLotDescription(final InternationalString newValue) {
+ checkWritePermission(lotDescription);
+ lotDescription = newValue;
+ }
+
+ /**
+ * Returns the information on how many samples on average are extracted for inspection from each lot of population.
+ *
+ * @return average number of samples extracted for inspection.
+ */
+ @Override
+ @XmlElement(name = "samplingRatio", required = true)
+ public InternationalString getSamplingRatio() {
+ return samplingRatio;
+ }
+
+ /**
+ * Sets the information on how many samples on average are extracted for inspection from each lot of population.
+ *
+ * @param newValue the new information.
+ */
+ public void setSamplingRatio(final InternationalString newValue) {
+ checkWritePermission(samplingRatio);
+ samplingRatio = newValue;
+ }
+}
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultRelativeInternalPositionalAccuracy.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultSourceReference.java
similarity index 54%
copy from core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultRelativeInternalPositionalAccuracy.java
copy to core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultSourceReference.java
index b7bffe8d96..bc3c51a452 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultRelativeInternalPositionalAccuracy.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultSourceReference.java
@@ -17,17 +17,19 @@
package org.apache.sis.metadata.iso.quality;
import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
-import org.opengis.metadata.quality.RelativeInternalPositionalAccuracy;
+import org.opengis.metadata.citation.Citation;
+import org.opengis.metadata.quality.SourceReference;
+import org.apache.sis.xml.Namespaces;
/**
- * Closeness of the relative positions of features in the scope to their respective
- * relative positions accepted as or being true.
- * The following property is mandatory in a well-formed metadata according ISO 19115:
+ * Reference to the source of the data quality measure.
+ * The following property is mandatory in a well-formed metadata according ISO 19157:
*
- * <div class="preformat">{@code DQ_RelativeInternalPositionalAccuracy}
- * {@code └─result……………} Value obtained from applying a data quality measure.</div>
+ * <div class="preformat">{@code DQM_SourceReference}
+ * {@code └─citation……………} References to the source.</div>
*
* <h2>Limitations</h2>
* <ul>
@@ -38,26 +40,30 @@ import org.opengis.metadata.quality.RelativeInternalPositionalAccuracy;
* same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
* </ul>
*
- * @author Martin Desruisseaux (IRD, Geomatys)
- * @author Touraïvane (IRD)
- * @version 1.0
- * @since 0.3
+ * @author Alexis Gaillard (Geomatys)
+ * @author Martin Desruisseaux (Geomatys)
+ * @version 1.3
+ * @since 1.3
* @module
*/
-@XmlType(name = "DQ_RelativeInternalPositionalAccuracy_Type")
-@XmlRootElement(name = "DQ_RelativeInternalPositionalAccuracy")
-public class DefaultRelativeInternalPositionalAccuracy extends AbstractPositionalAccuracy
- implements RelativeInternalPositionalAccuracy
-{
+@XmlType(name = "DQM_SourceReference_Type", namespace = Namespaces.DQM)
+@XmlRootElement(name = "DQM_SourceReference", namespace = Namespaces.DQM)
+public class DefaultSourceReference extends ISOMetadata implements SourceReference {
/**
* Serial number for inter-operability with different versions.
*/
- private static final long serialVersionUID = 8385667875833802576L;
+ private static final long serialVersionUID = 2923526577209702000L;
/**
- * Constructs an initially empty relative internal positional accuracy.
+ * References to the source.
*/
- public DefaultRelativeInternalPositionalAccuracy() {
+ @SuppressWarnings("serial")
+ private Citation citation;
+
+ /**
+ * Constructs an initially empty source reference.
+ */
+ public DefaultSourceReference() {
}
/**
@@ -67,10 +73,13 @@ public class DefaultRelativeInternalPositionalAccuracy extends AbstractPositiona
*
* @param object the metadata to copy values from, or {@code null} if none.
*
- * @see #castOrCopy(RelativeInternalPositionalAccuracy)
+ * @see #castOrCopy(SourceReference)
*/
- public DefaultRelativeInternalPositionalAccuracy(final RelativeInternalPositionalAccuracy object) {
+ public DefaultSourceReference(final SourceReference object) {
super(object);
+ if (object != null) {
+ citation = object.getCitation();
+ }
}
/**
@@ -80,10 +89,10 @@ public class DefaultRelativeInternalPositionalAccuracy extends AbstractPositiona
* <ul>
* <li>If the given object is {@code null}, then this method returns {@code null}.</li>
* <li>Otherwise if the given object is already an instance of
- * {@code DefaultRelativeInternalPositionalAccuracy}, then it is returned unchanged.</li>
- * <li>Otherwise a new {@code DefaultRelativeInternalPositionalAccuracy} instance is created using the
- * {@linkplain #DefaultRelativeInternalPositionalAccuracy(RelativeInternalPositionalAccuracy) copy constructor}
- * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * {@code DefaultSourceReference}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultSourceReference} instance is created using the
+ * {@linkplain #DefaultSourceReference(SourceReference) copy constructor} and returned.
+ * Note that this is a <cite>shallow</cite> copy operation, since the other
* metadata contained in the given object are not recursively copied.</li>
* </ul>
*
@@ -91,10 +100,31 @@ public class DefaultRelativeInternalPositionalAccuracy extends AbstractPositiona
* @return a SIS implementation containing the values of the given object (may be the
* given object itself), or {@code null} if the argument was null.
*/
- public static DefaultRelativeInternalPositionalAccuracy castOrCopy(final RelativeInternalPositionalAccuracy object) {
- if (object == null || object instanceof DefaultRelativeInternalPositionalAccuracy) {
- return (DefaultRelativeInternalPositionalAccuracy) object;
+ public static DefaultSourceReference castOrCopy(final SourceReference object) {
+ if (object == null || object instanceof DefaultSourceReference) {
+ return (DefaultSourceReference) object;
}
- return new DefaultRelativeInternalPositionalAccuracy(object);
+ return new DefaultSourceReference(object);
+ }
+
+ /**
+ * Returns the references to the source.
+ *
+ * @return reference to the source.
+ */
+ @Override
+ @XmlElement(name = "citation", required = true)
+ public Citation getCitation() {
+ return citation;
+ }
+
+ /**
+ * Sets the references to the source.
+ *
+ * @param newValue the new source references.
+ */
+ public void setCitation(final Citation newValue) {
+ checkWritePermission(citation);
+ citation = newValue;
}
}
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultStandaloneQualityReportInformation.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultStandaloneQualityReportInformation.java
new file mode 100644
index 0000000000..84e0aca75e
--- /dev/null
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultStandaloneQualityReportInformation.java
@@ -0,0 +1,163 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.metadata.iso.quality;
+
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import org.opengis.util.InternationalString;
+import org.opengis.metadata.citation.Citation;
+import org.opengis.metadata.quality.StandaloneQualityReportInformation;
+
+
+/**
+ * Reference to an external standalone quality report.
+ * See the {@link StandaloneQualityReportInformation} GeoAPI interface for more details.
+ * The following property is mandatory in a well-formed metadata according ISO 19157:
+ *
+ * <div class="preformat">{@code DQ_Element}
+ * {@code ├─reportReference……} Reference to the procedure information.
+ * {@code └─abstract………………………} Description of the evaluation method.</div>
+ *
+ * <h2>Limitations</h2>
+ * <ul>
+ * <li>Instances of this class are not synchronized for multi-threading.
+ * Synchronization, if needed, is caller's responsibility.</li>
+ * <li>Serialized objects of this class are not guaranteed to be compatible with future Apache SIS releases.
+ * Serialization support is appropriate for short term storage or RMI between applications running the
+ * same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
+ * </ul>
+ *
+ * @author Alexis Gaillard (Geomatys)
+ * @author Martin Desruisseaux (Geomatys)
+ * @version 1.3
+ * @since 1.3
+ * @module
+ */
+@XmlType(name = "DQ_StandaloneQualityReportInformation_Type", propOrder = {
+ "reportReference",
+ "abstract"
+})
+@XmlRootElement(name = "DQ_StandaloneQualityReportInformation")
+public class DefaultStandaloneQualityReportInformation extends ISOMetadata implements StandaloneQualityReportInformation {
+ /**
+ * Serial number for inter-operability with different versions.
+ */
+ private static final long serialVersionUID = -6646482698986737797L;
+
+ /**
+ * Reference to the associated standalone quality report.
+ */
+ @SuppressWarnings("serial")
+ private Citation reportReference;
+
+ /**
+ * Abstract for the associated standalone quality report.
+ */
+ @SuppressWarnings("serial")
+ private InternationalString summary;
+
+ /**
+ * Constructs an initially empty standalone quality report information.
+ */
+ public DefaultStandaloneQualityReportInformation() {
+ }
+
+ /**
+ * Constructs a new instance initialized with the values from the specified metadata object.
+ * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
+ * given object are not recursively copied.
+ *
+ * @param object the metadata to copy values from, or {@code null} if none.
+ *
+ * @see #castOrCopy(StandaloneQualityReportInformation)
+ */
+ public DefaultStandaloneQualityReportInformation(final StandaloneQualityReportInformation object) {
+ super(object);
+ if (object != null) {
+ reportReference = object.getReportReference();
+ summary = object.getAbstract();
+ }
+ }
+
+ /**
+ * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
+ * This method performs the first applicable action in the following choices:
+ *
+ * <ul>
+ * <li>If the given object is {@code null}, then this method returns {@code null}.</li>
+ * <li>Otherwise if the given object is already an instance of
+ * {@code DefaultStandaloneQualityReportInformation}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultStandaloneQualityReportInformation} instance is created using the
+ * {@linkplain #DefaultStandaloneQualityReportInformation(StandaloneQualityReportInformation) copy constructor}
+ * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * metadata contained in the given object are not recursively copied.</li>
+ * </ul>
+ *
+ * @param object the object to get as a SIS implementation, or {@code null} if none.
+ * @return a SIS implementation containing the values of the given object (may be the
+ * given object itself), or {@code null} if the argument was null.
+ */
+ public static DefaultStandaloneQualityReportInformation castOrCopy(final StandaloneQualityReportInformation object) {
+ if (object instanceof StandaloneQualityReportInformation) {
+ return DefaultStandaloneQualityReportInformation.castOrCopy((DefaultStandaloneQualityReportInformation) object);
+ }
+ return new DefaultStandaloneQualityReportInformation(object);
+ }
+
+ /**
+ * Returns the reference to the associated standalone quality report.
+ *
+ * @return reference of the standalone quality report.
+ */
+ @Override
+ @XmlElement(name = "reportReference", required = true)
+ public Citation getReportReference() {
+ return reportReference;
+ }
+
+ /**
+ * Sets the reference to the associated standalone quality report.
+ *
+ * @param newValue the new reference.
+ */
+ public void setReportReference(final Citation newValue) {
+ checkWritePermission(reportReference);
+ reportReference = newValue;
+ }
+
+ /**
+ * Returns the abstract for the standalone quality report.
+ *
+ * @return abstract of the standalone quality report.
+ */
+ @Override
+ @XmlElement(name = "abstract", required = true)
+ public InternationalString getAbstract() {
+ return summary;
+ }
+
+ /**
+ * Sets the abstract for the associated standalone quality report.
+ *
+ * @param newValue the new abstract.
+ */
+ public void setAbstract(final InternationalString newValue) {
+ checkWritePermission(summary);
+ summary = newValue;
+ }
+}
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTemporalConsistency.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTemporalConsistency.java
index 5b1ce5c2c8..7da44c94cf 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTemporalConsistency.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTemporalConsistency.java
@@ -23,7 +23,8 @@ import org.opengis.metadata.quality.TemporalConsistency;
/**
* Correctness of ordered events or sequences, if reported.
- * The following property is mandatory in a well-formed metadata according ISO 19115:
+ * See the {@link TemporalConsistency} GeoAPI interface for more details.
+ * The following property is mandatory in a well-formed metadata according ISO 19157:
*
* <div class="preformat">{@code DQ_TemporalConsistency}
* {@code └─result……………} Value obtained from applying a data quality measure.</div>
@@ -39,13 +40,14 @@ import org.opengis.metadata.quality.TemporalConsistency;
*
* @author Martin Desruisseaux (IRD, Geomatys)
* @author Touraïvane (IRD)
- * @version 1.0
+ * @author Alexis Gaillard (Geomatys)
+ * @version 1.3
* @since 0.3
* @module
*/
@XmlType(name = "DQ_TemporalConsistency_Type")
@XmlRootElement(name = "DQ_TemporalConsistency")
-public class DefaultTemporalConsistency extends AbstractTemporalAccuracy implements TemporalConsistency {
+public class DefaultTemporalConsistency extends AbstractTemporalQuality implements TemporalConsistency {
/**
* Serial number for inter-operability with different versions.
*/
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTemporalValidity.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTemporalValidity.java
index eea7029a01..c9658506d4 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTemporalValidity.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTemporalValidity.java
@@ -23,7 +23,8 @@ import org.opengis.metadata.quality.TemporalValidity;
/**
* Validity of data specified by the scope with respect to time.
- * The following property is mandatory in a well-formed metadata according ISO 19115:
+ * See the {@link TemporalValidity} GeoAPI interface for more details.
+ * The following property is mandatory in a well-formed metadata according ISO 19157:
*
* <div class="preformat">{@code DQ_TemporalValidity}
* {@code └─result……………} Value obtained from applying a data quality measure.</div>
@@ -39,13 +40,14 @@ import org.opengis.metadata.quality.TemporalValidity;
*
* @author Martin Desruisseaux (IRD, Geomatys)
* @author Touraïvane (IRD)
- * @version 1.0
+ * @author Alexis Gaillard (Geomatys)
+ * @version 1.3
* @since 0.3
* @module
*/
@XmlType(name = "DQ_TemporalValidity_Type")
@XmlRootElement(name = "DQ_TemporalValidity")
-public class DefaultTemporalValidity extends AbstractTemporalAccuracy implements TemporalValidity {
+public class DefaultTemporalValidity extends AbstractTemporalQuality implements TemporalValidity {
/**
* Serial number for inter-operability with different versions.
*/
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultThematicClassificationCorrectness.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultThematicClassificationCorrectness.java
index 1213c70946..8d56c86842 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultThematicClassificationCorrectness.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultThematicClassificationCorrectness.java
@@ -23,7 +23,8 @@ import org.opengis.metadata.quality.ThematicClassificationCorrectness;
/**
* Comparison of the classes assigned to features or their attributes to a universe of discourse.
- * The following property is mandatory in a well-formed metadata according ISO 19115:
+ * See the {@link ThematicClassificationCorrectness} GeoAPI interface for more details.
+ * The following property is mandatory in a well-formed metadata according ISO 19157:
*
* <div class="preformat">{@code DQ_ThematicClassificationCorrectness}
* {@code └─result……………} Value obtained from applying a data quality measure.</div>
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTopologicalConsistency.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTopologicalConsistency.java
index 05ec8f8b67..8467adc834 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTopologicalConsistency.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultTopologicalConsistency.java
@@ -22,8 +22,9 @@ import org.opengis.metadata.quality.TopologicalConsistency;
/**
- * Correctness of the explicitly encoded topological characteristics of the dataset as described by the scope.
- * The following property is mandatory in a well-formed metadata according ISO 19115:
+ * Correctness of the explicitly encoded topological characteristics of the data set.
+ * See the {@link TopologicalConsistency} GeoAPI interface for more details.
+ * The following property is mandatory in a well-formed metadata according ISO 19157:
*
* <div class="preformat">{@code DQ_TopologicalConsistency}
* {@code └─result……………} Value obtained from applying a data quality measure.</div>
@@ -45,9 +46,7 @@ import org.opengis.metadata.quality.TopologicalConsistency;
*/
@XmlType(name = "DQ_TopologicalConsistency_Type")
@XmlRootElement(name = "DQ_TopologicalConsistency")
-public class DefaultTopologicalConsistency extends AbstractLogicalConsistency
- implements TopologicalConsistency
-{
+public class DefaultTopologicalConsistency extends AbstractLogicalConsistency implements TopologicalConsistency {
/**
* Serial number for inter-operability with different versions.
*/
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultUsability.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultUsability.java
index 5b97a6dcee..ccd7782240 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultUsability.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultUsability.java
@@ -24,32 +24,19 @@ import org.apache.sis.internal.xml.LegacyNamespaces;
/**
* Degree of adherence of a dataset to a specific set of user requirements.
- * The following property is mandatory in a well-formed metadata according ISO 19115:
- *
- * <div class="preformat">{@code QE_Usability}
- * {@code └─result……………} Value obtained from applying a data quality measure.</div>
- *
- * <h2>Limitations</h2>
- * <ul>
- * <li>Instances of this class are not synchronized for multi-threading.
- * Synchronization, if needed, is caller's responsibility.</li>
- * <li>Serialized objects of this class are not guaranteed to be compatible with future Apache SIS releases.
- * Serialization support is appropriate for short term storage or RMI between applications running the
- * same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
- * </ul>
*
* @author Cédric Briançon (Geomatys)
* @author Martin Desruisseaux (Geomatys)
- * @version 1.0
+ * @version 1.3
* @since 0.3
* @module
*
- * @deprecated Not found in ISO 19115-3:2016 schemas.
+ * @deprecated Renamed {@link DefaultUsabilityElement} for following a renaming in ISO 19157:2013.
*/
@Deprecated
@XmlType(name = "QE_Usability_Type", namespace = LegacyNamespaces.GMI)
@XmlRootElement(name = "QE_Usability", namespace = LegacyNamespaces.GMI)
-public class DefaultUsability extends AbstractElement implements Usability {
+public class DefaultUsability extends DefaultUsabilityElement implements Usability {
/**
* Serial number for inter-operability with different versions.
*/
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultRelativeInternalPositionalAccuracy.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultUsabilityElement.java
similarity index 65%
copy from core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultRelativeInternalPositionalAccuracy.java
copy to core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultUsabilityElement.java
index b7bffe8d96..83ef926889 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultRelativeInternalPositionalAccuracy.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultUsabilityElement.java
@@ -17,16 +17,17 @@
package org.apache.sis.metadata.iso.quality;
import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlRootElement;
-import org.opengis.metadata.quality.RelativeInternalPositionalAccuracy;
+import org.opengis.metadata.quality.Usability;
+import org.opengis.metadata.quality.UsabilityElement;
/**
- * Closeness of the relative positions of features in the scope to their respective
- * relative positions accepted as or being true.
- * The following property is mandatory in a well-formed metadata according ISO 19115:
+ * Degree of adherence of a dataset to a specific set of requirements.
+ * The following property is mandatory in a well-formed metadata according ISO 19157:
*
- * <div class="preformat">{@code DQ_RelativeInternalPositionalAccuracy}
+ * <div class="preformat">{@code DQ_UsabilityElement}
* {@code └─result……………} Value obtained from applying a data quality measure.</div>
*
* <h2>Limitations</h2>
@@ -39,16 +40,17 @@ import org.opengis.metadata.quality.RelativeInternalPositionalAccuracy;
* </ul>
*
* @author Martin Desruisseaux (IRD, Geomatys)
- * @author Touraïvane (IRD)
- * @version 1.0
- * @since 0.3
+ * @author Alexis Gaillard (Geomatys)
+ * @version 1.3
+ * @since 1.3
* @module
*/
-@XmlType(name = "DQ_RelativeInternalPositionalAccuracy_Type")
-@XmlRootElement(name = "DQ_RelativeInternalPositionalAccuracy")
-public class DefaultRelativeInternalPositionalAccuracy extends AbstractPositionalAccuracy
- implements RelativeInternalPositionalAccuracy
-{
+@XmlType(name = "DQ_UsabilityElement_Type")
+@XmlRootElement(name = "DQ_UsabilityElement")
+@XmlSeeAlso({
+ DefaultUsability.class
+})
+public class DefaultUsabilityElement extends AbstractElement implements UsabilityElement {
/**
* Serial number for inter-operability with different versions.
*/
@@ -57,7 +59,7 @@ public class DefaultRelativeInternalPositionalAccuracy extends AbstractPositiona
/**
* Constructs an initially empty relative internal positional accuracy.
*/
- public DefaultRelativeInternalPositionalAccuracy() {
+ public DefaultUsabilityElement() {
}
/**
@@ -67,9 +69,9 @@ public class DefaultRelativeInternalPositionalAccuracy extends AbstractPositiona
*
* @param object the metadata to copy values from, or {@code null} if none.
*
- * @see #castOrCopy(RelativeInternalPositionalAccuracy)
+ * @see #castOrCopy(UsabilityElement)
*/
- public DefaultRelativeInternalPositionalAccuracy(final RelativeInternalPositionalAccuracy object) {
+ public DefaultUsabilityElement(final UsabilityElement object) {
super(object);
}
@@ -80,10 +82,10 @@ public class DefaultRelativeInternalPositionalAccuracy extends AbstractPositiona
* <ul>
* <li>If the given object is {@code null}, then this method returns {@code null}.</li>
* <li>Otherwise if the given object is already an instance of
- * {@code DefaultRelativeInternalPositionalAccuracy}, then it is returned unchanged.</li>
- * <li>Otherwise a new {@code DefaultRelativeInternalPositionalAccuracy} instance is created using the
- * {@linkplain #DefaultRelativeInternalPositionalAccuracy(RelativeInternalPositionalAccuracy) copy constructor}
- * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
+ * {@code DefaultUsabilityElement}, then it is returned unchanged.</li>
+ * <li>Otherwise a new {@code DefaultUsabilityElement} instance is created using the
+ * {@linkplain #DefaultUsabilityElement(UsabilityElement) copy constructor} and returned.
+ * Note that this is a <cite>shallow</cite> copy operation, since the other
* metadata contained in the given object are not recursively copied.</li>
* </ul>
*
@@ -91,10 +93,14 @@ public class DefaultRelativeInternalPositionalAccuracy extends AbstractPositiona
* @return a SIS implementation containing the values of the given object (may be the
* given object itself), or {@code null} if the argument was null.
*/
- public static DefaultRelativeInternalPositionalAccuracy castOrCopy(final RelativeInternalPositionalAccuracy object) {
- if (object == null || object instanceof DefaultRelativeInternalPositionalAccuracy) {
- return (DefaultRelativeInternalPositionalAccuracy) object;
+ @SuppressWarnings("deprecation")
+ public static DefaultUsabilityElement castOrCopy(final UsabilityElement object) {
+ if (object instanceof Usability) {
+ return DefaultUsability.castOrCopy((Usability) object);
}
- return new DefaultRelativeInternalPositionalAccuracy(object);
+ if (object == null || object instanceof DefaultUsabilityElement) {
+ return (DefaultUsabilityElement) object;
+ }
+ return new DefaultUsabilityElement(object);
}
}
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/ISOMetadata.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/ISOMetadata.java
new file mode 100644
index 0000000000..dae1584d8b
--- /dev/null
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/ISOMetadata.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.metadata.iso.quality;
+
+import org.apache.sis.metadata.MetadataStandard;
+
+
+/**
+ * The base class of ISO 19157 implementation classes.
+ *
+ * @author Martin Desruisseaux (Geomatys)
+ * @version 1.3
+ * @since 1.3
+ * @module
+ */
+abstract class ISOMetadata extends org.apache.sis.metadata.iso.ISOMetadata {
+ /**
+ * Serial number for inter-operability with different versions.
+ */
+ private static final long serialVersionUID = 8310882201886331960L;
+
+ /**
+ * Constructs an initially empty metadata.
+ */
+ protected ISOMetadata() {
+ }
+
+ /**
+ * Constructs a new metadata initialized with the values from the specified object.
+ *
+ * @param object the metadata to copy values from, or {@code null} if none.
+ */
+ protected ISOMetadata(final Object object) {
+ super(object);
+ }
+
+ /**
+ * Returns the metadata standard, which is {@linkplain MetadataStandard#ISO_19157 ISO 19157}.
+ *
+ * @return the metadata standard, which is {@linkplain MetadataStandard#ISO_19115 ISO 19157}.
+ */
+ @Override
+ public MetadataStandard getStandard() {
+ return MetadataStandard.ISO_19157;
+ }
+}
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/package-info.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/package-info.java
index 8fb66e9f93..4e287027e8 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/package-info.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/package-info.java
@@ -20,77 +20,6 @@
* An explanation for this package is provided in the {@linkplain org.opengis.metadata.quality OpenGIS® javadoc}.
* The remaining discussion on this page is specific to the SIS implementation.
*
- * <h2>Overview</h2>
- * For a global overview of metadata in SIS, see the {@link org.apache.sis.metadata} package javadoc.
- *
- * <table class="sis">
- * <caption>Package overview</caption>
- * <tr>
- * <th>Class hierarchy</th>
- * <th class="sep">Aggregation hierarchy</th>
- * </tr><tr><td style="width: 50%; white-space: nowrap">
- * {@linkplain org.apache.sis.metadata.iso.ISOMetadata ISO 19115 metadata}<br>
- * {@code ├─} {@linkplain org.apache.sis.metadata.iso.quality.DefaultDataQuality Data quality}<br>
- * {@code ├─} {@linkplain org.apache.sis.metadata.iso.quality.AbstractElement Element} «abstract»<br>
- * {@code │ ├─} {@linkplain org.apache.sis.metadata.iso.quality.AbstractCompleteness Completeness} «abstract»<br>
- * {@code │ │ ├─} {@linkplain org.apache.sis.metadata.iso.quality.DefaultCompletenessCommission Completeness commission}<br>
- * {@code │ │ └─} {@linkplain org.apache.sis.metadata.iso.quality.DefaultCompletenessOmission Completeness omission}<br>
- * {@code │ ├─} {@linkplain org.apache.sis.metadata.iso.quality.AbstractLogicalConsistency Logical consistency} «abstract»<br>
- * {@code │ │ ├─} {@linkplain org.apache.sis.metadata.iso.quality.DefaultConceptualConsistency Conceptual consistency}<br>
- * {@code │ │ ├─} {@linkplain org.apache.sis.metadata.iso.quality.DefaultDomainConsistency Domain consistency}<br>
- * {@code │ │ ├─} {@linkplain org.apache.sis.metadata.iso.quality.DefaultFormatConsistency Format consistency}<br>
- * {@code │ │ └─} {@linkplain org.apache.sis.metadata.iso.quality.DefaultTopologicalConsistency Topological consistency}<br>
- * {@code │ ├─} {@linkplain org.apache.sis.metadata.iso.quality.AbstractPositionalAccuracy Positional accuracy} «abstract»<br>
- * {@code │ │ ├─} {@linkplain org.apache.sis.metadata.iso.quality.DefaultAbsoluteExternalPositionalAccuracy Absolute external positional accuracy}<br>
- * {@code │ │ ├─} {@linkplain org.apache.sis.metadata.iso.quality.DefaultRelativeInternalPositionalAccuracy Relative internal positional accuracy}<br>
- * {@code │ │ └─} {@linkplain org.apache.sis.metadata.iso.quality.DefaultGriddedDataPositionalAccuracy Gridded data positional accuracy}<br>
- * {@code │ ├─} {@linkplain org.apache.sis.metadata.iso.quality.AbstractTemporalAccuracy Temporal accuracy} «abstract»<br>
- * {@code │ │ ├─} {@linkplain org.apache.sis.metadata.iso.quality.DefaultAccuracyOfATimeMeasurement Accuracy of a time measurement}<br>
- * {@code │ │ ├─} {@linkplain org.apache.sis.metadata.iso.quality.DefaultTemporalConsistency Temporal consistency}<br>
- * {@code │ │ └─} {@linkplain org.apache.sis.metadata.iso.quality.DefaultTemporalValidity Temporal validity}<br>
- * {@code │ ├─} {@linkplain org.apache.sis.metadata.iso.quality.AbstractThematicAccuracy Thematic accuracy} «abstract»<br>
- * {@code │ │ ├─} {@linkplain org.apache.sis.metadata.iso.quality.DefaultQuantitativeAttributeAccuracy Quantitative attribute accuracy}<br>
- * {@code │ │ ├─} {@linkplain org.apache.sis.metadata.iso.quality.DefaultNonQuantitativeAttributeAccuracy Non quantitative attribute accuracy}<br>
- * {@code │ │ └─} {@linkplain org.apache.sis.metadata.iso.quality.DefaultThematicClassificationCorrectness Thematic classification correctness}<br>
- * {@code │ └─} {@linkplain org.apache.sis.metadata.iso.quality.DefaultUsability Usability}<br>
- * {@code └─} {@linkplain org.apache.sis.metadata.iso.quality.AbstractResult Result} «abstract»<br>
- * {@code ├─} {@linkplain org.apache.sis.metadata.iso.quality.DefaultConformanceResult Conformance result}<br>
- * {@code ├─} {@linkplain org.apache.sis.metadata.iso.quality.DefaultQuantitativeResult Quantitative result}<br>
- * {@code └─} {@linkplain org.apache.sis.metadata.iso.quality.DefaultCoverageResult Coverage result}<br>
- * {@linkplain org.opengis.util.CodeList Code list}<br>
- * {@code └─} {@linkplain org.opengis.metadata.quality.EvaluationMethodType Evaluation method type}<br>
- * </td><td class="sep" style="width: 50%; white-space: nowrap">
- * {@linkplain org.apache.sis.metadata.iso.quality.DefaultDataQuality Data quality}<br>
- * {@code ├─} {@linkplain org.apache.sis.metadata.iso.maintenance.DefaultScope Scope}<br>
- * {@code └─} {@linkplain org.apache.sis.metadata.iso.quality.AbstractElement Element} «abstract»<br>
- * {@code ├─} {@linkplain org.opengis.metadata.quality.EvaluationMethodType Evaluation method type} «code list»<br>
- * {@code └─} {@linkplain org.apache.sis.metadata.iso.quality.AbstractResult Result} «abstract»<br>
- * {@linkplain org.apache.sis.metadata.iso.quality.AbstractCompleteness Completeness} «abstract»<br>
- * {@linkplain org.apache.sis.metadata.iso.quality.DefaultCompletenessCommission Completeness commission}<br>
- * {@linkplain org.apache.sis.metadata.iso.quality.DefaultCompletenessOmission Completeness omission}<br>
- * {@linkplain org.apache.sis.metadata.iso.quality.AbstractLogicalConsistency Logical consistency} «abstract»<br>
- * {@linkplain org.apache.sis.metadata.iso.quality.DefaultConceptualConsistency Conceptual consistency}<br>
- * {@linkplain org.apache.sis.metadata.iso.quality.DefaultDomainConsistency Domain consistency}<br>
- * {@linkplain org.apache.sis.metadata.iso.quality.DefaultFormatConsistency Format consistency}<br>
- * {@linkplain org.apache.sis.metadata.iso.quality.DefaultTopologicalConsistency Topological consistency}<br>
- * {@linkplain org.apache.sis.metadata.iso.quality.AbstractPositionalAccuracy Positional accuracy} «abstract»<br>
- * {@linkplain org.apache.sis.metadata.iso.quality.DefaultAbsoluteExternalPositionalAccuracy Absolute external positional accuracy}<br>
- * {@linkplain org.apache.sis.metadata.iso.quality.DefaultRelativeInternalPositionalAccuracy Relative internal positional accuracy}<br>
- * {@linkplain org.apache.sis.metadata.iso.quality.DefaultGriddedDataPositionalAccuracy Gridded data positional accuracy}<br>
- * {@linkplain org.apache.sis.metadata.iso.quality.AbstractTemporalAccuracy Temporal accuracy} «abstract»<br>
- * {@linkplain org.apache.sis.metadata.iso.quality.DefaultAccuracyOfATimeMeasurement Accuracy of a time measurement}<br>
- * {@linkplain org.apache.sis.metadata.iso.quality.DefaultTemporalConsistency Temporal consistency}<br>
- * {@linkplain org.apache.sis.metadata.iso.quality.DefaultTemporalValidity Temporal validity}<br>
- * {@linkplain org.apache.sis.metadata.iso.quality.AbstractThematicAccuracy Thematic accuracy} «abstract»<br>
- * {@linkplain org.apache.sis.metadata.iso.quality.DefaultQuantitativeAttributeAccuracy Quantitative attribute accuracy}<br>
- * {@linkplain org.apache.sis.metadata.iso.quality.DefaultNonQuantitativeAttributeAccuracy Non quantitative attribute accuracy}<br>
- * {@linkplain org.apache.sis.metadata.iso.quality.DefaultThematicClassificationCorrectness Thematic classification correctness}<br>
- * {@linkplain org.apache.sis.metadata.iso.quality.DefaultUsability Usability}<br>
- * {@linkplain org.apache.sis.metadata.iso.quality.DefaultConformanceResult Conformance result}<br>
- * {@linkplain org.apache.sis.metadata.iso.quality.DefaultQuantitativeResult Quantitative result}<br>
- * {@linkplain org.apache.sis.metadata.iso.quality.DefaultCoverageResult Coverage result}<br>
- * </td></tr></table>
- *
* <h2>Null values, nil objects and collections</h2>
* All constructors and setter methods accept {@code null} arguments.
* A null argument value means that the metadata element can not be provided, and the reason for that is unspecified.
@@ -110,11 +39,9 @@
* @author Cédric Briançon (Geomatys)
* @author Guilhem Legal (Geomatys)
* @author Cullen Rombach (Image Matters)
- * @version 1.0
- *
- * @see <a href="https://issues.apache.org/jira/browse/SIS-394">SIS-394</a>
- *
- * @since 0.3
+ * @author Alexis Gaillard (Geomatys)
+ * @version 1.3
+ * @since 0.3
* @module
*/
@XmlSchema(location="https://standards.iso.org/iso/19157/-2/mdq/1.0/mdq.xsd",
@@ -122,7 +49,7 @@
xmlns = {
@XmlNs(prefix = "mdq", namespaceURI = Namespaces.MDQ), // Metadata for Data Quality
@XmlNs(prefix = "mrd", namespaceURI = Namespaces.MRD), // Metadata for Resource Distribution
- // @XmlNs(prefix = "dqc", namespaceURI = Namespaces.DQC), // Data Quality Common Classes
+ @XmlNs(prefix = "dqm", namespaceURI = Namespaces.DQM), // Data Quality Measures
@XmlNs(prefix = "mcc", namespaceURI = Namespaces.MCC), // Metadata Common Classes
@XmlNs(prefix = "gmd", namespaceURI = LegacyNamespaces.GMD),
@XmlNs(prefix = "gmi", namespaceURI = LegacyNamespaces.GMI)
@@ -131,16 +58,28 @@
@XmlJavaTypeAdapters({
@XmlJavaTypeAdapter(CI_Citation.class),
@XmlJavaTypeAdapter(DQ_Element.class),
+ @XmlJavaTypeAdapter(DQ_EvaluationMethod.class),
@XmlJavaTypeAdapter(DQ_EvaluationMethodTypeCode.class),
+ @XmlJavaTypeAdapter(DQ_MeasureReference.class),
@XmlJavaTypeAdapter(DQ_Result.class),
+ @XmlJavaTypeAdapter(DQ_StandaloneQualityReportInformation.class),
+ @XmlJavaTypeAdapter(DQM_BasicMeasure.class),
+ @XmlJavaTypeAdapter(DQM_Description.class),
+// @XmlJavaTypeAdapter(DQM_Measure.class), // Not directly referenced, but a "weak" association exists.
+ @XmlJavaTypeAdapter(DQM_Parameter.class),
+ @XmlJavaTypeAdapter(DQM_SourceReference.class),
+ @XmlJavaTypeAdapter(DQM_ValueStructure.class),
@XmlJavaTypeAdapter(GO_Boolean.class),
@XmlJavaTypeAdapter(GO_DateTime.class),
+ @XmlJavaTypeAdapter(GO_GenericName.class),
@XmlJavaTypeAdapter(GO_Record.class),
@XmlJavaTypeAdapter(GO_RecordType.class),
@XmlJavaTypeAdapter(LI_Lineage.class),
+ @XmlJavaTypeAdapter(MD_BrowseGraphic.class),
@XmlJavaTypeAdapter(MD_ContentInformation.class),
@XmlJavaTypeAdapter(MD_Format.class),
@XmlJavaTypeAdapter(MD_Identifier.class),
+// @XmlJavaTypeAdapter(MD_RangeDimension.class), // Pending new ISO 19157 revision.
@XmlJavaTypeAdapter(MD_Scope.class),
@XmlJavaTypeAdapter(MD_SpatialRepresentation.class),
@XmlJavaTypeAdapter(MD_SpatialRepresentationTypeCode.class),
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/metadata/package-info.java b/core/sis-metadata/src/main/java/org/apache/sis/metadata/package-info.java
index 036790afa5..eae0077bc2 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/package-info.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/package-info.java
@@ -119,7 +119,7 @@
*
* @author Martin Desruisseaux (IRD, Geomatys)
* @author Adrian Custer (Geomatys)
- * @version 1.2
+ * @version 1.3
* @since 0.3
* @module
*/
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/xml/Namespaces.java b/core/sis-metadata/src/main/java/org/apache/sis/xml/Namespaces.java
index fcb6af9123..46c7417140 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/xml/Namespaces.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/xml/Namespaces.java
@@ -60,6 +60,7 @@ import org.apache.sis.internal.xml.LegacyNamespaces;
* <tr><td>mmi</td> <td>Metadata for Maintenance Information</td> <td>{@value #MMI}</td> <td></td></tr>
* <tr><td>dqc</td> <td>Data Quality Common Classes</td> <td>{@value #DQC}</td> <td></td></tr>
* <tr><td>mdq</td> <td>Metadata for Data Quality</td> <td>{@value #MDQ}</td> <td></td></tr>
+ * <tr><td>dqm</td> <td>Data Quality Measures</td> <td>{@value #DQM}</td> <td></td></tr>
* <tr><td>mds</td> <td>Metadata for Data and Services</td> <td>{@value #MDS}</td> <td></td></tr>
* <tr><td>srv</td> <td>Metadata for Services</td> <td>{@value #SRV}</td> <td>SIS 1.0</td></tr>
* <tr><td>mpc</td> <td>Metadata for Portrayal Catalog</td> <td>{@value #MPC}</td> <td></td></tr>
@@ -87,7 +88,8 @@ import org.apache.sis.internal.xml.LegacyNamespaces;
* @author Quentin Boileau (Geomatys)
* @author Guilhem Legal (Geomatys)
* @author Cullen Rombach (Image Matters)
- * @version 1.2
+ * @author Alexis Gaillard (Geomatys)
+ * @version 1.3
* @since 0.3
* @module
*/
@@ -332,6 +334,16 @@ public final class Namespaces extends Static {
*/
public static final String MDQ = "http://standards.iso.org/iso/19157/-2/mdq/1.0";
+ /**
+ * The <code>{@value}</code> URL. This is the namespace of
+ * <a href="http://standards.iso.org/iso/19157/-2/dqm/1.0/index.html">Data Quality Measures (DQM) version 1.0</a>.
+ * The usual prefix for this namespace is {@code "dqm"}.
+ *
+ * @category ISO
+ * @since 1.3
+ */
+ public static final String DQM = "http://standards.iso.org/iso/19157/-2/dqm/1.0";
+
/**
* The <code>{@value}</code> URL. This is the namespace of
* <a href="http://standards.iso.org/iso/19115/-3/mds/1.0/index.html">Metadata for Data and Services (MDS) version 1.0</a>.
diff --git a/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyConsistencyCheck.java b/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyConsistencyCheck.java
index 12ecac141a..d7e84f067c 100644
--- a/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyConsistencyCheck.java
+++ b/core/sis-metadata/src/test/java/org/apache/sis/metadata/PropertyConsistencyCheck.java
@@ -49,7 +49,7 @@ import org.junit.Test;
* package-private classes.
*
* @author Martin Desruisseaux (Geomatys)
- * @version 1.2
+ * @version 1.3
* @since 0.3
* @module
*/
@@ -209,6 +209,7 @@ public abstract strictfp class PropertyConsistencyCheck extends AnnotationConsis
* Try to instantiate the implementation. Every implementation should
* have a no-args constructor, and their instantiation should never fail.
*/
+ testingMethod = null;
testingClass = accessor.implementation.getCanonicalName();
final Object instance;
try {
diff --git a/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java b/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java
index b8ea6f0ad0..6d0022a27c 100644
--- a/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java
+++ b/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java
@@ -18,6 +18,7 @@ package org.apache.sis.metadata.iso;
import java.lang.reflect.Modifier;
import org.opengis.annotation.UML;
+import org.opengis.annotation.Stereotype;
import org.opengis.util.ControlledVocabulary;
import org.apache.sis.internal.jaxb.Context;
import org.apache.sis.metadata.MetadataStandard;
@@ -32,7 +33,7 @@ import org.junit.Test;
* Tests all known {@link ISOMetadata} subclasses for JAXB annotations and getter/setter methods.
*
* @author Martin Desruisseaux (Geomatys)
- * @version 1.0
+ * @version 1.3
* @since 0.3
* @module
*/
@@ -162,32 +163,54 @@ public final strictfp class AllMetadataTest extends PropertyConsistencyCheck {
org.opengis.metadata.maintenance.ScopeDescription.class,
org.opengis.metadata.quality.AbsoluteExternalPositionalAccuracy.class,
org.opengis.metadata.quality.AccuracyOfATimeMeasurement.class,
+ org.opengis.metadata.quality.AggregationDerivation.class,
+ org.opengis.metadata.quality.BasicMeasure.class,
org.opengis.metadata.quality.Completeness.class,
org.opengis.metadata.quality.CompletenessCommission.class,
org.opengis.metadata.quality.CompletenessOmission.class,
org.opengis.metadata.quality.ConceptualConsistency.class,
+ org.opengis.metadata.quality.Confidence.class,
org.opengis.metadata.quality.ConformanceResult.class,
org.opengis.metadata.quality.CoverageResult.class,
+ org.opengis.metadata.quality.DataEvaluation.class,
org.opengis.metadata.quality.DataQuality.class,
+ org.opengis.metadata.quality.Description.class,
+ org.opengis.metadata.quality.DescriptiveResult.class,
org.opengis.metadata.quality.DomainConsistency.class,
org.opengis.metadata.quality.Element.class,
+ org.opengis.metadata.quality.EvaluationMethod.class,
org.opengis.metadata.quality.EvaluationMethodType.class,
org.opengis.metadata.quality.FormatConsistency.class,
+ org.opengis.metadata.quality.FullInspection.class,
org.opengis.metadata.quality.GriddedDataPositionalAccuracy.class,
+ org.opengis.metadata.quality.Homogeneity.class,
+ org.opengis.metadata.quality.IndirectEvaluation.class,
org.opengis.metadata.quality.LogicalConsistency.class,
+ org.opengis.metadata.quality.Measure.class,
+ org.opengis.metadata.quality.MeasureReference.class,
+ org.opengis.metadata.quality.Metaquality.class,
org.opengis.metadata.quality.NonQuantitativeAttributeAccuracy.class,
+ org.opengis.metadata.quality.NonQuantitativeAttributeCorrectness.class,
+ org.opengis.metadata.quality.Parameter.class,
org.opengis.metadata.quality.PositionalAccuracy.class,
org.opengis.metadata.quality.QuantitativeAttributeAccuracy.class,
org.opengis.metadata.quality.QuantitativeResult.class,
org.opengis.metadata.quality.RelativeInternalPositionalAccuracy.class,
+ org.opengis.metadata.quality.Representativity.class,
org.opengis.metadata.quality.Result.class,
+ org.opengis.metadata.quality.SampleBasedInspection.class,
+ org.opengis.metadata.quality.SourceReference.class,
+ org.opengis.metadata.quality.StandaloneQualityReportInformation.class,
org.opengis.metadata.quality.TemporalAccuracy.class,
org.opengis.metadata.quality.TemporalConsistency.class,
+ org.opengis.metadata.quality.TemporalQuality.class,
org.opengis.metadata.quality.TemporalValidity.class,
org.opengis.metadata.quality.ThematicAccuracy.class,
org.opengis.metadata.quality.ThematicClassificationCorrectness.class,
org.opengis.metadata.quality.TopologicalConsistency.class,
org.opengis.metadata.quality.Usability.class,
+ org.opengis.metadata.quality.UsabilityElement.class,
+ org.opengis.metadata.quality.ValueStructure.class,
org.opengis.metadata.spatial.CellGeometry.class,
org.opengis.metadata.spatial.Dimension.class,
org.opengis.metadata.spatial.DimensionNameType.class,
@@ -207,7 +230,8 @@ public final strictfp class AllMetadataTest extends PropertyConsistencyCheck {
}
/**
- * {@inheritDoc}
+ * For every properties in every non-{@code Codelist} types listed in the constructor,
+ * tests the property values. This method verifies initial conditions, then sets random values.
* Once the test is completed, this method verifies that the expected warnings have been logged,
* and no unexpected logging occurred.
*/
@@ -222,6 +246,30 @@ public final strictfp class AllMetadataTest extends PropertyConsistencyCheck {
loggings.assertNoUnexpectedLog();
}
+ /**
+ * Returns the name of the XML root element for an interface described by the given UML.
+ * This method does the generic work described in super-class, then applies special rules
+ * specific to the metadata package.
+ */
+ @Override
+ protected String getExpectedXmlRootElementName(final Stereotype stereotype, final UML uml) {
+ String name = super.getExpectedXmlRootElementName(stereotype, uml);
+ if (name.equals("DQ_CoverageResult")) name = "QE_CoverageResult";
+ return name;
+ }
+
+ /**
+ * Returns the name of the XML type for an interface described by the given UML.
+ * This method does the generic work described in super-class, then applies special rules
+ * specific to the metadata package.
+ */
+ @Override
+ protected String getExpectedXmlTypeName(final Stereotype stereotype, final UML uml) {
+ String name = super.getExpectedXmlTypeName(stereotype, uml);
+ if (name.equals("DQ_CoverageResult_Type")) name = "QE_CoverageResult_Type";
+ return name;
+ }
+
/**
* Returns the ISO 19115-3 wrapper for the given GeoAPI type,
* or {@code null} if no adapter is expected for the given type.
diff --git a/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/quality/AbstractPositionalAccuracyTest.java b/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/quality/AbstractPositionalAccuracyTest.java
index 75e58417ed..5341831c4b 100644
--- a/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/quality/AbstractPositionalAccuracyTest.java
+++ b/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/quality/AbstractPositionalAccuracyTest.java
@@ -24,7 +24,6 @@ import org.apache.sis.internal.jaxb.lan.FreeTextMarshallingTest;
import org.apache.sis.util.Version;
import org.apache.sis.metadata.xml.TestUsingFile;
import org.apache.sis.test.DependsOn;
-import org.junit.Ignore;
import org.junit.Test;
import static org.opengis.test.Assert.*;
@@ -37,7 +36,7 @@ import static org.apache.sis.test.TestUtilities.getSingleton;
* @author Cédric Briançon (Geomatys)
* @author Martin Desruisseaux (Geomatys)
* @author Cullen Rombach (Image Matters)
- * @version 1.0
+ * @version 1.3
* @since 0.3
* @module
*/
@@ -55,11 +54,9 @@ public final strictfp class AbstractPositionalAccuracyTest extends TestUsingFile
*
* @throws JAXBException if an error occurred during the during marshalling / unmarshalling processes.
*
- * @see <a href="https://issues.apache.org/jira/browse/SIS-394">Issue SIS-394</a>
* @see FreeTextMarshallingTest
*/
@Test
- @Ignore("Depends on SIS-394")
public void testXML() throws JAXBException {
roundtrip(XML2016+FILENAME, VERSION_2014);
}
@@ -78,16 +75,16 @@ public final strictfp class AbstractPositionalAccuracyTest extends TestUsingFile
* Unmarshals the given file and verify the content.
* Then marshals the object and verify that we get equivalent XML.
*/
+ @SuppressWarnings("deprecation")
private void roundtrip(final String filename, final Version version) throws JAXBException {
final AbstractElement metadata = unmarshalFile(AbstractElement.class, filename);
final InternationalString nameOfMeasure = getSingleton(metadata.getNamesOfMeasure());
/*
* Programmatic verification of the text group.
*/
- assertEquals("Quantitative quality measure focusing on the effective class percent "
- + "regarded to the total surface size", nameOfMeasure.toString(Locale.ENGLISH));
- assertEquals("Mesure qualité quantitative de type pourcentage de représentation de la "
- + "classe par rapport à la surface totale", nameOfMeasure.toString(Locale.FRENCH));
+ assertEquals("Name of a measure used for testing accuracy", nameOfMeasure.toString(Locale.ENGLISH));
+ assertEquals("Nom d'une mesure utilisée pour tester la précision", nameOfMeasure.toString(Locale.FRENCH));
+ assertEquals("An identifier", metadata.getMeasureIdentification().getCode());
/*
* Opportunist test. While it was not the purpose of this test, the above metadata
* needs to contain a "result" element in order to pass XML validation test.
diff --git a/core/sis-metadata/src/test/java/org/apache/sis/test/xml/AnnotationConsistencyCheck.java b/core/sis-metadata/src/test/java/org/apache/sis/test/xml/AnnotationConsistencyCheck.java
index 0b8b75578f..47e1399d0c 100644
--- a/core/sis-metadata/src/test/java/org/apache/sis/test/xml/AnnotationConsistencyCheck.java
+++ b/core/sis-metadata/src/test/java/org/apache/sis/test/xml/AnnotationConsistencyCheck.java
@@ -72,7 +72,7 @@ import junit.framework.AssertionFailedError;
*
* @author Cédric Briançon (Geomatys)
* @author Martin Desruisseaux (Geomatys)
- * @version 1.1
+ * @version 1.3
* @since 0.3
* @module
*/
@@ -270,13 +270,13 @@ public abstract strictfp class AnnotationConsistencyCheck extends TestCase {
}
case "lineage": {
if (org.opengis.metadata.quality.DataQuality.class.isAssignableFrom(impl)) {
- return LegacyNamespaces.GMD; // Deprecated property in a type not yet upgraded.
+ return LegacyNamespaces.GMD; // Deprecated property after upgrade to ISO 19157.
}
break;
}
case "errorStatistic": {
if (org.opengis.metadata.quality.QuantitativeResult.class.isAssignableFrom(impl)) {
- return LegacyNamespaces.GMD; // Deprecated property in a type not yet upgraded.
+ return LegacyNamespaces.GMD; // Deprecated property after upgrade to ISO 19157.
}
break;
}
@@ -287,7 +287,7 @@ public abstract strictfp class AnnotationConsistencyCheck extends TestCase {
case "evaluationMethodDescription":
case "evaluationProcedure": {
if (org.opengis.metadata.quality.Element.class.isAssignableFrom(impl)) {
- return LegacyNamespaces.GMD; // Deprecated property in a type not yet upgraded.
+ return LegacyNamespaces.GMD; // Deprecated properties after upgrade to ISO 19157.
}
break;
}
@@ -304,29 +304,20 @@ public abstract strictfp class AnnotationConsistencyCheck extends TestCase {
break;
}
}
- /*
- * GeoAPI has not yet been upgraded to ISO 19157. Interfaces in the "org.opengis.metadata.quality"
- * package are still defined according the old specification. Those types have the "DQ_" or "QE_"
- * prefix. This issue applies also to properties (starting with a lower case).
- */
if (identifier.startsWith("DQ_")) {
- assertEquals("Unexpected @Specification value.", Specification.ISO_19115, uml.specification());
- assertEquals("Specification version should be legacy ISO 19115.", (short) 2003, uml.version());
+ assertEquals("Unexpected @Specification value.", Specification.ISO_19157, uml.specification());
+ assertEquals("Specification version should be ISO 19157.", (short) 0, uml.version());
return Namespaces.MDQ;
}
+ if (identifier.startsWith("DQM_")) {
+ assertEquals("Unexpected @Specification value.", Specification.ISO_19157, uml.specification());
+ assertEquals("Specification version should be ISO 19157.", (short) 0, uml.version());
+ return Namespaces.DQM;
+ }
if (identifier.startsWith("QE_")) {
assertEquals("Unexpected @Specification value.", Specification.ISO_19115_2, uml.specification());
- switch (uml.version()) {
- case 0: return Namespaces.MDQ;
- case 2009: return LegacyNamespaces.GMI;
- default: fail("Unexpected version number in " + uml);
- }
- }
- if (org.opengis.metadata.quality.DataQuality.class.isAssignableFrom(impl) || // For properties in those types.
- org.opengis.metadata.quality.Element.class.isAssignableFrom(impl) ||
- org.opengis.metadata.quality.Result.class.isAssignableFrom(impl))
- {
- return Namespaces.MDQ;
+ assertEquals("Specification version should be legacy ISO 19115-2.", (short) 2009, uml.version());
+ return LegacyNamespaces.GMI;
}
/*
* General cases (after we processed all the special cases)
@@ -344,6 +335,11 @@ public abstract strictfp class AnnotationConsistencyCheck extends TestCase {
case ISO_19115_3: return CodeListUID.METADATA_ROOT;
case ISO_19139: return LegacyNamespaces.GMX;
case ISO_19108: return LegacyNamespaces.GMD;
+ case ISO_19157: {
+ // Case for a method. By contrast, above `identifier.startsWith(…)` checks were for types.
+ final UML parent = TestUtilities.getSingleton(impl.getInterfaces()).getAnnotation(UML.class);
+ return parent.identifier().startsWith("DQM_") ? Namespaces.DQM : Namespaces.MDQ;
+ }
default: throw new IllegalArgumentException(uml.toString());
}
}
@@ -582,6 +578,28 @@ public abstract strictfp class AnnotationConsistencyCheck extends TestCase {
return org.opengis.metadata.content.SampleDimension.class.isAssignableFrom(dc)
&& !org.opengis.metadata.content.Band.class.isAssignableFrom(dc);
}
+ /*
+ * `Metaquality` override `Element` with only a change of obligation.
+ * We do not duplicate the Java methods only for that.
+ */
+ case "getDerivedElements": {
+ return org.opengis.metadata.quality.Metaquality.class.isAssignableFrom(method.getDeclaringClass());
+ }
+ /*
+ * - "resultContent" is a property in the ISO 10157 model but not yet in the XML schema.
+ * - "resultFormat" and "resultFile" differ in XML schema compared to abstract model (different obligation).
+ */
+ case "getResultContent":
+ case "getResultFormat":
+ case "getResultFile": {
+ return org.opengis.metadata.quality.CoverageResult.class.isAssignableFrom(method.getDeclaringClass());
+ }
+ /*
+ * GeoAPI addition, not in standard model.
+ */
+ case "getMeasure": {
+ return org.opengis.metadata.quality.Element.class.isAssignableFrom(method.getDeclaringClass());
+ }
/*
* Standard Java methods overridden in some GeoAPI interfaces for Javadoc purposes.
*/
diff --git a/core/sis-metadata/src/test/java/org/apache/sis/test/xml/SchemaCompliance.java b/core/sis-metadata/src/test/java/org/apache/sis/test/xml/SchemaCompliance.java
index 0389c970e4..2372c71526 100644
--- a/core/sis-metadata/src/test/java/org/apache/sis/test/xml/SchemaCompliance.java
+++ b/core/sis-metadata/src/test/java/org/apache/sis/test/xml/SchemaCompliance.java
@@ -16,6 +16,7 @@
*/
package org.apache.sis.test.xml;
+import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Files;
@@ -52,7 +53,7 @@ import org.apache.sis.util.StringBuilders;
* implementation easier, by reducing the amount of {@link Map}s that we need to manage.</p>
*
* @author Martin Desruisseaux (Geomatys)
- * @version 1.0
+ * @version 1.3
* @since 1.0
* @module
*/
@@ -132,7 +133,7 @@ public final strictfp class SchemaCompliance extends SchemaInformation {
path = classRootDirectory.relativize(path);
buffer.setLength(0);
buffer.append(path.toString()).setLength(buffer.length() - 6); // Remove ".class" suffix.
- StringBuilders.replace(buffer, '/', '.');
+ StringBuilders.replace(buffer, File.separatorChar, '.');
final Class<?> c = Class.forName(buffer.toString());
if (verifier == null) {
verifier = new PackageVerifier(this, c.getPackage());
diff --git a/core/sis-metadata/src/test/java/org/apache/sis/util/iso/TypesTest.java b/core/sis-metadata/src/test/java/org/apache/sis/util/iso/TypesTest.java
index 17161db33c..107ef0978f 100644
--- a/core/sis-metadata/src/test/java/org/apache/sis/util/iso/TypesTest.java
+++ b/core/sis-metadata/src/test/java/org/apache/sis/util/iso/TypesTest.java
@@ -202,7 +202,7 @@ public final strictfp class TypesTest extends TestCase {
description.toString(Locale.ROOT));
assertEquals("Online instructions for transferring data from one storage device or system to another.",
description.toString(Locale.ENGLISH));
- assertEquals("Transfert de la ressource d'un système à un autre.",
+ assertEquals("Transfert de la ressource d’un système à un autre.",
description.toString(Locale.FRENCH));
}
diff --git a/core/sis-metadata/src/test/resources/org/apache/sis/metadata/xml/2007/PositionalAccuracy.xml b/core/sis-metadata/src/test/resources/org/apache/sis/metadata/xml/2007/PositionalAccuracy.xml
index 8173de223d..ed79e668c5 100644
--- a/core/sis-metadata/src/test/resources/org/apache/sis/metadata/xml/2007/PositionalAccuracy.xml
+++ b/core/sis-metadata/src/test/resources/org/apache/sis/metadata/xml/2007/PositionalAccuracy.xml
@@ -30,13 +30,20 @@
opportunist check of xsi:type declaration.
-->
<gmd:nameOfMeasure xsi:type="gmd:PT_FreeText_PropertyType">
- <gco:CharacterString>Quantitative quality measure focusing on the effective class percent regarded to the total surface size</gco:CharacterString>
+ <gco:CharacterString>Name of a measure used for testing accuracy</gco:CharacterString>
<gmd:PT_FreeText>
<gmd:textGroup>
- <gmd:LocalisedCharacterString locale="#locale-fra">Mesure qualité quantitative de type pourcentage de représentation de la classe par rapport à la surface totale</gmd:LocalisedCharacterString>
+ <gmd:LocalisedCharacterString locale="#locale-fra">Nom d'une mesure utilisée pour tester la précision</gmd:LocalisedCharacterString>
</gmd:textGroup>
</gmd:PT_FreeText>
</gmd:nameOfMeasure>
+ <gmd:measureIdentification>
+ <gmd:MD_Identifier>
+ <gmd:code>
+ <gco:CharacterString>An identifier</gco:CharacterString>
+ </gmd:code>
+ </gmd:MD_Identifier>
+ </gmd:measureIdentification>
<gmd:result>
<!--
The xsi:type declaration below is useless, but we put it
diff --git a/core/sis-metadata/src/test/resources/org/apache/sis/metadata/xml/2016/PositionalAccuracy.xml b/core/sis-metadata/src/test/resources/org/apache/sis/metadata/xml/2016/PositionalAccuracy.xml
index ec8d6b7a23..fb1491b8b7 100644
--- a/core/sis-metadata/src/test/resources/org/apache/sis/metadata/xml/2016/PositionalAccuracy.xml
+++ b/core/sis-metadata/src/test/resources/org/apache/sis/metadata/xml/2016/PositionalAccuracy.xml
@@ -25,8 +25,8 @@
xmlns:lan="http://standards.iso.org/iso/19115/-3/lan/1.0"
xmlns:gco="http://standards.iso.org/iso/19115/-3/gco/1.0"
xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation = "http://standards.iso.org/iso/19157/-2/mdq/1.0 https://standards.iso.org/iso/19157/-2/mdq/1.0/mdq.xsd
- http://standards.iso.org/iso/19115/-3/lan/1.0 https://standards.iso.org/iso/19115/-3/lan/1.0/lan.xsd">
+ xsi:schemaLocation = "http://standards.iso.org/iso/19157/-2/mdq/1.0 https://schemas.isotc211.org/19157/-2/mdq/1.0/mdq.xsd
+ http://standards.iso.org/iso/19115/-3/lan/1.0 https://schemas.isotc211.org/19115/-3/lan/1.0/lan.xsd">
<!--
The <measure> element below is the main purpose of MetadataMarshallingTest.testPositionalAccuracy().
@@ -34,20 +34,23 @@
of an opportunist check of xsi:type declaration.
-->
<mdq:measure>
- <mdq:DQ_MeasureReference>
+ <mdq:DQ_MeasureReference>
<mdq:measureIdentification>
- <mcc:MD_Identifier>
- <mcc:code xsi:type="lan:PT_FreeText_PropertyType">
- <gco:CharacterString>Quantitative quality measure focusing on the effective class percent regarded to the total surface size</gco:CharacterString>
- <lan:PT_FreeText>
- <lan:textGroup>
- <lan:LocalisedCharacterString locale="#locale-fra">Mesure qualité quantitative de type pourcentage de représentation de la classe par rapport à la surface totale</lan:LocalisedCharacterString>
- </lan:textGroup>
- </lan:PT_FreeText>
- </mcc:code>
- </mcc:MD_Identifier>
+ <mcc:MD_Identifier>
+ <mcc:code>
+ <gco:CharacterString>An identifier</gco:CharacterString>
+ </mcc:code>
+ </mcc:MD_Identifier>
</mdq:measureIdentification>
- </mdq:DQ_MeasureReference>
+ <mdq:nameOfMeasure xsi:type="lan:PT_FreeText_PropertyType">
+ <gco:CharacterString>Name of a measure used for testing accuracy</gco:CharacterString>
+ <lan:PT_FreeText>
+ <lan:textGroup>
+ <lan:LocalisedCharacterString locale="#locale-fra">Nom d'une mesure utilisée pour tester la précision</lan:LocalisedCharacterString>
+ </lan:textGroup>
+ </lan:PT_FreeText>
+ </mdq:nameOfMeasure>
+ </mdq:DQ_MeasureReference>
</mdq:measure>
<mdq:result>
<!--
@@ -67,7 +70,7 @@
<gco:DateTime>2009-08-12T19:40:17.653+02:00</gco:DateTime>
</cit:date>
<cit:dateType>
- <cit:CI_DateTypeCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_DateTypeCode" codeListValue="creation">Creation</cit:CI_DateTypeCode>
+ <cit:CI_DateTypeCode codeList="http://standards.iso.org/iso/19115/resources/Codelist/cat/codelists.xml#CI_DateTypeCode" codeListValue="creation">Creation</cit:CI_DateTypeCode>
</cit:dateType>
</cit:CI_Date>
</cit:date>