sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1820016 - in /sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso: identification/DefaultRepresentativeFraction.java lineage/DefaultLineage.java lineage/DefaultProcessStep.java
Date Wed, 03 Jan 2018 21:56:40 GMT
Author: desruisseaux
Date: Wed Jan  3 21:56:40 2018
New Revision: 1820016

URL: http://svn.apache.org/viewvc?rev=1820016&view=rev
Log:
Adaptation of commit 581e9dc8f5d7540d346d207562cba6c17fb20ed5 from Image Matter
(update some classes in lineage package to support 19115-3)

The project at this revision can be built but is known to have test failure.
Tests will pass only after we completed the port of all ISO 19115-3 work.

Modified:
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFraction.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultLineage.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStep.java

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFraction.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFraction.java?rev=1820016&r1=1820015&r2=1820016&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFraction.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFraction.java
[UTF-8] Wed Jan  3 21:56:40 2018
@@ -411,6 +411,7 @@ public class DefaultRepresentativeFracti
      *
      * @see org.apache.sis.metadata.iso.ISOMetadata#setID(String)
      */
+    @SuppressWarnings("unused")
     private void setID(String id) {
         MetadataUtilities.setObjectID(this, id);
     }
@@ -431,6 +432,7 @@ public class DefaultRepresentativeFracti
      *
      * @see org.apache.sis.metadata.iso.ISOMetadata#setUUID(String)
      */
+    @SuppressWarnings("unused")
     private void setUUID(final String id) {
         getIdentifierMap().put(IdentifierSpace.UUID, id);
     }

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultLineage.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultLineage.java?rev=1820016&r1=1820015&r2=1820016&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultLineage.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultLineage.java
[UTF-8] Wed Jan  3 21:56:40 2018
@@ -17,9 +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 javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 import org.opengis.util.InternationalString;
 import org.opengis.metadata.citation.Citation;
 import org.opengis.metadata.maintenance.Scope;
@@ -29,6 +30,8 @@ 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;
 
 
 /**
@@ -69,15 +72,16 @@ import org.apache.sis.metadata.iso.maint
  * @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"
 })
@@ -198,7 +202,8 @@ public class DefaultLineage extends ISOM
      * @since 0.5
      */
     @Override
-/// @XmlElement(name = "scope")
+    @XmlElement(name = "scope")
+    @XmlJavaTypeAdapter(MD_Scope.Since2014.class)
     public Scope getScope() {
         return scope;
     }
@@ -223,7 +228,7 @@ public class DefaultLineage extends ISOM
      * @since 0.5
      */
     @Override
-/// @XmlElement(name = "additionalDocumentation")
+    // @XmlElement at the end of this class.
     public Collection<Citation> getAdditionalDocumentation() {
         return additionalDocumentation = nonNullCollection(additionalDocumentation, Citation.class);
     }
@@ -278,4 +283,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/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStep.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStep.java?rev=1820016&r1=1820015&r2=1820016&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStep.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStep.java
[UTF-8] Wed Jan  3 21:56:40 2018
@@ -22,6 +22,7 @@ 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 javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 import org.opengis.util.InternationalString;
 import org.opengis.metadata.citation.Citation;
 import org.opengis.metadata.citation.Responsibility;
@@ -34,6 +35,8 @@ import org.apache.sis.metadata.iso.ISOMe
 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.metadata.MD_Scope;
 
 import static org.apache.sis.internal.metadata.MetadataUtilities.toDate;
 import static org.apache.sis.internal.metadata.MetadataUtilities.toMilliseconds;
@@ -60,7 +63,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
  */
@@ -71,6 +75,8 @@ import static org.apache.sis.internal.me
     "rationale",
     "date",
     "processors",
+    "reference",                // New in ISO 19115:2014
+    "scope",                    // New in ISO 19115:2014
     "sources",
     "outputs",
     "processingInformation",
@@ -297,7 +303,7 @@ public class DefaultProcessStep extends
      * @since 0.5
      */
     @Override
-/// @XmlElement(name = "reference")
+    // @XmlElement at the end of this class.
     public Collection<Citation> getReferences() {
         return references = nonNullCollection(references, Citation.class);
     }
@@ -321,7 +327,8 @@ public class DefaultProcessStep extends
      * @since 0.5
      */
     @Override
-/// @XmlElement(name = "scope")
+    @XmlElement(name = "scope")
+    @XmlJavaTypeAdapter(MD_Scope.Since2014.class)
     public Scope getScope() {
         return scope;
     }
@@ -422,4 +429,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;
+    }
 }



Mime
View raw message