Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultAlgorithm.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultAlgorithm.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultAlgorithm.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultAlgorithm.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -23,7 +23,6 @@ import org.opengis.metadata.citation.Cit import org.opengis.metadata.lineage.Algorithm; import org.opengis.util.InternationalString; import org.apache.sis.metadata.iso.ISOMetadata; -import org.apache.sis.xml.Namespaces; /** @@ -48,7 +47,7 @@ import org.apache.sis.xml.Namespaces; * @author Cédric Briançon (Geomatys) * @author Guilhem Legal (Geomatys) * @author Martin Desruisseaux (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ @@ -57,7 +56,7 @@ import org.apache.sis.xml.Namespaces; "citation", "description" }) -@XmlRootElement(name = "LE_Algorithm", namespace = Namespaces.GMI) +@XmlRootElement(name = "LE_Algorithm") public class DefaultAlgorithm extends ISOMetadata implements Algorithm { /** * Serial number for inter-operability with different versions. @@ -128,7 +127,7 @@ public class DefaultAlgorithm extends IS * @return algorithm and version or date, or {@code null}. */ @Override - @XmlElement(name = "citation", namespace = Namespaces.GMI, required = true) + @XmlElement(name = "citation", required = true) public Citation getCitation() { return citation; } @@ -149,7 +148,7 @@ public class DefaultAlgorithm extends IS * @return algorithm used to generate the data, or {@code null}. */ @Override - @XmlElement(name = "description", namespace = Namespaces.GMI, required = true) + @XmlElement(name = "description", required = true) public InternationalString getDescription() { return description; }
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultLineage.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultLineage.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultLineage.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultLineage.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -17,10 +17,10 @@ package org.apache.sis.metadata.iso.lineage; import java.util.Collection; +import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; -import org.opengis.annotation.UML; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import org.opengis.util.InternationalString; import org.opengis.metadata.citation.Citation; import org.opengis.metadata.quality.Scope; @@ -30,7 +30,11 @@ import org.opengis.metadata.lineage.Proc 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.jaxb.metadata.MD_Scope; +// Branch-specific imports +import org.opengis.annotation.UML; import static org.opengis.annotation.Obligation.OPTIONAL; import static org.opengis.annotation.Specification.ISO_19115; @@ -73,15 +77,16 @@ import static org.opengis.annotation.Spe * @author Touraïvane (IRD) * @author Cédric Briançon (Geomatys) * @author Rémi Maréchal (Geomatys) - * @version 0.5 + * @author Cullen Rombach (Image Matters) + * @version 1.0 * @since 0.3 * @module */ @SuppressWarnings("CloneableClassWithoutClone") // ModifiableMetadata needs shallow clones. @XmlType(name = "LI_Lineage_Type", propOrder = { "statement", -/// "scope", -/// "additionalResource", + "scope", // New in ISO 19115:2014 + "documentation", // New in ISO 19115:2014 (actually "additionalDocumentation") "processSteps", "sources" }) @@ -203,7 +208,8 @@ public class DefaultLineage extends ISOM * * @since 0.5 */ -/// @XmlElement(name = "scope") + @XmlElement(name = "scope") + @XmlJavaTypeAdapter(MD_Scope.Since2014.class) @UML(identifier="scope", obligation=OPTIONAL, specification=ISO_19115) public Scope getScope() { return scope; @@ -228,7 +234,7 @@ public class DefaultLineage extends ISOM * * @since 0.5 */ -/// @XmlElement(name = "additionalDocumentation") + // @XmlElement at the end of this class. @UML(identifier="additionalDocumentation", obligation=OPTIONAL, specification=ISO_19115) public Collection<Citation> getAdditionalDocumentation() { return additionalDocumentation = nonNullCollection(additionalDocumentation, Citation.class); @@ -284,4 +290,28 @@ public class DefaultLineage extends ISOM public void setSources(final Collection<? extends Source> newValues) { sources = writeCollection(newValues, sources, Source.class); } + + + + + ////////////////////////////////////////////////////////////////////////////////////////////////// + //////// //////// + //////// XML support with JAXB //////// + //////// //////// + //////// The following methods are invoked by JAXB using reflection (even if //////// + //////// they are private) or are helpers for other methods invoked by JAXB. //////// + //////// Those methods can be safely removed if Geographic Markup Language //////// + //////// (GML) support is not needed. //////// + //////// //////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Invoked by JAXB at both marshalling and unmarshalling time. + * This attribute has been added by ISO 19115:2014 standard. + * If (and only if) marshalling an older standard version, we omit this attribute. + */ + @XmlElement(name = "additionalDocumentation") + private Collection<Citation> getDocumentation() { + return FilterByVersion.CURRENT_METADATA.accept() ? getAdditionalDocumentation() : null; + } } Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultNominalResolution.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultNominalResolution.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultNominalResolution.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultNominalResolution.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -22,7 +22,6 @@ import javax.xml.bind.annotation.XmlType import org.opengis.metadata.lineage.NominalResolution; import org.apache.sis.metadata.iso.ISOMetadata; import org.apache.sis.measure.ValueRange; -import org.apache.sis.xml.Namespaces; import static org.apache.sis.internal.metadata.MetadataUtilities.ensurePositive; @@ -46,7 +45,7 @@ import static org.apache.sis.internal.me * * @author Cédric Briançon (Geomatys) * @author Martin Desruisseaux (Geomatys) - * @version 0.5 + * @version 1.0 * @since 0.3 * @module */ @@ -55,7 +54,7 @@ import static org.apache.sis.internal.me "scanningResolution", "groundResolution" }) -@XmlRootElement(name = "LE_NominalResolution", namespace = Namespaces.GMI) +@XmlRootElement(name = "LE_NominalResolution") public class DefaultNominalResolution extends ISOMetadata implements NominalResolution { /** * Serial number for inter-operability with different versions. @@ -137,7 +136,7 @@ public class DefaultNominalResolution ex */ @Override @ValueRange(minimum=0, isMinIncluded=false) - @XmlElement(name = "scanningResolution", namespace = Namespaces.GMI, required = true) + @XmlElement(name = "scanningResolution") public Double getScanningResolution() { return scanningResolution; } @@ -164,7 +163,7 @@ public class DefaultNominalResolution ex */ @Override @ValueRange(minimum=0, isMinIncluded=false) - @XmlElement(name = "groundResolution", namespace = Namespaces.GMI, required = true) + @XmlElement(name = "groundResolution") public Double getGroundResolution() { return groundResolution; } Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStep.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStep.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStep.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStep.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -22,8 +22,9 @@ import javax.xml.bind.annotation.XmlType import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; -import org.opengis.annotation.UML; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import org.opengis.util.InternationalString; +import org.opengis.temporal.TemporalPrimitive; import org.opengis.metadata.citation.Citation; import org.opengis.metadata.citation.ResponsibleParty; import org.opengis.metadata.quality.Scope; @@ -34,12 +35,16 @@ import org.opengis.metadata.lineage.Proc import org.apache.sis.metadata.iso.ISOMetadata; import org.apache.sis.metadata.TitleProperty; import org.apache.sis.util.iso.Types; -import org.apache.sis.xml.Namespaces; +import org.apache.sis.internal.jaxb.FilterByVersion; +import org.apache.sis.internal.jaxb.LegacyNamespaces; +import org.apache.sis.internal.jaxb.gml.TM_Primitive; +import org.apache.sis.internal.jaxb.metadata.MD_Scope; +import org.apache.sis.internal.util.TemporalUtilities; +// Branch-specific imports +import org.opengis.annotation.UML; import static org.opengis.annotation.Obligation.OPTIONAL; import static org.opengis.annotation.Specification.ISO_19115; -import static org.apache.sis.internal.metadata.MetadataUtilities.toDate; -import static org.apache.sis.internal.metadata.MetadataUtilities.toMilliseconds; /** @@ -63,7 +68,8 @@ import static org.apache.sis.internal.me * @author Touraïvane (IRD) * @author Cédric Briançon (Geomatys) * @author Rémi Maréchal (Geomatys) - * @version 0.5 + * @author Cullen Rombach (Image Matters) + * @version 1.0 * @since 0.3 * @module */ @@ -72,12 +78,15 @@ import static org.apache.sis.internal.me @XmlType(name = "LI_ProcessStep_Type", propOrder = { "description", "rationale", - "date", + "stepDateTime", // New in ISO 19115:2014 + "date", // Legacy ISO 19115:2003 "processors", + "reference", // New in ISO 19115:2014 + "scope", // New in ISO 19115:2014 "sources", - "outputs", - "processingInformation", - "reports" + "outputs", // ISO 19115-2 extension + "processingInformation", // Ibid. + "reports" // Ibid. }) @XmlRootElement(name = "LI_ProcessStep") @XmlSeeAlso(org.apache.sis.internal.jaxb.gmi.LE_ProcessStep.class) @@ -85,7 +94,7 @@ public class DefaultProcessStep extends /** * Serial number for inter-operability with different versions. */ - private static final long serialVersionUID = -3511714360929580873L; + private static final long serialVersionUID = -2338712901907082970L; /** * Description of the event, including related parameters or tolerances. @@ -98,11 +107,9 @@ public class DefaultProcessStep extends private InternationalString rationale; /** - * Date and time or range of date and time on or over which the process step occurred, - * in milliseconds elapsed since January 1st, 1970. If there is no such date, then this - * field is set to the special value {@link Long#MIN_VALUE}. + * Date, time or range of date and time over which the process step occurred. */ - private long date = Long.MIN_VALUE; + private TemporalPrimitive stepDateTime; /** * Identification of, and means of communication with, person(s) and @@ -171,7 +178,7 @@ public class DefaultProcessStep extends if (object != null) { description = object.getDescription(); rationale = object.getRationale(); - date = toMilliseconds(object.getDate()); + stepDateTime = TemporalUtilities.createInstant(object.getDate()); processors = copyCollection(object.getProcessors(), ResponsibleParty.class); sources = copyCollection(object.getSources(), Source.class); outputs = copyCollection(object.getOutputs(), Source.class); @@ -252,24 +259,54 @@ public class DefaultProcessStep extends } /** + * Returns the date, time or range of date and time over which the process step occurred. + * + * @return date, time or period over which the process step occurred, or {@code null}. + * + * @since 1.0 + */ + @XmlElement(name = "stepDateTime") + @XmlJavaTypeAdapter(TM_Primitive.Since2014.class) + public TemporalPrimitive getStepDateTime() { + return stepDateTime; + } + + /** + * Sets the date, time or range of date and time over which the process step occurred. + * + * @param newValue the new date, time or period. + * + * @since 1.0 + */ + public void setStepDateTime(final TemporalPrimitive newValue) { + checkWritePermission(); + stepDateTime = newValue; + } + + /** * Returns the date and time or range of date and time on or over which the process step occurred. * * @return date on or over which the process step occurred, or {@code null}. + * + * @deprecated As of ISO 19115-1:2014, replaced by {@link #getStepDateTime()}. */ @Override - @XmlElement(name = "dateTime") + @Deprecated + @XmlElement(name = "dateTime", namespace = LegacyNamespaces.GMD) public Date getDate() { - return toDate(date); + return FilterByVersion.LEGACY_METADATA.accept() ? TemporalUtilities.getDate(getStepDateTime()) : null; } /** * Sets the date and time or range of date and time on or over which the process step occurred. * * @param newValue the new date. + * + * @deprecated As of ISO 19115-1:2014, replaced by {@link #setStepDateTime(TemporalPrimitive)}. */ + @Deprecated public void setDate(final Date newValue) { - checkWritePermission(); - date = toMilliseconds(newValue); + setStepDateTime(TemporalUtilities.createInstant(newValue)); } /** @@ -311,7 +348,7 @@ public class DefaultProcessStep extends * * @since 0.5 */ -/// @XmlElement(name = "reference") + // @XmlElement at the end of this class. @UML(identifier="reference", obligation=OPTIONAL, specification=ISO_19115) public Collection<Citation> getReferences() { return references = nonNullCollection(references, Citation.class); @@ -335,7 +372,8 @@ public class DefaultProcessStep extends * * @since 0.5 */ -/// @XmlElement(name = "scope") + @XmlElement(name = "scope") + @XmlJavaTypeAdapter(MD_Scope.Since2014.class) @UML(identifier="scope", obligation=OPTIONAL, specification=ISO_19115) public Scope getScope() { return scope; @@ -379,7 +417,7 @@ public class DefaultProcessStep extends * @return product generated as a result of the process step. */ @Override - @XmlElement(name = "output", namespace = Namespaces.GMI) + @XmlElement(name = "output") public Collection<Source> getOutputs() { return outputs = nonNullCollection(outputs, Source.class); } @@ -401,7 +439,7 @@ public class DefaultProcessStep extends * @return procedure by which the algorithm was applied to derive geographic data, or {@code null}. */ @Override - @XmlElement(name = "processingInformation", namespace = Namespaces.GMI) + @XmlElement(name = "processingInformation") public Processing getProcessingInformation() { return processingInformation; } @@ -424,7 +462,7 @@ public class DefaultProcessStep extends * @return report generated by the process step. */ @Override - @XmlElement(name = "report", namespace = Namespaces.GMI) + @XmlElement(name = "report") public Collection<ProcessStepReport> getReports() { return reports = nonNullCollection(reports, ProcessStepReport.class); } @@ -437,4 +475,28 @@ public class DefaultProcessStep extends public void setReports(final Collection<? extends ProcessStepReport> newValues) { reports = writeCollection(newValues, reports, ProcessStepReport.class); } + + + + + ////////////////////////////////////////////////////////////////////////////////////////////////// + //////// //////// + //////// XML support with JAXB //////// + //////// //////// + //////// The following methods are invoked by JAXB using reflection (even if //////// + //////// they are private) or are helpers for other methods invoked by JAXB. //////// + //////// Those methods can be safely removed if Geographic Markup Language //////// + //////// (GML) support is not needed. //////// + //////// //////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Invoked by JAXB at both marshalling and unmarshalling time. + * This attribute has been added by ISO 19115:2014 standard. + * If (and only if) marshalling an older standard version, we omit this attribute. + */ + @XmlElement(name = "reference") + private Collection<Citation> getReference() { + return FilterByVersion.CURRENT_METADATA.accept() ? getReferences() : null; + } } Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStepReport.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStepReport.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStepReport.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStepReport.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -23,7 +23,6 @@ import org.opengis.metadata.lineage.Proc import org.opengis.util.InternationalString; import org.apache.sis.metadata.iso.ISOMetadata; import org.apache.sis.metadata.TitleProperty; -import org.apache.sis.xml.Namespaces; /** @@ -45,7 +44,7 @@ import org.apache.sis.xml.Namespaces; * @author Cédric Briançon (Geomatys) * @author Guilhem Legal (Geomatys) * @author Martin Desruisseaux (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ @@ -56,7 +55,7 @@ import org.apache.sis.xml.Namespaces; "description", "fileType" }) -@XmlRootElement(name = "LE_ProcessStepReport", namespace = Namespaces.GMI) +@XmlRootElement(name = "LE_ProcessStepReport") public class DefaultProcessStepReport extends ISOMetadata implements ProcessStepReport { /** * Serial number for inter-operability with different versions. @@ -133,7 +132,7 @@ public class DefaultProcessStepReport ex * @return name of the processing report, or {@code null}. */ @Override - @XmlElement(name = "name", namespace = Namespaces.GMI, required = true) + @XmlElement(name = "name", required = true) public InternationalString getName() { return name; } @@ -154,7 +153,7 @@ public class DefaultProcessStepReport ex * @return what occurred during the process step, or {@code null}. */ @Override - @XmlElement(name = "description", namespace = Namespaces.GMI) + @XmlElement(name = "description") public InternationalString getDescription() { return description; } @@ -175,7 +174,7 @@ public class DefaultProcessStepReport ex * @return type of file that contains the processing report, or {@code null}. */ @Override - @XmlElement(name = "fileType", namespace = Namespaces.GMI) + @XmlElement(name = "fileType") public InternationalString getFileType() { return fileType; } Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultProcessing.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultProcessing.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultProcessing.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultProcessing.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -25,7 +25,6 @@ import org.opengis.metadata.citation.Cit import org.opengis.metadata.lineage.Algorithm; import org.opengis.metadata.lineage.Processing; import org.opengis.util.InternationalString; -import org.apache.sis.xml.Namespaces; import org.apache.sis.metadata.iso.ISOMetadata; import org.apache.sis.internal.jaxb.NonMarshalledAuthority; @@ -50,7 +49,7 @@ import org.apache.sis.internal.jaxb.NonM * @author Cédric Briançon (Geomatys) * @author Guilhem Legal (Geomatys) * @author Martin Desruisseaux (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ @@ -63,7 +62,7 @@ import org.apache.sis.internal.jaxb.NonM "runTimeParameters", "algorithms" }) -@XmlRootElement(name = "LE_Processing", namespace = Namespaces.GMI) +@XmlRootElement(name = "LE_Processing") public class DefaultProcessing extends ISOMetadata implements Processing { /** * Serial number for inter-operability with different versions. @@ -154,7 +153,7 @@ public class DefaultProcessing extends I * @return identifier of the processing package that produced the data, or {@code null}. */ @Override - @XmlElement(name = "identifier", namespace = Namespaces.GMI, required = true) + @XmlElement(name = "identifier", required = true) public Identifier getIdentifier() { return NonMarshalledAuthority.getMarshallable(identifiers); } @@ -176,7 +175,7 @@ public class DefaultProcessing extends I * @return document describing processing software. */ @Override - @XmlElement(name = "softwareReference", namespace = Namespaces.GMI) + @XmlElement(name = "softwareReference") public Collection<Citation> getSoftwareReferences() { return softwareReferences = nonNullCollection(softwareReferences, Citation.class); } @@ -196,7 +195,7 @@ public class DefaultProcessing extends I * @return processing procedures, or {@code null}. */ @Override - @XmlElement(name = "procedureDescription", namespace = Namespaces.GMI) + @XmlElement(name = "procedureDescription") public InternationalString getProcedureDescription() { return procedureDescription; } @@ -217,7 +216,7 @@ public class DefaultProcessing extends I * @return documentation describing the processing. */ @Override - @XmlElement(name = "documentation", namespace = Namespaces.GMI) + @XmlElement(name = "documentation") public Collection<Citation> getDocumentations() { return documentations = nonNullCollection(documentations, Citation.class); } @@ -237,7 +236,7 @@ public class DefaultProcessing extends I * @return parameters to control the processing operations, or {@code null}. */ @Override - @XmlElement(name = "runTimeParameters", namespace = Namespaces.GMI) + @XmlElement(name = "runTimeParameters") public InternationalString getRunTimeParameters() { return runTimeParameters; } @@ -259,7 +258,7 @@ public class DefaultProcessing extends I * @return methodology by which geographic information was derived from the instrument readings. */ @Override - @XmlElement(name = "algorithm", namespace = Namespaces.GMI) + @XmlElement(name = "algorithm") public Collection<Algorithm> getAlgorithms() { return algorithms = nonNullCollection(algorithms, Algorithm.class); } Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultSource.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultSource.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultSource.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultSource.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -22,7 +22,7 @@ import javax.xml.bind.annotation.XmlElem import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.bind.annotation.XmlType; -import org.opengis.annotation.UML; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import org.opengis.util.InternationalString; import org.opengis.metadata.Identifier; import org.opengis.metadata.citation.Citation; @@ -38,10 +38,16 @@ import org.apache.sis.metadata.TitleProp import org.apache.sis.metadata.iso.ISOMetadata; import org.apache.sis.metadata.iso.maintenance.DefaultScope; import org.apache.sis.metadata.iso.identification.DefaultResolution; +import org.apache.sis.internal.jaxb.metadata.RS_ReferenceSystem; +import org.apache.sis.internal.jaxb.metadata.MD_Resolution; +import org.apache.sis.internal.jaxb.metadata.MD_Scope; +import org.apache.sis.internal.jaxb.FilterByVersion; +import org.apache.sis.internal.jaxb.LegacyNamespaces; import org.apache.sis.internal.metadata.Dependencies; import org.apache.sis.util.iso.Types; -import org.apache.sis.xml.Namespaces; +// Branch-specific imports +import org.opengis.annotation.UML; import static org.opengis.annotation.Obligation.OPTIONAL; import static org.opengis.annotation.Obligation.CONDITIONAL; import static org.opengis.annotation.Specification.ISO_19115; @@ -80,7 +86,8 @@ import static org.opengis.annotation.Spe * @author Touraïvane (IRD) * @author Cédric Briançon (Geomatys) * @author Rémi Maréchal (Geomatys) - * @version 0.5 + * @author Cullen Rombach (Image Matters) + * @version 1.0 * @since 0.3 * @module */ @@ -88,12 +95,16 @@ import static org.opengis.annotation.Spe @TitleProperty(name = "description") @XmlType(name = "LI_Source_Type", propOrder = { "description", - "scaleDenominator", + "scaleDenominator", // Legacy ISO 19115:2003 + "sourceSpatialResolution", // New in ISO 19115:2014 + "sourceReferenceSystem", // New in ISO 19115:2014 "sourceCitation", - "sourceExtents", + "sources", // New in ISO 19115:2014 (actually "sourceMetadata") + "sourceExtents", // Legacy ISO 19115:2003 + "scope", // New in ISO 19115:2014 "sourceSteps", - "processedLevel", - "resolution" + "processedLevel", // ISO 19115-2 extension + "resolution" // ISO 19115-2 extension }) @XmlRootElement(name = "LI_Source") @XmlSeeAlso(org.apache.sis.internal.jaxb.gmi.LE_Source.class) @@ -245,7 +256,8 @@ public class DefaultSource extends ISOMe * * @since 0.5 */ -/// @XmlElement(name = "sourceSpatialResolution") + @XmlElement(name = "sourceSpatialResolution") + @XmlJavaTypeAdapter(MD_Resolution.Since2014.class) @UML(identifier="sourceSpatialResolution", obligation=OPTIONAL, specification=ISO_19115) public Resolution getSourceSpatialResolution() { return sourceSpatialResolution; @@ -274,11 +286,16 @@ public class DefaultSource extends ISOMe */ @Override @Deprecated - @XmlElement(name = "scaleDenominator") @Dependencies("getSourceSpatialResolution") + @XmlElement(name = "scaleDenominator", namespace = LegacyNamespaces.GMD) public RepresentativeFraction getScaleDenominator() { - final Resolution resolution = getSourceSpatialResolution(); - return (resolution != null) ? resolution.getEquivalentScale() : null; + if (FilterByVersion.LEGACY_METADATA.accept()) { + final Resolution resolution = getSourceSpatialResolution(); + if (resolution != null) { + return resolution.getEquivalentScale(); + } + } + return null; } /** @@ -315,11 +332,10 @@ public class DefaultSource extends ISOMe * Returns the spatial reference system used by the source data. * * @return spatial reference system used by the source data, or {@code null}. - * - * @todo We need to annotate the referencing module before we can annotate this method. */ @Override -/// @XmlElement(name = "sourceReferenceSystem") + @XmlElement(name = "sourceReferenceSystem") + @XmlJavaTypeAdapter(RS_ReferenceSystem.Since2014.class) public ReferenceSystem getSourceReferenceSystem() { return sourceReferenceSystem; } @@ -362,7 +378,7 @@ public class DefaultSource extends ISOMe * * @since 0.5 */ -/// @XmlElement(name = "sourceMetadata") + // @XmlElement at the end of this class. @UML(identifier="sourceMetadata", obligation=OPTIONAL, specification=ISO_19115) public Collection<Citation> getSourceMetadata() { return sourceMetadata = nonNullCollection(sourceMetadata, Citation.class); @@ -387,7 +403,8 @@ public class DefaultSource extends ISOMe * * @since 0.5 */ -/// @XmlElement(name = "scope") + @XmlElement(name = "scope") + @XmlJavaTypeAdapter(MD_Scope.Since2014.class) @UML(identifier="scope", obligation=CONDITIONAL, specification=ISO_19115) public Scope getScope() { return scope; @@ -415,19 +432,21 @@ public class DefaultSource extends ISOMe */ @Override @Deprecated - @XmlElement(name = "sourceExtent") @Dependencies("getScope") + @XmlElement(name = "sourceExtent", namespace = LegacyNamespaces.GMD) public Collection<Extent> getSourceExtents() { - Scope scope = getScope(); - if (!(scope instanceof DefaultScope)) { - if (isModifiable()) { - scope = new DefaultScope(scope); - this.scope = scope; - } else { - return Collections.singleton(scope.getExtent()); + if (FilterByVersion.LEGACY_METADATA.accept()) { + Scope scope = getScope(); + if (!(scope instanceof DefaultScope)) { + if (isModifiable()) { + scope = new DefaultScope(scope); + this.scope = scope; + } else { + return Collections.singleton(scope.getExtent()); + } } } - return ((DefaultScope) scope).getExtents(); + return null; } /** @@ -475,7 +494,7 @@ public class DefaultSource extends ISOMe * @return processing level of the source data, or {@code null}. */ @Override - @XmlElement(name = "processedLevel", namespace = Namespaces.GMI) + @XmlElement(name = "processedLevel") public Identifier getProcessedLevel() { return processedLevel; } @@ -496,7 +515,7 @@ public class DefaultSource extends ISOMe * @return distance between consistent parts of two adjacent pixels, or {@code null}. */ @Override - @XmlElement(name = "resolution", namespace = Namespaces.GMI) + @XmlElement(name = "resolution") public NominalResolution getResolution() { return resolution; } @@ -510,4 +529,28 @@ public class DefaultSource extends ISOMe checkWritePermission(); resolution = newValue; } + + + + + ////////////////////////////////////////////////////////////////////////////////////////////////// + //////// //////// + //////// XML support with JAXB //////// + //////// //////// + //////// The following methods are invoked by JAXB using reflection (even if //////// + //////// they are private) or are helpers for other methods invoked by JAXB. //////// + //////// Those methods can be safely removed if Geographic Markup Language //////// + //////// (GML) support is not needed. //////// + //////// //////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Invoked by JAXB at both marshalling and unmarshalling time. + * This attribute has been added by ISO 19115:2014 standard. + * If (and only if) marshalling an older standard version, we omit this attribute. + */ + @XmlElement(name = "sourceMetadata") + private Collection<Citation> getSources() { + return FilterByVersion.CURRENT_METADATA.accept() ? getSourceMetadata() : null; + } } Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/package-info.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/package-info.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/package-info.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/package-info.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -65,21 +65,25 @@ * @author Martin Desruisseaux (IRD, Geomatys) * @author Touraïvane (IRD) * @author Cédric Briançon (Geomatys) - * @version 0.5 + * @author Cullen Rombach (Image Matters) + * @version 1.0 * @since 0.3 * @module */ -@XmlSchema(location=Schemas.METADATA_XSD, elementFormDefault=XmlNsForm.QUALIFIED, namespace=Namespaces.GMD, xmlns = { - @XmlNs(prefix = "gmi", namespaceURI = Namespaces.GMI), - @XmlNs(prefix = "gmd", namespaceURI = Namespaces.GMD), - @XmlNs(prefix = "gco", namespaceURI = Namespaces.GCO), - @XmlNs(prefix = "xsi", namespaceURI = Namespaces.XSI) +@XmlSchema(location="http://standards.iso.org/iso/19115/-3/mrl/1.0/mrl.xsd", + elementFormDefault=XmlNsForm.QUALIFIED, namespace=Namespaces.MRL, + xmlns = { + @XmlNs(prefix = "mrl", namespaceURI = Namespaces.MRL), // Metadata for Resource Lineage + @XmlNs(prefix = "mcc", namespaceURI = Namespaces.MCC), // Metadata Common Classes + @XmlNs(prefix = "gmd", namespaceURI = LegacyNamespaces.GMD) }) @XmlAccessorType(XmlAccessType.NONE) @XmlJavaTypeAdapters({ @XmlJavaTypeAdapter(CI_Citation.class), @XmlJavaTypeAdapter(CI_ResponsibleParty.class), @XmlJavaTypeAdapter(EX_Extent.class), + @XmlJavaTypeAdapter(GO_Real.class), + @XmlJavaTypeAdapter(GO_DateTime.class), @XmlJavaTypeAdapter(LE_Algorithm.class), @XmlJavaTypeAdapter(LE_NominalResolution.class), @XmlJavaTypeAdapter(LE_Processing.class), @@ -90,7 +94,6 @@ @XmlJavaTypeAdapter(MD_RepresentativeFraction.class), // Java types, primitive types and basic OGC types handling - @XmlJavaTypeAdapter(GO_DateTime.class), @XmlJavaTypeAdapter(InternationalStringAdapter.class) }) package org.apache.sis.metadata.iso.lineage; @@ -104,6 +107,6 @@ import javax.xml.bind.annotation.adapter import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters; import org.apache.sis.xml.Namespaces; -import org.apache.sis.internal.jaxb.Schemas; +import org.apache.sis.internal.jaxb.LegacyNamespaces; import org.apache.sis.internal.jaxb.gco.*; import org.apache.sis.internal.jaxb.metadata.*; Added: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/AttributeTypeAdapter.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/AttributeTypeAdapter.java?rev=1825355&view=auto ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/AttributeTypeAdapter.java (added) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/AttributeTypeAdapter.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -0,0 +1,52 @@ +/* + * 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.maintenance; + +import javax.xml.bind.annotation.adapters.XmlAdapter; +import org.opengis.feature.type.AttributeType; +import org.apache.sis.internal.jaxb.gco.GO_CharacterString; + + +/** + * For (un)marshalling deprecated {@link AttributeType} as a character string, + * as expected by ISO 19115-3:2016. This is a temporary bridge to be removed + * after the GeoAPI interfaces has been upgraded to ISO 19115-1:2014 model. + * + * @author Martin Desruisseaux (Geomatys) + * @version 1.0 + * @since 1.0 + * @module + */ +final class AttributeTypeAdapter extends XmlAdapter<GO_CharacterString, AttributeType> { + /** + * Wrap the given value from {@link DefaultScopeDescription} to the elements + * defined by ISO 19115-3:2016 schema. + */ + @Override + public AttributeType unmarshal(GO_CharacterString value) { + return new LegacyType(LegacyType.ADAPTER.unmarshal(value)); + } + + /** + * Unwrap the elements defined by ISO 19115-3:2016 schema to the value used by + * {@link DefaultScopeDescription}. + */ + @Override + public GO_CharacterString marshal(AttributeType value) { + return LegacyType.ADAPTER.marshal(LegacyType.wrap(value)); + } +} Propchange: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/AttributeTypeAdapter.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/AttributeTypeAdapter.java ------------------------------------------------------------------------------ svn:mime-type = text/plain;charset=UTF-8 Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -23,7 +23,6 @@ import java.util.Collections; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; -import org.opengis.annotation.UML; import org.opengis.metadata.citation.DateType; import org.opengis.metadata.citation.CitationDate; import org.opengis.metadata.citation.ResponsibleParty; @@ -38,7 +37,11 @@ import org.apache.sis.metadata.iso.ISOMe import org.apache.sis.metadata.iso.citation.DefaultCitationDate; import org.apache.sis.internal.metadata.LegacyPropertyAdapter; import org.apache.sis.internal.metadata.Dependencies; +import org.apache.sis.internal.jaxb.FilterByVersion; +import org.apache.sis.internal.jaxb.LegacyNamespaces; +// Branch-specific imports +import org.opengis.annotation.UML; import static org.opengis.annotation.Obligation.OPTIONAL; import static org.opengis.annotation.Specification.ISO_19115; @@ -64,17 +67,20 @@ import static org.opengis.annotation.Spe * @author Cédric Briançon (Geomatys) * @author Guilhem Legal (Geomatys) * @author Rémi Maréchal (Geomatys) - * @version 0.5 + * @author Cullen Rombach (Image Matters) + * @version 1.0 * @since 0.3 * @module */ @SuppressWarnings("CloneableClassWithoutClone") // ModifiableMetadata needs shallow clones. @XmlType(name = "MD_MaintenanceInformation_Type", propOrder = { "maintenanceAndUpdateFrequency", - "dateOfNextUpdate", + "maintenanceDate", // New in ISO 19115:2014 + "dateOfNextUpdate", // Legacy ISO 19115:2003 "userDefinedMaintenanceFrequency", - "updateScopes", - "updateScopeDescriptions", + "maintenanceScope", // New in ISO 19115:2014 - contains information from the two below + "updateScopes", // Legacy ISO 19115:2003 + "updateScopeDescriptions", // Legacy ISO 19115:2003 "maintenanceNotes", "contacts" }) @@ -198,7 +204,7 @@ public class DefaultMaintenanceInformati * @return frequency with which changes and additions are made to the resource, or {@code null}. */ @Override - @XmlElement(name = "maintenanceAndUpdateFrequency", required = true) + @XmlElement(name = "maintenanceAndUpdateFrequency") public MaintenanceFrequency getMaintenanceAndUpdateFrequency() { return maintenanceAndUpdateFrequency; } @@ -221,7 +227,7 @@ public class DefaultMaintenanceInformati * * @since 0.5 */ -/// @XmlElement(name = "maintenanceDate", required = true) + // @XmlElement at the end of this class. @UML(identifier="maintenanceDate", obligation=OPTIONAL, specification=ISO_19115) public Collection<CitationDate> getMaintenanceDates() { return maintenanceDates = nonNullCollection(maintenanceDates, CitationDate.class); @@ -250,14 +256,16 @@ public class DefaultMaintenanceInformati */ @Override @Deprecated - @XmlElement(name = "dateOfNextUpdate") @Dependencies("getMaintenanceDates") + @XmlElement(name = "dateOfNextUpdate", namespace = LegacyNamespaces.GMD) public Date getDateOfNextUpdate() { - final Collection<CitationDate> dates = getMaintenanceDates(); - if (dates != null) { // May be null on XML marshalling. - for (final CitationDate date : dates) { - if (NEXT_UPDATE.equals(date.getDateType())) { - return date.getDate(); + if (FilterByVersion.LEGACY_METADATA.accept()) { + final Collection<CitationDate> dates = getMaintenanceDates(); + if (dates != null) { // May be null on XML marshalling. + for (final CitationDate date : dates) { + if (NEXT_UPDATE.equals(date.getDateType())) { + return date.getDate(); + } } } } @@ -328,7 +336,7 @@ public class DefaultMaintenanceInformati * * @since 0.5 */ -/// @XmlElement(name = "maintenanceScope") + // @XmlElement at the end of this class. @UML(identifier="maintenanceScope", obligation=OPTIONAL, specification=ISO_19115) public Collection<Scope> getMaintenanceScopes() { return maintenanceScopes = nonNullCollection(maintenanceScopes, Scope.class); @@ -357,9 +365,10 @@ public class DefaultMaintenanceInformati */ @Override @Deprecated - @XmlElement(name = "updateScope") @Dependencies("getMaintenanceScopes") + @XmlElement(name = "updateScope", namespace = LegacyNamespaces.GMD) public final Collection<ScopeCode> getUpdateScopes() { + if (!FilterByVersion.LEGACY_METADATA.accept()) return null; return new LegacyPropertyAdapter<ScopeCode,Scope>(getMaintenanceScopes()) { /** Stores a legacy value into the new kind of value. */ @Override protected Scope wrap(final ScopeCode value) { @@ -408,9 +417,10 @@ public class DefaultMaintenanceInformati */ @Override @Deprecated - @XmlElement(name = "updateScopeDescription") @Dependencies("getMaintenanceScopes") + @XmlElement(name = "updateScopeDescription", namespace = LegacyNamespaces.GMD) public final Collection<ScopeDescription> getUpdateScopeDescriptions() { + if (!FilterByVersion.LEGACY_METADATA.accept()) return null; return new LegacyPropertyAdapter<ScopeDescription,Scope>(getMaintenanceScopes()) { /** Stores a legacy value into the new kind of value. */ @Override protected Scope wrap(final ScopeDescription value) { @@ -503,4 +513,33 @@ public class DefaultMaintenanceInformati public void setContacts(final Collection<? extends ResponsibleParty> newValues) { contacts = writeCollection(newValues, contacts, ResponsibleParty.class); } + + + + + ////////////////////////////////////////////////////////////////////////////////////////////////// + //////// //////// + //////// XML support with JAXB //////// + //////// //////// + //////// The following methods are invoked by JAXB using reflection (even if //////// + //////// they are private) or are helpers for other methods invoked by JAXB. //////// + //////// Those methods can be safely removed if Geographic Markup Language //////// + //////// (GML) support is not needed. //////// + //////// //////// + ////////////////////////////////////////////////////////////////////////////////////////////////// + + /** + * Invoked by JAXB at both marshalling and unmarshalling time. + * This attribute has been added by ISO 19115:2014 standard. + * If (and only if) marshalling an older standard version, we omit this attribute. + */ + @XmlElement(name = "maintenanceDate") + private Collection<CitationDate> getMaintenanceDate() { + return FilterByVersion.CURRENT_METADATA.accept() ? getMaintenanceDates() : null; + } + + @XmlElement(name = "maintenanceScope") + private Collection<Scope> getMaintenanceScope() { + return FilterByVersion.CURRENT_METADATA.accept() ? getMaintenanceScopes() : null; + } } Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultScope.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultScope.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultScope.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultScope.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -20,7 +20,6 @@ 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.annotation.UML; import org.opengis.metadata.extent.Extent; import org.opengis.metadata.quality.Scope; import org.opengis.metadata.maintenance.ScopeCode; @@ -28,7 +27,10 @@ import org.opengis.metadata.maintenance. import org.apache.sis.internal.metadata.Dependencies; import org.apache.sis.internal.metadata.LegacyPropertyAdapter; import org.apache.sis.metadata.iso.ISOMetadata; +import org.apache.sis.xml.Namespaces; +// Branch-specific imports +import org.opengis.annotation.UML; import static org.opengis.annotation.Obligation.OPTIONAL; import static org.opengis.annotation.Specification.ISO_19115; @@ -59,17 +61,18 @@ import static org.opengis.annotation.Spe * * @author Martin Desruisseaux (IRD, Geomatys) * @author Touraïvane (IRD) - * @version 0.5 + * @author Cullen Rombach (Image Matters) + * @version 1.0 * @since 0.3 * @module */ @SuppressWarnings("CloneableClassWithoutClone") // ModifiableMetadata needs shallow clones. -@XmlType(name = "DQ_Scope_Type", propOrder = { +@XmlType(name = "MD_Scope_Type", namespace = Namespaces.MCC, propOrder = { "level", "extents", "levelDescription" }) -@XmlRootElement(name = "DQ_Scope") +@XmlRootElement(name = "MD_Scope", namespace = Namespaces.MCC) public class DefaultScope extends ISOMetadata implements Scope { /** * Serial number for inter-operability with different versions. Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultScopeDescription.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultScopeDescription.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultScopeDescription.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/DefaultScopeDescription.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -30,6 +30,7 @@ import org.apache.sis.internal.jaxb.Cont import org.apache.sis.internal.system.Semaphores; import org.apache.sis.util.collection.CheckedContainer; import org.apache.sis.util.resources.Messages; +import org.apache.sis.xml.Namespaces; import static org.apache.sis.util.collection.Containers.isNullOrEmpty; @@ -67,13 +68,14 @@ import org.opengis.feature.type.FeatureT * @author Martin Desruisseaux (IRD, Geomatys) * @author Touraïvane (IRD) * @author Cédric Briançon (Geomatys) - * @version 0.5 + * @author Cullen Rombach (Image Matters) + * @version 1.0 * @since 0.3 * @module */ @SuppressWarnings("CloneableClassWithoutClone") // ModifiableMetadata needs shallow clones. -@XmlType(name = "MD_ScopeDescription_Type") // No need for propOrder since this structure is a union (see javadoc). -@XmlRootElement(name = "MD_ScopeDescription") +@XmlType(name = "MD_ScopeDescription_Type", namespace = Namespaces.MCC) // No need for propOrder since this structure is a union (see javadoc). +@XmlRootElement(name = "MD_ScopeDescription", namespace = Namespaces.MCC) public class DefaultScopeDescription extends ISOMetadata implements ScopeDescription { /** * Serial number for inter-operability with different versions. @@ -337,6 +339,7 @@ public class DefaultScopeDescription ext * @return feature types to which the information applies. */ @Override + @XmlElement(name = "features") public Set<FeatureType> getFeatures() { return getProperty(FeatureType.class, FEATURES); } @@ -378,6 +381,7 @@ public class DefaultScopeDescription ext * @return attribute types to which the information applies. */ @Override + @XmlElement(name = "attributes") public Set<AttributeType> getAttributes() { return getProperty(AttributeType.class, ATTRIBUTES); } @@ -419,6 +423,7 @@ public class DefaultScopeDescription ext * @return feature instances to which the information applies. */ @Override + @XmlElement(name = "featureInstances") public Set<FeatureType> getFeatureInstances() { return getProperty(FeatureType.class, FEATURE_INSTANCES); } @@ -460,6 +465,7 @@ public class DefaultScopeDescription ext * @return attribute instances to which the information applies. */ @Override + @XmlElement(name = "attributeInstances") public Set<AttributeType> getAttributeInstances() { return getProperty(AttributeType.class, ATTRIBUTE_INSTANCES); } Added: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/FeatureTypeAdapter.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/FeatureTypeAdapter.java?rev=1825355&view=auto ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/FeatureTypeAdapter.java (added) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/FeatureTypeAdapter.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -0,0 +1,52 @@ +/* + * 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.maintenance; + +import javax.xml.bind.annotation.adapters.XmlAdapter; +import org.opengis.feature.type.FeatureType; +import org.apache.sis.internal.jaxb.gco.GO_CharacterString; + + +/** + * For (un)marshalling deprecated {@link FeatureType} as a character string, + * as expected by ISO 19115-3:2016. This is a temporary bridge to be removed + * after the GeoAPI interfaces has been upgraded to ISO 19115-1:2014 model. + * + * @author Martin Desruisseaux (Geomatys) + * @version 1.0 + * @since 1.0 + * @module + */ +final class FeatureTypeAdapter extends XmlAdapter<GO_CharacterString, FeatureType> { + /** + * Wrap the given value from {@link DefaultScopeDescription} to the elements + * defined by ISO 19115-3:2016 schema. + */ + @Override + public FeatureType unmarshal(GO_CharacterString value) { + return new LegacyType(LegacyType.ADAPTER.unmarshal(value)); + } + + /** + * Unwrap the elements defined by ISO 19115-3:2016 schema to the value used by + * {@link DefaultScopeDescription}. + */ + @Override + public GO_CharacterString marshal(FeatureType value) { + return LegacyType.ADAPTER.marshal(LegacyType.wrap(value)); + } +} Propchange: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/FeatureTypeAdapter.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/FeatureTypeAdapter.java ------------------------------------------------------------------------------ svn:mime-type = text/plain;charset=UTF-8 Added: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/LegacyType.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/LegacyType.java?rev=1825355&view=auto ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/LegacyType.java (added) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/LegacyType.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -0,0 +1,70 @@ +/* + * 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.maintenance; + +import org.opengis.feature.type.FeatureType; +import org.opengis.feature.type.AttributeType; +import org.apache.sis.internal.jaxb.gco.CharSequenceAdapter; + + +/** + * Bridges between deprecated {@link FeatureType} / {@link AttributeType} and {@link CharSequence}. + * {@code FeatureType} and {@code AttributeType} were used in ISO 19115:2003, but have been replaced + * by {@link CharSequence} in ISO 19115:2014. The corresponding GeoAPI 3.0 interfaces are empty since + * they were placeholder for future work. We use this {@code LegacyType} as a temporary bridge, to be + * removed with GeoAPI 4.0. + * + * @author Martin Desruisseaux (Geomatys) + * @version 1.0 + * @since 1.0 + * @module + */ +final class LegacyType implements FeatureType, AttributeType, CharSequence { + /** + * The adapter doing most of the actual work of converting {@code FeatureType} or {@code AttributeType} + * to {@code <gco:CharacterSequence>} elements. + */ + static final CharSequenceAdapter ADAPTER = new CharSequenceAdapter(); + + /** + * The value to wrap as a {@code FeatureType} or {@code AttributeType}. + */ + private final CharSequence value; + + /** + * Creates a new type for the given value, which must be non-null. + */ + LegacyType(final CharSequence value) { + this.value = value; + } + + /** + * Wraps the given {@code FeatureType} or {@code AttributeType} as a {@code CharSequence}. + */ + static CharSequence wrap(final Object value) { + return (value == null || value instanceof CharSequence) + ? (CharSequence) value : new LegacyType(value.toString()); + } + + /** + * Delegates to the value given at construction time. + */ + @Override public int length() {return value.length();} + @Override public char charAt(int index) {return value.charAt(index);} + @Override public CharSequence subSequence(int start, int end) {return value.subSequence(start, end);} + @Override public String toString() {return value.toString();} +} Propchange: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/LegacyType.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/LegacyType.java ------------------------------------------------------------------------------ svn:mime-type = text/plain;charset=UTF-8 Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/package-info.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/package-info.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/package-info.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/package-info.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -62,28 +62,35 @@ * @author Martin Desruisseaux (IRD, Geomatys) * @author Touraïvane (IRD) * @author Cédric Briançon (Geomatys) - * @version 0.5 + * @author Cullen Rombach (Image Matters) + * @version 1.0 * @since 0.3 * @module */ -@XmlSchema(location=Schemas.METADATA_XSD, elementFormDefault=XmlNsForm.QUALIFIED, namespace=Namespaces.GMD, xmlns = { - @XmlNs(prefix = "gmd", namespaceURI = Namespaces.GMD), - @XmlNs(prefix = "gco", namespaceURI = Namespaces.GCO), - @XmlNs(prefix = "xsi", namespaceURI = Namespaces.XSI) +@XmlSchema(location="http://standards.iso.org/iso/19115/-3/mmi/1.0/mmi.xsd", + elementFormDefault=XmlNsForm.QUALIFIED, namespace=Namespaces.MMI, + xmlns = { + @XmlNs(prefix = "mmi", namespaceURI = Namespaces.MMI), // Metadata for Maintenance Information + @XmlNs(prefix = "mcc", namespaceURI = Namespaces.MCC), // Metadata Common Classes + @XmlNs(prefix = "gmd", namespaceURI = LegacyNamespaces.GMD) }) @XmlAccessorType(XmlAccessType.NONE) @XmlJavaTypeAdapters({ - @XmlJavaTypeAdapter(EX_Extent.class), + @XmlJavaTypeAdapter(CI_Date.class), @XmlJavaTypeAdapter(CI_ResponsibleParty.class), + @XmlJavaTypeAdapter(EX_Extent.class), + @XmlJavaTypeAdapter(GO_DateTime.class), @XmlJavaTypeAdapter(MD_MaintenanceFrequencyCode.class), - @XmlJavaTypeAdapter(MD_MaintenanceInformation.class), + @XmlJavaTypeAdapter(MD_Scope.class), @XmlJavaTypeAdapter(MD_ScopeCode.class), @XmlJavaTypeAdapter(MD_ScopeDescription.class), @XmlJavaTypeAdapter(TM_PeriodDuration.class), // Java types, primitive types and basic OGC types handling - @XmlJavaTypeAdapter(GO_DateTime.class), + @XmlJavaTypeAdapter(FeatureTypeAdapter.class), + @XmlJavaTypeAdapter(AttributeTypeAdapter.class), @XmlJavaTypeAdapter(StringAdapter.class), + @XmlJavaTypeAdapter(CharSequenceAdapter.class), @XmlJavaTypeAdapter(InternationalStringAdapter.class) }) package org.apache.sis.metadata.iso.maintenance; @@ -97,7 +104,7 @@ import javax.xml.bind.annotation.adapter import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters; import org.apache.sis.xml.Namespaces; -import org.apache.sis.internal.jaxb.Schemas; +import org.apache.sis.internal.jaxb.LegacyNamespaces; import org.apache.sis.internal.jaxb.gco.*; import org.apache.sis.internal.jaxb.code.*; import org.apache.sis.internal.jaxb.gts.TM_PeriodDuration; Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/package-info.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/package-info.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/package-info.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/package-info.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -56,7 +56,7 @@ * </td></tr></table> * * <div class="section">Localization</div> - * When a metadata object is marshalled as an ISO 19139 compliant XML document, the marshaller + * When a metadata object is marshalled as an ISO 19115-3 compliant XML document, the marshaller * {@link org.apache.sis.xml.XML#LOCALE} property will be used for the localization of every * {@link org.opengis.util.InternationalString} and {@link org.opengis.util.CodeList} instances, * <strong>except</strong> if the object to be marshalled is an instance of @@ -81,47 +81,55 @@ * @author Martin Desruisseaux (IRD, Geomatys) * @author Touraïvane (IRD) * @author Cédric Briançon (Geomatys) - * @version 0.5 + * @author Cullen Rombach (Image Matters) + * @version 1.0 * @since 0.3 * @module */ -@XmlSchema(location=Schemas.METADATA_XSD, elementFormDefault=XmlNsForm.QUALIFIED, namespace=Namespaces.GMD, xmlns = { - @XmlNs(prefix = "gmi", namespaceURI = Namespaces.GMI), - @XmlNs(prefix = "gmd", namespaceURI = Namespaces.GMD), - @XmlNs(prefix = "gco", namespaceURI = Namespaces.GCO), - @XmlNs(prefix = "xsi", namespaceURI = Namespaces.XSI) +@XmlSchema(location="http://standards.iso.org/iso/19115/-3/mdb/1.0/mdb.xsd", + elementFormDefault=XmlNsForm.QUALIFIED, namespace=Namespaces.MDB, + xmlns = { + @XmlNs(prefix = "mdb", namespaceURI = Namespaces.MDB), // Metadata Base + @XmlNs(prefix = "mpc", namespaceURI = Namespaces.MPC), // Metadata for Portrayal Catalog + @XmlNs(prefix = "mas", namespaceURI = Namespaces.MAS), // Metadata for Application Schema + @XmlNs(prefix = "mex", namespaceURI = Namespaces.MEX), // Metadata with Schema Extensions + @XmlNs(prefix = "lan", namespaceURI = Namespaces.LAN), // Language localization + @XmlNs(prefix = "mcc", namespaceURI = Namespaces.MCC), // Metadata Common Classes + @XmlNs(prefix = "dqc", namespaceURI = Namespaces.DQC), // Data Quality Common Classes + @XmlNs(prefix = "gmd", namespaceURI = LegacyNamespaces.GMD) }) @XmlAccessorType(XmlAccessType.NONE) @XmlJavaTypeAdapters({ @XmlJavaTypeAdapter(CI_Citation.class), + @XmlJavaTypeAdapter(CI_Date.class), @XmlJavaTypeAdapter(CI_OnlineResource.class), @XmlJavaTypeAdapter(CI_ResponsibleParty.class), @XmlJavaTypeAdapter(DQ_DataQuality.class), + @XmlJavaTypeAdapter(GO_DateTime.class), + @XmlJavaTypeAdapter(GO_Integer.class), + @XmlJavaTypeAdapter(LI_Lineage.class), @XmlJavaTypeAdapter(MD_ApplicationSchemaInformation.class), - @XmlJavaTypeAdapter(MD_CharacterSetCode.class), + @XmlJavaTypeAdapter(MD_CharacterSetLegacy.class), @XmlJavaTypeAdapter(MD_Constraints.class), @XmlJavaTypeAdapter(MD_ContentInformation.class), @XmlJavaTypeAdapter(MD_DatatypeCode.class), @XmlJavaTypeAdapter(MD_Distribution.class), @XmlJavaTypeAdapter(MD_ExtendedElementInformation.class), - @XmlJavaTypeAdapter(MD_FeatureTypeList.class), @XmlJavaTypeAdapter(MD_Identification.class), @XmlJavaTypeAdapter(MD_MaintenanceInformation.class), @XmlJavaTypeAdapter(MD_MetadataExtensionInformation.class), + @XmlJavaTypeAdapter(MD_MetadataScope.class), @XmlJavaTypeAdapter(MD_ObligationCode.class), @XmlJavaTypeAdapter(MD_PortrayalCatalogueReference.class), @XmlJavaTypeAdapter(MD_ScopeCode.class), @XmlJavaTypeAdapter(MD_SpatialRepresentation.class), @XmlJavaTypeAdapter(MI_AcquisitionInformation.class), + @XmlJavaTypeAdapter(PT_Locale.class), @XmlJavaTypeAdapter(RS_ReferenceSystem.class), // Java types, primitive types and basic OGC types handling - @XmlJavaTypeAdapter(LocaleAdapter.class), @XmlJavaTypeAdapter(StringAdapter.class), - @XmlJavaTypeAdapter(InternationalStringAdapter.class), - @XmlJavaTypeAdapter(GO_DateTime.class), - @XmlJavaTypeAdapter(GO_Boolean.class), @XmlJavaTypeAdapter(type=boolean.class, value=GO_Boolean.class), - @XmlJavaTypeAdapter(GO_Integer.class), @XmlJavaTypeAdapter(type=int.class, value=GO_Integer.class) + @XmlJavaTypeAdapter(InternationalStringAdapter.class) }) package org.apache.sis.metadata.iso; @@ -133,8 +141,7 @@ import javax.xml.bind.annotation.XmlAcce import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters; import org.apache.sis.xml.Namespaces; -import org.apache.sis.internal.jaxb.Schemas; +import org.apache.sis.internal.jaxb.LegacyNamespaces; import org.apache.sis.internal.jaxb.gco.*; -import org.apache.sis.internal.jaxb.gmd.*; import org.apache.sis.internal.jaxb.code.*; import org.apache.sis.internal.jaxb.metadata.*; Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractCompleteness.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractCompleteness.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractCompleteness.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractCompleteness.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -42,13 +42,13 @@ import org.opengis.metadata.quality.Comp * * @author Martin Desruisseaux (IRD, Geomatys) * @author Touraïvane (IRD) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ @SuppressWarnings("CloneableClassWithoutClone") // ModifiableMetadata needs shallow clones. @XmlType(name = "AbstractDQ_Completeness_Type") -@XmlRootElement(name = "DQ_Completeness") +@XmlRootElement(name = "AbstractDQ_Completeness") @XmlSeeAlso({ DefaultCompletenessCommission.class, DefaultCompletenessOmission.class Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractElement.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -39,8 +39,11 @@ import org.opengis.metadata.quality.Eval 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.jaxb.LegacyNamespaces; import org.apache.sis.util.collection.CheckedContainer; import org.apache.sis.util.resources.Errors; +import org.apache.sis.xml.Namespaces; import static org.apache.sis.util.collection.Containers.isNullOrEmpty; @@ -64,7 +67,7 @@ import static org.apache.sis.util.collec * @author Martin Desruisseaux (IRD, Geomatys) * @author Touraïvane (IRD) * @author Guilhem Legal (Geomatys) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ @@ -79,7 +82,7 @@ import static org.apache.sis.util.collec "dates", "results" }) -@XmlRootElement(name = "DQ_Element") +@XmlRootElement(name = "AbstractDQ_Element") @XmlSeeAlso({ AbstractCompleteness.class, AbstractLogicalConsistency.class, @@ -390,10 +393,13 @@ public class AbstractElement extends ISO * 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") + @XmlElement(name = "nameOfMeasure", namespace = LegacyNamespaces.GMD) public Collection<InternationalString> getNamesOfMeasure() { + if (!FilterByVersion.LEGACY_METADATA.accept()) return null; return namesOfMeasure = nonNullCollection(namesOfMeasure, InternationalString.class); } @@ -410,11 +416,13 @@ public class AbstractElement extends ISO * Returns the code identifying a registered standard procedure, or {@code null} if none. * * @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> */ @Override - @XmlElement(name = "measureIdentification") + @XmlElement(name = "measureIdentification", namespace = LegacyNamespaces.GMD) public Identifier getMeasureIdentification() { - return measureIdentification; + return FilterByVersion.LEGACY_METADATA.accept() ? measureIdentification : null; } /** @@ -431,11 +439,13 @@ public class AbstractElement extends ISO * 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") + @XmlElement(name = "measureDescription", namespace = LegacyNamespaces.GMD) public InternationalString getMeasureDescription() { - return measureDescription; + return FilterByVersion.LEGACY_METADATA.accept() ? measureDescription : null; } /** @@ -452,11 +462,13 @@ public class AbstractElement extends ISO * 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") + @XmlElement(name = "evaluationMethodType", namespace = LegacyNamespaces.GMD) public EvaluationMethodType getEvaluationMethodType() { - return evaluationMethodType; + return FilterByVersion.LEGACY_METADATA.accept() ? evaluationMethodType : null; } /** @@ -473,11 +485,13 @@ public class AbstractElement extends ISO * 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> */ @Override - @XmlElement(name = "evaluationMethodDescription") + @XmlElement(name = "evaluationMethodDescription", namespace = LegacyNamespaces.GMD) public InternationalString getEvaluationMethodDescription() { - return evaluationMethodDescription; + return FilterByVersion.LEGACY_METADATA.accept() ? evaluationMethodDescription : null; } /** @@ -494,11 +508,13 @@ public class AbstractElement extends ISO * Returns the reference to the procedure information, or {@code null} if none. * * @return reference to the procedure information, or {@code null}. + * + * @see <a href="https://issues.apache.org/jira/browse/SIS-394">Issue SIS-394</a> */ @Override - @XmlElement(name = "evaluationProcedure") + @XmlElement(name = "evaluationProcedure", namespace = LegacyNamespaces.GMD) public Citation getEvaluationProcedure() { - return evaluationProcedure; + return FilterByVersion.LEGACY_METADATA.accept() ? evaluationProcedure : null; } /** @@ -519,7 +535,7 @@ public class AbstractElement extends ISO * @return date or range of dates on which a data quality measure was applied. */ @Override - @XmlElement(name = "dateTime") + @XmlElement(name = "dateTime", namespace = Namespaces.DQC) @SuppressWarnings("ReturnOfCollectionOrArrayField") public Collection<Date> getDates() { if (Semaphores.query(Semaphores.NULL_COLLECTION)) { Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractLogicalConsistency.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractLogicalConsistency.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractLogicalConsistency.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractLogicalConsistency.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -45,13 +45,13 @@ import org.opengis.metadata.quality.Conc * * @author Martin Desruisseaux (IRD, Geomatys) * @author Touraïvane (IRD) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ @SuppressWarnings("CloneableClassWithoutClone") // ModifiableMetadata needs shallow clones. @XmlType(name = "AbstractDQ_LogicalConsistency_Type") -@XmlRootElement(name = "DQ_LogicalConsistency") +@XmlRootElement(name = "AbstractDQ_LogicalConsistency") @XmlSeeAlso({ DefaultConceptualConsistency.class, DefaultDomainConsistency.class, Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractPositionalAccuracy.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractPositionalAccuracy.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractPositionalAccuracy.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractPositionalAccuracy.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -44,13 +44,13 @@ import org.opengis.metadata.quality.Rela * * @author Martin Desruisseaux (IRD, Geomatys) * @author Touraïvane (IRD) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ @SuppressWarnings("CloneableClassWithoutClone") // ModifiableMetadata needs shallow clones. @XmlType(name = "AbstractDQ_PositionalAccuracy_Type") -@XmlRootElement(name = "DQ_PositionalAccuracy") +@XmlRootElement(name = "AbstractDQ_PositionalAccuracy") @XmlSeeAlso({ DefaultAbsoluteExternalPositionalAccuracy.class, DefaultGriddedDataPositionalAccuracy.class, Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractResult.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractResult.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractResult.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractResult.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -40,13 +40,13 @@ import org.apache.sis.metadata.iso.ISOMe * * @author Martin Desruisseaux (IRD, Geomatys) * @author Touraïvane (IRD) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ @SuppressWarnings("CloneableClassWithoutClone") // ModifiableMetadata needs shallow clones. @XmlType(name = "AbstractDQ_Result_Type") -@XmlRootElement(name = "DQ_Result") +@XmlRootElement(name = "AbstractDQ_Result") @XmlSeeAlso({ DefaultConformanceResult.class, DefaultQuantitativeResult.class, Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractTemporalAccuracy.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractTemporalAccuracy.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractTemporalAccuracy.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractTemporalAccuracy.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -23,6 +23,7 @@ import org.opengis.metadata.quality.Temp import org.opengis.metadata.quality.TemporalValidity; import org.opengis.metadata.quality.TemporalConsistency; import org.opengis.metadata.quality.AccuracyOfATimeMeasurement; +import org.apache.sis.xml.Namespaces; /** @@ -43,13 +44,13 @@ import org.opengis.metadata.quality.Accu * * @author Martin Desruisseaux (IRD, Geomatys) * @author Touraïvane (IRD) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ @SuppressWarnings("CloneableClassWithoutClone") // ModifiableMetadata needs shallow clones. -@XmlType(name = "AbstractDQ_TemporalAccuracy_Type") -@XmlRootElement(name = "DQ_TemporalAccuracy") +@XmlType(name = "AbstractDQ_TemporalAccuracy_Type", namespace = Namespaces.GMD) // TODO: renamed TemporalQuality +@XmlRootElement(name = "AbstractDQ_TemporalAccuracy", namespace = Namespaces.GMD) @XmlSeeAlso({ DefaultAccuracyOfATimeMeasurement.class, DefaultTemporalConsistency.class, Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractThematicAccuracy.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractThematicAccuracy.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractThematicAccuracy.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/AbstractThematicAccuracy.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -44,13 +44,13 @@ import org.opengis.metadata.quality.Quan * * @author Martin Desruisseaux (IRD, Geomatys) * @author Touraïvane (IRD) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ @SuppressWarnings("CloneableClassWithoutClone") // ModifiableMetadata needs shallow clones. @XmlType(name = "AbstractDQ_ThematicAccuracy_Type") -@XmlRootElement(name = "DQ_ThematicAccuracy") +@XmlRootElement(name = "AbstractDQ_ThematicAccuracy") @XmlSeeAlso({ DefaultThematicClassificationCorrectness.class, DefaultNonQuantitativeAttributeAccuracy.class, Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAbsoluteExternalPositionalAccuracy.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAbsoluteExternalPositionalAccuracy.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAbsoluteExternalPositionalAccuracy.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAbsoluteExternalPositionalAccuracy.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -40,7 +40,7 @@ import org.opengis.metadata.quality.Abso * * @author Martin Desruisseaux (IRD, Geomatys) * @author Touraïvane (IRD) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAccuracyOfATimeMeasurement.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAccuracyOfATimeMeasurement.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAccuracyOfATimeMeasurement.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultAccuracyOfATimeMeasurement.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -39,7 +39,7 @@ import org.opengis.metadata.quality.Accu * * @author Martin Desruisseaux (IRD, Geomatys) * @author Touraïvane (IRD) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessCommission.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessCommission.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessCommission.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessCommission.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -39,7 +39,7 @@ import org.opengis.metadata.quality.Comp * * @author Martin Desruisseaux (IRD, Geomatys) * @author Touraïvane (IRD) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessOmission.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessOmission.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessOmission.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultCompletenessOmission.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -39,7 +39,7 @@ import org.opengis.metadata.quality.Comp * * @author Martin Desruisseaux (IRD, Geomatys) * @author Touraïvane (IRD) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */ Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConceptualConsistency.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConceptualConsistency.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConceptualConsistency.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/DefaultConceptualConsistency.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -39,7 +39,7 @@ import org.opengis.metadata.quality.Conc * * @author Martin Desruisseaux (IRD, Geomatys) * @author Touraïvane (IRD) - * @version 0.3 + * @version 1.0 * @since 0.3 * @module */
