sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1818791 [1/2] - in /sis/branches/ISO-19115-3/core: sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/ sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/ sis-metadata/src/main/java/org/apache/sis/metadata/iso/ sis-...
Date Wed, 20 Dec 2017 13:36:52 GMT
Author: desruisseaux
Date: Wed Dec 20 13:36:52 2017
New Revision: 1818791

URL: http://svn.apache.org/viewvc?rev=1818791&view=rev
Log:
Upgrade JAXB bindings of some more classes to ISO 19115-3.
This is part of commit e780d66b4d7d59368e742ba01777a151d8827ea8 from Image Matter.

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/internal/jaxb/code/CI_RoleCode.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/CI_TelephoneTypeCode.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/CI_Citation.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Identifier.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Releasability.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Scope.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitation.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultContact.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultOnlineResource.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultResponsibility.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultResponsibleParty.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultTelephone.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/package-info.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultConstraints.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/package-info.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultAttributeGroup.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultImageDescription.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultRangeDimension.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultSampleDimension.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/package-info.java
    sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/GO_Integer.java
    sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/GO_Real.java
    sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/GO_Record.java
    sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/GO_RecordType.java
    sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/InternationalStringAdapter.java
    sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/PropertyType.java
    sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/StringAdapter.java
    sis/branches/ISO-19115-3/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gmd/CodeListAdapter.java

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/CI_RoleCode.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/CI_RoleCode.java?rev=1818791&r1=1818790&r2=1818791&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/CI_RoleCode.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/CI_RoleCode.java [UTF-8] Wed Dec 20 13:36:52 2017
@@ -31,16 +31,17 @@ import org.apache.sis.xml.Namespaces;
  *
  * @author  Cédric Briançon (Geomatys)
  * @author  Cullen Rombach (Image Matters)
+ * @author  Martin Desruisseaux (Geomatys)
  * @version 1.0
  * @since   0.3
  * @module
  */
 @XmlType(namespace = Namespaces.CIT)
-public final class CI_RoleCode extends CodeListAdapter<CI_RoleCode, Role> {
+public class CI_RoleCode extends CodeListAdapter<CI_RoleCode, Role> {
     /**
      * Empty constructor for JAXB only.
      */
-    public CI_RoleCode() {
+    CI_RoleCode() {
     }
 
     /**
@@ -66,7 +67,7 @@ public final class CI_RoleCode extends C
      * @return the code list class.
      */
     @Override
-    protected Class<Role> getCodeListClass() {
+    protected final Class<Role> getCodeListClass() {
         return Role.class;
     }
 
@@ -77,7 +78,7 @@ public final class CI_RoleCode extends C
      */
     @Override
     @XmlElement(name = "CI_RoleCode")
-    public CodeListUID getElement() {
+    public final CodeListUID getElement() {
         return identifier;
     }
 
@@ -86,7 +87,26 @@ public final class CI_RoleCode extends C
      *
      * @param  value  the unmarshalled value.
      */
-    public void setElement(final CodeListUID value) {
+    public final void setElement(final CodeListUID value) {
         identifier = value;
     }
+
+    /**
+     * Wraps the value only if marshalling ISO 19115-3 element.
+     * Otherwise (i.e. if marshalling a legacy ISO 19139:2007 document), omit the element.
+     */
+    public static final class Since2014 extends CI_RoleCode {
+        /** Empty constructor used only by JAXB. */
+        private Since2014() {
+        }
+
+        /**
+         * Wraps the given value in an ISO 19115-3 element, unless we are marshalling an older document.
+         *
+         * @return a non-null value only if marshalling ISO 19115-3 or newer.
+         */
+        @Override public CI_RoleCode wrap(final CodeListUID value) {
+            return accept2014() ? super.wrap(value) : null;
+        }
+    }
 }

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/CI_TelephoneTypeCode.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/CI_TelephoneTypeCode.java?rev=1818791&r1=1818790&r2=1818791&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/CI_TelephoneTypeCode.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/CI_TelephoneTypeCode.java [UTF-8] Wed Dec 20 13:36:52 2017
@@ -30,16 +30,17 @@ import org.apache.sis.xml.Namespaces;
  * of {@code CodeList} in ISO-19139.
  *
  * @author  Cullen Rombach (Image Matters)
+ * @author  Martin Desruisseaux (Geomatys)
  * @version 1.0
  * @since   1.0
  * @module
  */
 @XmlType(namespace = Namespaces.CIT)
-public final class CI_TelephoneTypeCode extends CodeListAdapter<CI_TelephoneTypeCode, TelephoneType> {
+public class CI_TelephoneTypeCode extends CodeListAdapter<CI_TelephoneTypeCode, TelephoneType> {
     /**
      * Empty constructor for JAXB only.
      */
-    public CI_TelephoneTypeCode() {
+    CI_TelephoneTypeCode() {
     }
 
     /**
@@ -65,7 +66,7 @@ public final class CI_TelephoneTypeCode
      * @return the code list class.
      */
     @Override
-    protected Class<TelephoneType> getCodeListClass() {
+    protected final Class<TelephoneType> getCodeListClass() {
         return TelephoneType.class;
     }
 
@@ -76,7 +77,7 @@ public final class CI_TelephoneTypeCode
      */
     @Override
     @XmlElement(name = "CI_TelephoneTypeCode")
-    public CodeListUID getElement() {
+    public final CodeListUID getElement() {
         return identifier;
     }
 
@@ -85,7 +86,26 @@ public final class CI_TelephoneTypeCode
      *
      * @param  value  the unmarshalled value.
      */
-    public void setElement(final CodeListUID value) {
+    public final void setElement(final CodeListUID value) {
         identifier = value;
     }
+
+    /**
+     * Wraps the value only if marshalling ISO 19115-3 element.
+     * Otherwise (i.e. if marshalling a legacy ISO 19139:2007 document), omit the element.
+     */
+    public static final class Since2014 extends CI_TelephoneTypeCode {
+        /** Empty constructor used only by JAXB. */
+        private Since2014() {
+        }
+
+        /**
+         * Wraps the given value in an ISO 19115-3 element, unless we are marshalling an older document.
+         *
+         * @return a non-null value only if marshalling ISO 19115-3 or newer.
+         */
+        @Override public CI_TelephoneTypeCode wrap(final CodeListUID value) {
+            return accept2014() ? super.wrap(value) : null;
+        }
+    }
 }

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/CI_Citation.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/CI_Citation.java?rev=1818791&r1=1818790&r2=1818791&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/CI_Citation.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/CI_Citation.java [UTF-8] Wed Dec 20 13:36:52 2017
@@ -28,15 +28,15 @@ import org.apache.sis.internal.jaxb.gco.
  *
  * @author  Cédric Briançon (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.3
+ * @version 1.0
  * @since   0.3
  * @module
  */
-public final class CI_Citation extends PropertyType<CI_Citation, Citation> {
+public class CI_Citation extends PropertyType<CI_Citation, Citation> {
     /**
      * Empty constructor for JAXB only.
      */
-    public CI_Citation() {
+    CI_Citation() {
     }
 
     /**
@@ -47,7 +47,7 @@ public final class CI_Citation extends P
      * @return {@code Citation.class}
      */
     @Override
-    protected Class<Citation> getBoundType() {
+    protected final Class<Citation> getBoundType() {
         return Citation.class;
     }
 
@@ -78,7 +78,7 @@ public final class CI_Citation extends P
      * @return the metadata to be marshalled.
      */
     @XmlElementRef
-    public DefaultCitation getElement() {
+    public final DefaultCitation getElement() {
         return DefaultCitation.castOrCopy(metadata);
     }
 
@@ -87,7 +87,26 @@ public final class CI_Citation extends P
      *
      * @param  metadata  the unmarshalled metadata.
      */
-    public void setElement(final DefaultCitation metadata) {
+    public final void setElement(final DefaultCitation metadata) {
         this.metadata = metadata;
     }
+
+    /**
+     * Wraps the value only if marshalling ISO 19115-3 element.
+     * Otherwise (i.e. if marshalling a legacy ISO 19139:2007 document), omit the element.
+     */
+    public static final class Since2014 extends CI_Citation {
+        /** Empty constructor used only by JAXB. */
+        private Since2014() {
+        }
+
+        /**
+         * Wraps the given value in an ISO 19115-3 element, unless we are marshalling an older document.
+         *
+         * @return a non-null value only if marshalling ISO 19115-3 or newer.
+         */
+        @Override public CI_Citation wrap(final Citation value) {
+            return accept2014() ? super.wrap(value) : null;
+        }
+    }
 }

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Identifier.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Identifier.java?rev=1818791&r1=1818790&r2=1818791&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Identifier.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Identifier.java [UTF-8] Wed Dec 20 13:36:52 2017
@@ -31,15 +31,15 @@ import org.apache.sis.internal.jaxb.gco.
  *
  * @author  Cédric Briançon (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.7
+ * @version 1.0
  * @since   0.3
  * @module
  */
-public final class MD_Identifier extends PropertyType<MD_Identifier, Identifier> {
+public class MD_Identifier extends PropertyType<MD_Identifier, Identifier> {
     /**
      * Empty constructor for JAXB only.
      */
-    public MD_Identifier() {
+    MD_Identifier() {
     }
 
     /**
@@ -50,7 +50,7 @@ public final class MD_Identifier extends
      * @return {@code Identifier.class}
      */
     @Override
-    protected Class<Identifier> getBoundType() {
+    protected final Class<Identifier> getBoundType() {
         return Identifier.class;
     }
 
@@ -85,7 +85,7 @@ public final class MD_Identifier extends
         @XmlElementRef(type = ImmutableIdentifier.class)
     })
     @SuppressWarnings("deprecation")
-    public Identifier getElement() {
+    public final Identifier getElement() {
         if (metadata instanceof ImmutableIdentifier) {
             return (ImmutableIdentifier) metadata;
         }
@@ -100,7 +100,26 @@ public final class MD_Identifier extends
      *
      * @param  metadata  the unmarshalled metadata.
      */
-    public void setElement(final Identifier metadata) {
+    public final void setElement(final Identifier metadata) {
         this.metadata = metadata;
     }
+
+    /**
+     * Wraps the value only if marshalling ISO 19115-3 element.
+     * Otherwise (i.e. if marshalling a legacy ISO 19139:2007 document), omit the element.
+     */
+    public static final class Since2014 extends MD_Identifier {
+        /** Empty constructor used only by JAXB. */
+        private Since2014() {
+        }
+
+        /**
+         * Wraps the given value in an ISO 19115-3 element, unless we are marshalling an older document.
+         *
+         * @return a non-null value only if marshalling ISO 19115-3 or newer.
+         */
+        @Override public MD_Identifier wrap(final Identifier value) {
+            return accept2014() ? super.wrap(value) : null;
+        }
+    }
 }

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Releasability.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Releasability.java?rev=1818791&r1=1818790&r2=1818791&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Releasability.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Releasability.java [UTF-8] Wed Dec 20 13:36:52 2017
@@ -27,15 +27,16 @@ import org.opengis.metadata.constraint.R
  * See package documentation for more information about JAXB and interface.
  *
  * @author  Cullen Rombach (Image Matters)
+ * @author  Martin Desruisseaux (Geomatys)
  * @since   1.0
  * @version 1.0
  * @module
  */
-public final class MD_Releasability extends PropertyType<MD_Releasability, Releasability> {
+public class MD_Releasability extends PropertyType<MD_Releasability, Releasability> {
     /**
      * Empty constructor for JAXB only.
      */
-    public MD_Releasability() {
+    MD_Releasability() {
     }
 
     /**
@@ -46,7 +47,7 @@ public final class MD_Releasability exte
      * @return {@code Releasability.class}
      */
     @Override
-    protected Class<Releasability> getBoundType() {
+    protected final Class<Releasability> getBoundType() {
         return Releasability.class;
     }
 
@@ -77,7 +78,7 @@ public final class MD_Releasability exte
      * @return the metadata to be marshalled.
      */
     @XmlElementRef
-    public DefaultReleasability getElement() {
+    public final DefaultReleasability getElement() {
         return DefaultReleasability.castOrCopy(metadata);
     }
 
@@ -86,7 +87,26 @@ public final class MD_Releasability exte
      *
      * @param  metadata  the unmarshalled metadata.
      */
-    public void setElement(final DefaultReleasability metadata) {
+    public final void setElement(final DefaultReleasability metadata) {
         this.metadata = metadata;
     }
+
+    /**
+     * Wraps the value only if marshalling ISO 19115-3 element.
+     * Otherwise (i.e. if marshalling a legacy ISO 19139:2007 document), omit the element.
+     */
+    public static final class Since2014 extends MD_Releasability {
+        /** Empty constructor used only by JAXB. */
+        private Since2014() {
+        }
+
+        /**
+         * Wraps the given value in an ISO 19115-3 element, unless we are marshalling an older document.
+         *
+         * @return a non-null value only if marshalling ISO 19115-3 or newer.
+         */
+        @Override public MD_Releasability wrap(final Releasability value) {
+            return accept2014() ? super.wrap(value) : null;
+        }
+    }
 }

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Scope.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Scope.java?rev=1818791&r1=1818790&r2=1818791&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Scope.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_Scope.java [UTF-8] Wed Dec 20 13:36:52 2017
@@ -28,15 +28,15 @@ import org.apache.sis.internal.jaxb.gco.
  *
  * @author  Guilhem Legal (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.3
+ * @version 1.0
  * @since   0.3
  * @module
  */
-public final class MD_Scope extends PropertyType<MD_Scope, Scope> {
+public class MD_Scope extends PropertyType<MD_Scope, Scope> {
     /**
      * Empty constructor for JAXB only.
      */
-    public MD_Scope() {
+    MD_Scope() {
     }
 
     /**
@@ -47,7 +47,7 @@ public final class MD_Scope extends Prop
      * @return {@code Scope.class}
      */
     @Override
-    protected Class<Scope> getBoundType() {
+    protected final Class<Scope> getBoundType() {
         return Scope.class;
     }
 
@@ -78,7 +78,7 @@ public final class MD_Scope extends Prop
      * @return the metadata to be marshalled.
      */
     @XmlElementRef
-    public DefaultScope getElement() {
+    public final DefaultScope getElement() {
         return DefaultScope.castOrCopy(metadata);
     }
 
@@ -87,7 +87,26 @@ public final class MD_Scope extends Prop
      *
      * @param  metadata  the unmarshalled metadata.
      */
-    public void setElement(final DefaultScope metadata) {
+    public final void setElement(final DefaultScope metadata) {
         this.metadata = metadata;
     }
+
+    /**
+     * Wraps the value only if marshalling ISO 19115-3 element.
+     * Otherwise (i.e. if marshalling a legacy ISO 19139:2007 document), omit the element.
+     */
+    public static final class Since2014 extends MD_Scope {
+        /** Empty constructor used only by JAXB. */
+        private Since2014() {
+        }
+
+        /**
+         * Wraps the given value in an ISO 19115-3 element, unless we are marshalling an older document.
+         *
+         * @return a non-null value only if marshalling ISO 19115-3 or newer.
+         */
+        @Override public MD_Scope wrap(final Scope value) {
+            return accept2014() ? super.wrap(value) : null;
+        }
+    }
 }

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java?rev=1818791&r1=1818790&r2=1818791&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java [UTF-8] Wed Dec 20 13:36:52 2017
@@ -70,6 +70,8 @@ import org.apache.sis.internal.jaxb.gmd.
 import org.apache.sis.internal.jaxb.LegacyNamespaces;
 import org.apache.sis.internal.jaxb.FilterByVersion;
 import org.apache.sis.internal.jaxb.Context;
+import org.apache.sis.internal.jaxb.metadata.CI_Citation;
+import org.apache.sis.internal.jaxb.metadata.MD_Identifier;
 import org.apache.sis.xml.Namespaces;
 
 
@@ -134,7 +136,7 @@ import org.apache.sis.xml.Namespaces;
     "metadataIdentifier",
     "defaultLocale",
     "parentMetadata",
-    "metadataScopes",
+    "metadataScope",
 
     // Legacy ISO 19139:2007 attributes
     "fileIdentifier",
@@ -148,8 +150,8 @@ import org.apache.sis.xml.Namespaces;
     "contacts",
 
     // Attributes new in ISO 19115-3
-    "dateInfo",
-    "metadataStandards",
+    "dates",
+    "metadataStandard",
     "otherLocales",
 
     // Legacy ISO 19139:2007 attributes
@@ -412,8 +414,9 @@ public class DefaultMetadata extends ISO
      */
     @Override
     @XmlElement(name = "metadataIdentifier")
+    @XmlJavaTypeAdapter(MD_Identifier.Since2014.class)
     public Identifier getMetadataIdentifier() {
-        return FilterByVersion.CURRENT_METADATA.accept() ? metadataIdentifier : null;
+        return metadataIdentifier;
     }
 
     /**
@@ -484,6 +487,7 @@ public class DefaultMetadata extends ISO
      * @since 0.5
      */
     @Override
+    // @XmlElement at the end of this class.
     public Collection<Locale> getLanguages() {
         return languages = nonNullCollection(languages, Locale.class);
     }
@@ -526,15 +530,6 @@ public class DefaultMetadata extends ISO
     }
 
     /**
-     * Gets the default locale for this record (used in ISO 19115-3 format).
-     */
-    @Dependencies("getLanguages")
-    @XmlElement(name = "defaultLocale")
-    private Locale getDefaultLocale() {
-        return FilterByVersion.CURRENT_METADATA.accept() ? CollectionsExt.first(getLanguages()) : null;
-    }
-
-    /**
      * Sets the language used for documenting metadata.
      * This method modifies the collection returned by {@link #getLanguages()} as below:
      *
@@ -554,23 +549,6 @@ public class DefaultMetadata extends ISO
     }
 
     /**
-     * Sets the default locale for this record (used in ISO 19115-3 format).
-     */
-    @SuppressWarnings("unused")
-    private void setDefaultLocale(final Locale newValue) {
-        setLanguages(OtherLocales.setFirst(languages, newValue)); // See "Note about deprecated methods implementation"
-    }
-
-    /**
-     * Gets the other locales for this record (used in ISO 19115-3 format).
-     */
-    @Dependencies("getLanguages")
-    @XmlElement(name = "otherLocale")
-    private Collection<Locale> getOtherLocales() {
-        return FilterByVersion.CURRENT_METADATA.accept() ? OtherLocales.filter(getLanguages()) : null;
-    }
-
-    /**
      * Provides information about an alternatively used localized character string for a linguistic extension.
      *
      * @return alternatively used localized character string for a linguistic extension.
@@ -599,14 +577,6 @@ public class DefaultMetadata extends ISO
     }
 
     /**
-     * Sets the other locales for this record (used in ISO 19115-3 format).
-     */
-    @SuppressWarnings("unused")
-    private void setOtherLocales(final Collection<? extends Locale> newValues) {
-        setLanguages(OtherLocales.merge(CollectionsExt.first(languages), newValues)); // See "Note about deprecated methods implementation"
-    }
-
-    /**
      * Returns the character coding standard used for the metadata set.
      * ISO 19115:2014 represents character sets by references to the
      * <a href="http://www.iana.org/assignments/character-sets">IANA Character Set register</a>,
@@ -699,8 +669,9 @@ public class DefaultMetadata extends ISO
      */
     @Override
     @XmlElement(name = "parentMetadata")
+    @XmlJavaTypeAdapter(CI_Citation.Since2014.class)
     public Citation getParentMetadata() {
-        return FilterByVersion.CURRENT_METADATA.accept() ? parentMetadata : null;
+        return parentMetadata;
     }
 
     /**
@@ -766,9 +737,8 @@ public class DefaultMetadata extends ISO
      * @since 0.5
      */
     @Override
-    @XmlElement(name = "metadataScope")
+    // @XmlElement at the end of this class.
     public Collection<MetadataScope> getMetadataScopes() {
-        if (!FilterByVersion.CURRENT_METADATA.accept()) return null;
         return metadataScopes = nonNullCollection(metadataScopes, MetadataScope.class);
     }
 
@@ -915,9 +885,8 @@ public class DefaultMetadata extends ISO
      * @since 0.5
      */
     @Override
-    @XmlElement(name = "dateInfo", required = true)
+    // @XmlElement at the end of this class.
     public Collection<CitationDate> getDateInfo() {
-        if (!FilterByVersion.CURRENT_METADATA.accept()) return null;
         return dateInfo = nonNullCollection(dateInfo, CitationDate.class);
     }
 
@@ -943,7 +912,7 @@ public class DefaultMetadata extends ISO
     @Override
     @Deprecated
     @Dependencies("getDateInfo")
-    @XmlElement(name = "dateStamp", namespace = LegacyNamespaces.GMD, required = true)
+    @XmlElement(name = "dateStamp", namespace = LegacyNamespaces.GMD)
     public Date getDateStamp() {
         if (FilterByVersion.LEGACY_METADATA.accept()) {
             final Collection<CitationDate> dates = getDateInfo();
@@ -1008,9 +977,8 @@ public class DefaultMetadata extends ISO
      * @since 0.5
      */
     @Override
-    @XmlElement(name = "metadataStandard")
+    // @XmlElement at the end of this class.
     public Collection<Citation> getMetadataStandards() {
-        if (!FilterByVersion.CURRENT_METADATA.accept()) return null;
         return metadataStandards = nonNullCollection(metadataStandards, Citation.class);
     }
 
@@ -1584,4 +1552,58 @@ public class DefaultMetadata extends ISO
     private void afterMarshal(final Marshaller marshaller) {
         Context.pull();
     }
+
+    /**
+     * Gets the default locale for this record (used in ISO 19115-3 format).
+     */
+    @Dependencies("getLanguages")
+    @XmlElement(name = "defaultLocale")
+    private Locale getDefaultLocale() {
+        return FilterByVersion.CURRENT_METADATA.accept() ? CollectionsExt.first(getLanguages()) : null;
+    }
+
+    /**
+     * Sets the default locale for this record (used in ISO 19115-3 format).
+     */
+    @SuppressWarnings("unused")
+    private void setDefaultLocale(final Locale newValue) {
+        setLanguages(OtherLocales.setFirst(languages, newValue)); // See "Note about deprecated methods implementation"
+    }
+
+    /**
+     * Gets the other locales for this record (used in ISO 19115-3 format).
+     */
+    @Dependencies("getLanguages")
+    @XmlElement(name = "otherLocale")
+    private Collection<Locale> getOtherLocales() {
+        return FilterByVersion.CURRENT_METADATA.accept() ? OtherLocales.filter(getLanguages()) : null;
+    }
+
+    /**
+     * Sets the other locales for this record (used in ISO 19115-3 format).
+     */
+    @SuppressWarnings("unused")
+    private void setOtherLocales(final Collection<? extends Locale> newValues) {
+        setLanguages(OtherLocales.merge(CollectionsExt.first(languages), newValues));
+    }
+
+    /**
+     * 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 = "metadataScope")
+    private Collection<MetadataScope> getMetadataScope() {
+        return FilterByVersion.CURRENT_METADATA.accept() ? getMetadataScopes() : null;
+    }
+
+    @XmlElement(name = "dateInfo", required = true)
+    private Collection<CitationDate> getDates() {
+        return FilterByVersion.CURRENT_METADATA.accept() ? getDateInfo() : null;
+    }
+
+    @XmlElement(name = "metadataStandard")
+    private Collection<Citation> getMetadataStandard() {
+        return FilterByVersion.CURRENT_METADATA.accept() ? getMetadataStandards() : null;
+    }
 }

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitation.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitation.java?rev=1818791&r1=1818790&r2=1818791&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitation.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultCitation.java [UTF-8] Wed Dec 20 13:36:52 2017
@@ -31,6 +31,8 @@ import org.opengis.metadata.citation.Ser
 import org.opengis.metadata.identification.BrowseGraphic;
 import org.opengis.util.InternationalString;
 import org.apache.sis.util.iso.Types;
+import org.apache.sis.internal.jaxb.FilterByVersion;
+import org.apache.sis.internal.jaxb.LegacyNamespaces;
 import org.apache.sis.internal.jaxb.NonMarshalledAuthority;
 import org.apache.sis.metadata.TitleProperty;
 import org.apache.sis.metadata.iso.ISOMetadata;
@@ -68,7 +70,8 @@ import static org.apache.sis.internal.me
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Cédric Briançon (Geomatys)
  * @author  Rémi Maréchal (Geomatys)
- * @version 0.7
+ * @author  Cullen Rombach (Image Matters)
+ * @version 1.0
  * @since   0.3
  * @module
  */
@@ -87,7 +90,9 @@ import static org.apache.sis.internal.me
     "otherCitationDetails",
     "collectiveTitle",
     "ISBN",
-    "ISSN"
+    "ISSN",
+    "onlineResource",
+    "graphic"
 })
 @XmlRootElement(name = "CI_Citation")
 public class DefaultCitation extends ISOMetadata implements Citation {
@@ -485,9 +490,9 @@ public class DefaultCitation extends ISO
      */
     @Override
     @Deprecated
-    @XmlElement(name = "collectiveTitle")
+    @XmlElement(name = "collectiveTitle", namespace = LegacyNamespaces.GMD)
     public InternationalString getCollectiveTitle() {
-        return collectiveTitle;
+        return FilterByVersion.LEGACY_METADATA.accept() ? collectiveTitle : null;
     }
 
     /**
@@ -590,7 +595,7 @@ public class DefaultCitation extends ISO
      * @since 0.5
      */
     @Override
-/// @XmlElement(name = "onlineResource")
+    // @XmlElement at the end of this class.
     public Collection<OnlineResource> getOnlineResources() {
         return onlineResources = nonNullCollection(onlineResources, OnlineResource.class);
     }
@@ -614,7 +619,7 @@ public class DefaultCitation extends ISO
      * @since 0.5
      */
     @Override
-/// @XmlElement(name = "graphic")
+    // @XmlElement at the end of this class.
     public Collection<BrowseGraphic> getGraphics() {
         return graphics = nonNullCollection(graphics, BrowseGraphic.class);
     }
@@ -629,4 +634,33 @@ public class DefaultCitation extends ISO
     public void setGraphics(final Collection<? extends BrowseGraphic> newValues) {
         graphics = writeCollection(newValues, graphics, BrowseGraphic.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 = "onlineResource")
+    private Collection<OnlineResource> getOnlineResource() {
+        return FilterByVersion.CURRENT_METADATA.accept() ? getOnlineResources() : null;
+    }
+
+    @XmlElement(name = "graphic")
+    private Collection<BrowseGraphic> getGraphic() {
+        return FilterByVersion.CURRENT_METADATA.accept() ? getGraphics() : null;
+    }
 }

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultContact.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultContact.java?rev=1818791&r1=1818790&r2=1818791&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultContact.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultContact.java [UTF-8] Wed Dec 20 13:36:52 2017
@@ -22,6 +22,7 @@ import java.util.Collection;
 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.Address;
 import org.opengis.metadata.citation.Contact;
@@ -31,6 +32,9 @@ import org.opengis.metadata.citation.Tel
 import org.apache.sis.metadata.iso.ISOMetadata;
 import org.apache.sis.util.resources.Messages;
 import org.apache.sis.internal.jaxb.Context;
+import org.apache.sis.internal.jaxb.FilterByVersion;
+import org.apache.sis.internal.jaxb.LegacyNamespaces;
+import org.apache.sis.internal.jaxb.gco.InternationalStringAdapter;
 import org.apache.sis.internal.metadata.Dependencies;
 import org.apache.sis.internal.metadata.LegacyPropertyAdapter;
 
@@ -51,17 +55,22 @@ import org.apache.sis.internal.metadata.
  * @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 = "CI_Contact_Type", propOrder = {
     "phone",
+    "phoneList",
     "address",
+    "addressList",
     "onlineResource",
+    "onlineResourceList",
     "hoursOfService",
-    "contactInstructions"
+    "contactInstructions",
+    "contactType"
 })
 @XmlRootElement(name = "CI_Contact")
 public class DefaultContact extends ISOMetadata implements Contact {
@@ -170,6 +179,7 @@ public class DefaultContact extends ISOM
      * @since 0.5
      */
     @Override
+    // @XmlElement at the end of this class.
     public Collection<Telephone> getPhones() {
         return phones = nonNullCollection(phones, Telephone.class);
     }
@@ -185,9 +195,9 @@ public class DefaultContact extends ISOM
         phones = writeCollection(newValues, phones, Telephone.class);
         /*
          * Code below this point will be deleted after we removed the deprecated methods in DefaultTelephone.
-         * This code notifies all DefaultTelephone instances about the the list of phones in order to allow
-         * the deprecated Telephone.getVoices() and Telephone.getFacsimiles() methods to fetches information
-         * from the phones list.
+         * This code notifies all DefaultTelephone instances about the list of phones in order to allow the
+         * deprecated Telephone.getVoices() and Telephone.getFacsimiles() methods to fetches information from
+         * the phones list.
          */
         if (phones != null) {
             boolean modified = false;
@@ -217,26 +227,28 @@ public class DefaultContact extends ISOM
      */
     @Override
     @Deprecated
-    @XmlElement(name = "phone")
     @Dependencies("getPhones")
+    @XmlElement(name = "phone", namespace = LegacyNamespaces.GMD)
     public Telephone getPhone() {
         Telephone phone = null;
-        final Collection<Telephone> phones = getPhones();
-        if (phones != null) { // May be null on marshalling.
-            TelephoneType ignored = null;
-            for (final Telephone c : phones) {
-                final TelephoneType type = c.getNumberType();
-                if (TelephoneType.VOICE.equals(type) || TelephoneType.FACSIMILE.equals(type)) {
-                    if (phone == null) {
-                        phone = c;
+        if (FilterByVersion.LEGACY_METADATA.accept()) {
+            final Collection<Telephone> phones = getPhones();
+            if (phones != null) {                                   // May be null on marshalling.
+                TelephoneType ignored = null;
+                for (final Telephone c : phones) {
+                    final TelephoneType type = c.getNumberType();
+                    if (TelephoneType.VOICE.equals(type) || TelephoneType.FACSIMILE.equals(type)) {
+                        if (phone == null) {
+                            phone = c;
+                        }
+                    } else if (ignored == null) {
+                        ignored = type;
                     }
-                } else if (ignored == null) {
-                    ignored = type;
                 }
-            }
-            if (ignored != null) {
-                Context.warningOccured(Context.current(), DefaultContact.class, "getPhone",
-                        Messages.class, Messages.Keys.IgnoredPropertyAssociatedTo_1, ignored.toString());
+                if (ignored != null) {
+                    Context.warningOccured(Context.current(), DefaultContact.class, "getPhone",
+                            Messages.class, Messages.Keys.IgnoredPropertyAssociatedTo_1, ignored.toString());
+                }
             }
         }
         return phone;
@@ -277,6 +289,7 @@ public class DefaultContact extends ISOM
      * @since 0.5
      */
     @Override
+    // @XmlElement at the end of this class.
     public Collection<Address> getAddresses() {
         return addresses = nonNullCollection(addresses, Address.class);
     }
@@ -302,10 +315,13 @@ public class DefaultContact extends ISOM
      */
     @Override
     @Deprecated
-    @XmlElement(name = "address")
     @Dependencies("getAddresses")
+    @XmlElement(name = "address", namespace = LegacyNamespaces.GMD)
     public Address getAddress() {
-        return LegacyPropertyAdapter.getSingleton(getAddresses(), Address.class, null, DefaultContact.class, "getAddress");
+        if (FilterByVersion.LEGACY_METADATA.accept()) {
+            return LegacyPropertyAdapter.getSingleton(getAddresses(), Address.class, null, DefaultContact.class, "getAddress");
+        }
+        return null;                // Marshalling newer ISO 19115-3
     }
 
     /**
@@ -329,6 +345,7 @@ public class DefaultContact extends ISOM
      * @since 0.5
      */
     @Override
+    // @XmlElement at the end of this class.
     public Collection<OnlineResource> getOnlineResources() {
         return onlineResources = nonNullCollection(onlineResources, OnlineResource.class);
     }
@@ -354,10 +371,13 @@ public class DefaultContact extends ISOM
      */
     @Override
     @Deprecated
-    @XmlElement(name = "onlineResource")
     @Dependencies("getOnlineResources")
+    @XmlElement(name = "onlineResource", namespace = LegacyNamespaces.GMD)
     public OnlineResource getOnlineResource() {
-        return LegacyPropertyAdapter.getSingleton(getOnlineResources(), OnlineResource.class, null, DefaultContact.class, "getOnlineResource");
+        if (FilterByVersion.LEGACY_METADATA.accept()) {
+            return LegacyPropertyAdapter.getSingleton(getOnlineResources(), OnlineResource.class, null, DefaultContact.class, "getOnlineResource");
+        }
+        return null;                // Marshalling newer ISO 19115-3
     }
 
     /**
@@ -423,7 +443,8 @@ public class DefaultContact extends ISOM
      * @since 0.5
      */
     @Override
-/// @XmlElement(name = "contactType")
+    @XmlElement(name = "contactType")
+    @XmlJavaTypeAdapter(InternationalStringAdapter.Since2014.class)
     public InternationalString getContactType() {
         return contactType;
     }
@@ -439,4 +460,38 @@ public class DefaultContact extends ISOM
         checkWritePermission();
         contactType = 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 = "phone")
+    private Collection<Telephone> getPhoneList() {
+        return FilterByVersion.CURRENT_METADATA.accept() ? getPhones() : null;
+    }
+
+    @XmlElement(name = "address")
+    private Collection<Address> getAddressList() {
+        return FilterByVersion.CURRENT_METADATA.accept() ? getAddresses() : null;
+    }
+
+    @XmlElement(name = "onlineResource")
+    private Collection<OnlineResource> getOnlineResourceList() {
+        return FilterByVersion.CURRENT_METADATA.accept() ? getOnlineResources() : null;
+    }
 }

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultOnlineResource.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultOnlineResource.java?rev=1818791&r1=1818790&r2=1818791&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultOnlineResource.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultOnlineResource.java [UTF-8] Wed Dec 20 13:36:52 2017
@@ -17,12 +17,18 @@
 package org.apache.sis.metadata.iso.citation;
 
 import java.net.URI;
+import java.net.URISyntaxException;
 import javax.xml.bind.annotation.XmlType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import org.apache.sis.internal.jaxb.Context;
 import org.opengis.util.InternationalString;
 import org.opengis.metadata.citation.OnLineFunction;
 import org.opengis.metadata.citation.OnlineResource;
+import org.apache.sis.internal.jaxb.FilterByVersion;
+import org.apache.sis.internal.jaxb.LegacyNamespaces;
+import org.apache.sis.internal.jaxb.gco.StringAdapter;
 import org.apache.sis.metadata.iso.ISOMetadata;
 
 
@@ -46,18 +52,21 @@ import org.apache.sis.metadata.iso.ISOMe
  * @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 = "CI_OnlineResource_Type", propOrder = {
-    "linkage",
+    "linkageURL",
+    "linkageString",
     "protocol",
     "applicationProfile",
     "name",
     "description",
-    "function"
+    "function",
+    "protocolRequest"
 })
 @XmlRootElement(name = "CI_OnlineResource")
 public class DefaultOnlineResource extends ISOMetadata implements OnlineResource {
@@ -258,7 +267,7 @@ public class DefaultOnlineResource exten
      * @return location for on-line access using a Uniform Resource Locator address or similar scheme, or {@code null}.
      */
     @Override
-    @XmlElement(name = "linkage", required = true)
+    // @XmlElement at the end of this class.
     public URI getLinkage() {
         return linkage;
     }
@@ -318,6 +327,8 @@ public class DefaultOnlineResource exten
      * @since 0.5
      */
     @Override
+    @XmlElement(name = "protocolRequest")
+    @XmlJavaTypeAdapter(StringAdapter.Since2014.class)
     public String getProtocolRequest() {
         return protocolRequest;
     }
@@ -333,4 +344,59 @@ public class DefaultOnlineResource exten
         checkWritePermission();
         protocolRequest = 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 at marshalling time for writing URL as defined by ISO 19139:2007.
+     * That legacy standard wraps the URL in a {@code <gmd:URL>} element.
+     */
+    @XmlElement(name = "linkage", namespace = LegacyNamespaces.GMD)
+    private URI getLinkageURL() {
+        return FilterByVersion.LEGACY_METADATA.accept() ? getLinkage() : null;
+    }
+
+    /**
+     * Invoked at ISO 19139:2007 unmarshalling time for storing the value of {@code <gmd:URL>} element.
+     */
+    @SuppressWarnings("unused")
+    private void setLinkageURL(final URI newValue) {
+        setLinkage(newValue);
+    }
+
+    /**
+     * Invoked at marshalling time for writing URL as defined by ISO 19115-3.
+     * That newer standard write the URL directly, without wrapping in {@code <gmd:URL>} element.
+     */
+    @XmlElement(name = "linkage", required = true)
+    private String getLinkageString() {
+        if (FilterByVersion.CURRENT_METADATA.accept()) {
+            final URI linkage = getLinkage();
+            if (linkage != null) {
+                return linkage.toString();
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Invoked at ISO 19115-3 unmarshalling time for parsing the URL.
+     */
+    @SuppressWarnings("unused")
+    private void setLinkageString(final String newValue) throws URISyntaxException {
+        final Context context = Context.current();
+        setLinkage(Context.converter(context).toURI(context, newValue));
+    }
 }

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultResponsibility.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultResponsibility.java?rev=1818791&r1=1818790&r2=1818791&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultResponsibility.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultResponsibility.java [UTF-8] Wed Dec 20 13:36:52 2017
@@ -21,11 +21,14 @@ import javax.xml.bind.annotation.XmlType
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 import org.opengis.metadata.citation.Party;
 import org.opengis.metadata.citation.Responsibility;
 import org.opengis.metadata.citation.Role;
 import org.opengis.metadata.extent.Extent;
 import org.apache.sis.metadata.iso.ISOMetadata;
+import org.apache.sis.internal.jaxb.FilterByVersion;
+import org.apache.sis.internal.jaxb.code.CI_RoleCode;
 
 
 /**
@@ -49,15 +52,16 @@ import org.apache.sis.metadata.iso.ISOMe
  *
  * @author  Rémi Maréchal (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.5
+ * @author  Cullen Rombach (Image Matters)
+ * @version 1.0
  * @since   0.5
  * @module
  */
-@SuppressWarnings("CloneableClassWithoutClone")                 // ModifiableMetadata needs shallow clones.
+@SuppressWarnings({"CloneableClassWithoutClone", "deprecation"})    // ModifiableMetadata needs shallow clones.
 @XmlType(name = "CI_Responsibility_Type", propOrder = {
-/// "role",
-/// "extents",
-/// "parties"
+    "role",
+    "extent",
+    "party"
 })
 @XmlRootElement(name = "CI_Responsibility")
 @XmlSeeAlso({
@@ -152,7 +156,8 @@ public class DefaultResponsibility exten
      * @return function performed by the responsible party.
      */
     @Override
-/// @XmlElement(name = "role", required = true)
+    @XmlElement(name = "role", required = true)
+    @XmlJavaTypeAdapter(CI_RoleCode.Since2014.class)
     public Role getRole() {
         return role;
     }
@@ -173,7 +178,7 @@ public class DefaultResponsibility exten
      * @return the spatial or temporal extents of the role.
      */
     @Override
-/// @XmlElement(name = "extent")
+    // @XmlElement at the end of this class.
     public Collection<Extent> getExtents() {
         return extents = nonNullCollection(extents, Extent.class);
     }
@@ -193,7 +198,7 @@ public class DefaultResponsibility exten
      * @return information about the parties.
      */
     @Override
-/// @XmlElement(name = "party", required = true)
+    // @XmlElement at the end of this class.
     public Collection<Party> getParties() {
         return parties = nonNullCollection(parties, Party.class);
     }
@@ -206,4 +211,33 @@ public class DefaultResponsibility exten
     public void setParties(final Collection<? extends Party> newValues) {
         parties = writeCollection(newValues, parties, Party.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 = "extent")
+    private Collection<Extent> getExtent() {
+        return FilterByVersion.CURRENT_METADATA.accept() ? getExtents() : null;
+    }
+
+    @XmlElement(name = "party", required = true)
+    private Collection<Party> getParty() {
+        return FilterByVersion.CURRENT_METADATA.accept() ? getParties() : null;
+    }
 }

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultResponsibleParty.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultResponsibleParty.java?rev=1818791&r1=1818790&r2=1818791&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultResponsibleParty.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultResponsibleParty.java [UTF-8] Wed Dec 20 13:36:52 2017
@@ -31,6 +31,7 @@ import org.opengis.metadata.citation.Res
 import org.opengis.metadata.citation.Role;
 import org.opengis.util.InternationalString;
 import org.apache.sis.util.iso.Types;
+import org.apache.sis.internal.jaxb.LegacyNamespaces;
 import org.apache.sis.internal.metadata.Dependencies;
 import org.apache.sis.internal.metadata.LegacyPropertyAdapter;
 
@@ -58,14 +59,14 @@ import org.apache.sis.internal.metadata.
  */
 @Deprecated
 @SuppressWarnings("CloneableClassWithoutClone")                 // ModifiableMetadata needs shallow clones.
-@XmlType(name = "CI_ResponsibleParty_Type", propOrder = {
+@XmlType(name = "CI_ResponsibleParty_Type", namespace = LegacyNamespaces.GMD, propOrder = {
     "individualName",
     "organisationName",
     "positionName",
     "contactInfo",
     "role"
 })
-@XmlRootElement(name = "CI_ResponsibleParty")
+@XmlRootElement(name = "CI_ResponsibleParty", namespace = LegacyNamespaces.GMD)
 public class DefaultResponsibleParty extends DefaultResponsibility implements ResponsibleParty {
     /**
      * Serial number for inter-operability with different versions.

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultTelephone.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultTelephone.java?rev=1818791&r1=1818790&r2=1818791&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultTelephone.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/DefaultTelephone.java [UTF-8] Wed Dec 20 13:36:52 2017
@@ -22,10 +22,15 @@ import java.util.Collections;
 import javax.xml.bind.annotation.XmlType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 import org.opengis.metadata.citation.Telephone;
 import org.opengis.metadata.citation.TelephoneType;
-import org.apache.sis.internal.util.CollectionsExt;
 import org.apache.sis.metadata.iso.ISOMetadata;
+import org.apache.sis.internal.util.CollectionsExt;
+import org.apache.sis.internal.jaxb.FilterByVersion;
+import org.apache.sis.internal.jaxb.LegacyNamespaces;
+import org.apache.sis.internal.jaxb.gco.StringAdapter;
+import org.apache.sis.internal.jaxb.code.CI_TelephoneTypeCode;
 import org.apache.sis.internal.metadata.Dependencies;
 
 
@@ -61,7 +66,8 @@ import org.apache.sis.internal.metadata.
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Cédric Briançon (Geomatys)
  * @author  Rémi Maréchal (Geomatys)
- * @version 0.5
+ * @author  Cullen Rombach (Image Matters)
+ * @version 1.0
  *
  * @see DefaultContact#getPhones()
  *
@@ -70,6 +76,9 @@ import org.apache.sis.internal.metadata.
  */
 @SuppressWarnings("CloneableClassWithoutClone")                 // ModifiableMetadata needs shallow clones.
 @XmlType(name = "CI_Telephone_Type", propOrder = {
+    "number",
+    "numberType",
+    // Legacy ISO 19139:2007 attributes.
     "voices",
     "facsimiles"
 })
@@ -159,7 +168,8 @@ public class DefaultTelephone extends IS
      * @since 0.5
      */
     @Override
-/// @XmlElement(name = "number", required = true)
+    @XmlElement(name = "number", required = true)
+    @XmlJavaTypeAdapter(StringAdapter.Since2014.class)
     public String getNumber() {
         return number;
     }
@@ -184,7 +194,8 @@ public class DefaultTelephone extends IS
      * @since 0.5
      */
     @Override
-/// @XmlElement(name = "numberType")
+    @XmlElement(name = "numberType")
+    @XmlJavaTypeAdapter(CI_TelephoneTypeCode.Since2014.class)
     public TelephoneType getNumberType() {
         return numberType;
     }
@@ -268,10 +279,13 @@ public class DefaultTelephone extends IS
      */
     @Override
     @Deprecated
-    @XmlElement(name = "voice")
     @Dependencies({"getNumber", "getNumberType"})
+    @XmlElement(name = "voice", namespace = LegacyNamespaces.GMD)
     public final Collection<String> getVoices() {
-        return new LegacyTelephones(getOwner(), TelephoneType.VOICE);
+        if (FilterByVersion.LEGACY_METADATA.accept()) {
+            return new LegacyTelephones(getOwner(), TelephoneType.VOICE);
+        }
+        return null;                    // Marshalling newer ISO 19115-3 document.
     }
 
     /**
@@ -301,10 +315,13 @@ public class DefaultTelephone extends IS
      */
     @Override
     @Deprecated
-    @XmlElement(name = "facsimile")
     @Dependencies({"getNumber", "getNumberType"})
+    @XmlElement(name = "facsimile", namespace = LegacyNamespaces.GMD)
     public final Collection<String> getFacsimiles() {
-        return new LegacyTelephones(getOwner(), TelephoneType.FACSIMILE);
+        if (FilterByVersion.LEGACY_METADATA.accept()) {
+            return new LegacyTelephones(getOwner(), TelephoneType.FACSIMILE);
+        }
+        return null;                    // Marshalling newer ISO 19115-3 document.
     }
 
     /**

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/package-info.java?rev=1818791&r1=1818790&r2=1818791&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/package-info.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/package-info.java [UTF-8] Wed Dec 20 13:36:52 2017
@@ -86,14 +86,18 @@
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Touraïvane (IRD)
  * @author  Cédric Briançon (Geomatys)
- * @version 0.7
+ * @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),
+@XmlSchema(location=Schemas.METADATA_XSD_CITATION, elementFormDefault=XmlNsForm.QUALIFIED, namespace=Namespaces.CIT, xmlns = {
+    @XmlNs(prefix = "cit", namespaceURI = Namespaces.CIT),
+    @XmlNs(prefix = "mcc", namespaceURI = Namespaces.MCC),
+    @XmlNs(prefix = "mrd", namespaceURI = Namespaces.MRD),
     @XmlNs(prefix = "gco", namespaceURI = Namespaces.GCO),
-    @XmlNs(prefix = "xsi", namespaceURI = Namespaces.XSI)
+    @XmlNs(prefix = "xsi", namespaceURI = Namespaces.XSI),
+    @XmlNs(prefix = "gmd", namespaceURI = LegacyNamespaces.GMD)
 })
 @XmlAccessorType(XmlAccessType.NONE)
 @XmlJavaTypeAdapters({
@@ -110,6 +114,7 @@
     @XmlJavaTypeAdapter(CI_Series.class),
     @XmlJavaTypeAdapter(CI_Telephone.class),
     @XmlJavaTypeAdapter(EX_Extent.class),
+    @XmlJavaTypeAdapter(MD_BrowseGraphic.class),
     @XmlJavaTypeAdapter(MD_Identifier.class),
 
     // Java types, primitive types and basic OGC types handling
@@ -128,6 +133,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.LegacyNamespaces;
 import org.apache.sis.internal.jaxb.Schemas;
 import org.apache.sis.internal.jaxb.gco.*;
 import org.apache.sis.internal.jaxb.gmd.*;

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultConstraints.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultConstraints.java?rev=1818791&r1=1818790&r2=1818791&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultConstraints.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/DefaultConstraints.java [UTF-8] Wed Dec 20 13:36:52 2017
@@ -21,6 +21,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;
@@ -30,6 +31,9 @@ import org.opengis.metadata.constraint.C
 import org.opengis.metadata.constraint.LegalConstraints;
 import org.opengis.metadata.constraint.SecurityConstraints;
 import org.opengis.metadata.maintenance.Scope;
+import org.apache.sis.internal.jaxb.FilterByVersion;
+import org.apache.sis.internal.jaxb.metadata.MD_Releasability;
+import org.apache.sis.internal.jaxb.metadata.MD_Scope;
 import org.apache.sis.metadata.iso.ISOMetadata;
 import org.apache.sis.util.iso.Types;
 
@@ -50,19 +54,20 @@ import org.apache.sis.util.iso.Types;
  * @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 = "MD_Constraints_Type" /*, propOrder = {
+@XmlType(name = "MD_Constraints_Type", propOrder = {
     "useLimitation",
     "constraintApplicationScope",
     "graphic",
     "reference",
     "releasability",
     "responsibleParty"
-} */)
+})
 @XmlRootElement(name = "MD_Constraints")
 @XmlSeeAlso({
     DefaultLegalConstraints.class,
@@ -209,7 +214,8 @@ public class DefaultConstraints extends
      * @since 0.5
      */
     @Override
-/// @XmlElement(name = "constraintApplicationScope")
+    @XmlElement(name = "constraintApplicationScope")
+    @XmlJavaTypeAdapter(MD_Scope.Since2014.class)
     public Scope getConstraintApplicationScope() {
         return constraintApplicationScope;
     }
@@ -234,7 +240,7 @@ public class DefaultConstraints extends
      * @since 0.5
      */
     @Override
-/// @XmlElement(name = "graphic")
+    // @XmlElement at the end of this class.
     public Collection<BrowseGraphic> getGraphics() {
         return graphics = nonNullCollection(graphics, BrowseGraphic.class);
     }
@@ -259,7 +265,7 @@ public class DefaultConstraints 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);
     }
@@ -283,7 +289,8 @@ public class DefaultConstraints extends
      * @since 0.5
      */
     @Override
-/// @XmlElement(name = "releasability")
+    @XmlElement(name = "releasability")
+    @XmlJavaTypeAdapter(MD_Releasability.Since2014.class)
     public Releasability getReleasability() {
         return releasability;
     }
@@ -308,7 +315,7 @@ public class DefaultConstraints extends
      * @since 0.5
      */
     @Override
-/// @XmlElement(name = "responsibleParty")
+    // @XmlElement at the end of this class.
     public Collection<Responsibility> getResponsibleParties() {
         return responsibleParties = nonNullCollection(responsibleParties, Responsibility.class);
     }
@@ -323,4 +330,38 @@ public class DefaultConstraints extends
     public void setResponsibleParties(final Collection<? extends Responsibility> newValues) {
         responsibleParties = writeCollection(newValues, responsibleParties, Responsibility.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 = "graphic")
+    private Collection<BrowseGraphic> getGraphic() {
+        return FilterByVersion.CURRENT_METADATA.accept() ? getGraphics() : null;
+    }
+
+    @XmlElement(name = "reference")
+    private Collection<Citation> getReference() {
+        return FilterByVersion.CURRENT_METADATA.accept() ? getReferences() : null;
+    }
+
+    @XmlElement(name = "responsibleParty")
+    private Collection<Responsibility> getResponsibleParty() {
+        return FilterByVersion.CURRENT_METADATA.accept() ? getResponsibleParties() : null;
+    }
 }

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/package-info.java?rev=1818791&r1=1818790&r2=1818791&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/package-info.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/constraint/package-info.java [UTF-8] Wed Dec 20 13:36:52 2017
@@ -63,17 +63,23 @@
  * @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),
+@XmlSchema(location=Schemas.METADATA_XSD_CONSTRAINT, elementFormDefault=XmlNsForm.QUALIFIED, namespace=Namespaces.MCO, xmlns = {
+    @XmlNs(prefix = "mco", namespaceURI = Namespaces.MCO),
+    @XmlNs(prefix = "mcc", namespaceURI = Namespaces.MCC),
     @XmlNs(prefix = "gco", namespaceURI = Namespaces.GCO),
-    @XmlNs(prefix = "xsi", namespaceURI = Namespaces.XSI)
+    @XmlNs(prefix = "xsi", namespaceURI = Namespaces.XSI),
+    @XmlNs(prefix = "gmd", namespaceURI = LegacyNamespaces.GMD)
 })
 @XmlAccessorType(XmlAccessType.NONE)
 @XmlJavaTypeAdapters({
+    @XmlJavaTypeAdapter(CI_Citation.class),
+    @XmlJavaTypeAdapter(CI_Responsibility.class),
+    @XmlJavaTypeAdapter(MD_BrowseGraphic.class),
     @XmlJavaTypeAdapter(MD_ClassificationCode.class),
     @XmlJavaTypeAdapter(MD_RestrictionCode.class),
     @XmlJavaTypeAdapter(InternationalStringAdapter.class)
@@ -88,6 +94,8 @@ 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.LegacyNamespaces;
 import org.apache.sis.internal.jaxb.Schemas;
 import org.apache.sis.internal.jaxb.gco.*;
 import org.apache.sis.internal.jaxb.code.*;
+import org.apache.sis.internal.jaxb.metadata.*;

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultAttributeGroup.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultAttributeGroup.java?rev=1818791&r1=1818790&r2=1818791&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultAttributeGroup.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultAttributeGroup.java [UTF-8] Wed Dec 20 13:36:52 2017
@@ -45,14 +45,15 @@ import org.apache.sis.metadata.iso.ISOMe
  *
  * @author  Rémi Maréchal (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.5
+ * @author  Cullen Rombach (Image Matters)
+ * @version 1.0
  * @since   0.5
  * @module
  */
 @SuppressWarnings("CloneableClassWithoutClone")                 // ModifiableMetadata needs shallow clones.
 @XmlType(name = "MD_AttributeGroup_Type", propOrder = {
-    "contentType",
-    "attribute"
+    "contentTypes",
+    "attributes"
 })
 @XmlRootElement(name = "MD_AttributeGroup")
 public class DefaultAttributeGroup extends ISOMetadata implements AttributeGroup {

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java?rev=1818791&r1=1818790&r2=1818791&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultCoverageDescription.java [UTF-8] Wed Dec 20 13:36:52 2017
@@ -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.metadata.Identifier;
 import org.opengis.metadata.content.AttributeGroup;
 import org.opengis.metadata.content.CoverageContentType;
@@ -33,6 +34,9 @@ import org.opengis.util.RecordType;
 import org.apache.sis.xml.Namespaces;
 import org.apache.sis.internal.metadata.Dependencies;
 import org.apache.sis.internal.metadata.LegacyPropertyAdapter;
+import org.apache.sis.internal.jaxb.FilterByVersion;
+import org.apache.sis.internal.jaxb.LegacyNamespaces;
+import org.apache.sis.internal.jaxb.metadata.MD_Identifier;
 
 
 /**
@@ -54,15 +58,18 @@ import org.apache.sis.internal.metadata.
  * @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_CoverageDescription_Type", propOrder = {
     "attributeDescription",
-    "contentType",
-    "dimensions",
+    "processingLevelCode",          // ISO 19115-3
+    "attributeGroup",               // ISO 19115-3
+    "contentType",                  // ISO 19139:2007
+    "dimensions",                   // ISO 19139:2007
     "rangeElementDescriptions"
 })
 @XmlRootElement(name = "MD_CoverageDescription")
@@ -175,13 +182,16 @@ public class DefaultCoverageDescription
 
     /**
      * Returns an identifier for the level of processing that has been applied to the resource, or {@code null} if none.
+     * For {@linkplain DefaultImageDescription image descriptions}, this is the image distributor's code that identifies
+     * the level of radiometric and geometric processing that has been applied.
      *
      * @return identifier for the level of processing that has been applied to the resource, or {@code null} if none.
      *
      * @since 0.5
      */
     @Override
-/// @XmlElement(name = "processingLevelCode")
+    @XmlElement(name = "processingLevelCode")
+    @XmlJavaTypeAdapter(MD_Identifier.Since2014.class)
     public Identifier getProcessingLevelCode() {
         return processingLevelCode;
     }
@@ -206,7 +216,7 @@ public class DefaultCoverageDescription
      * @since 0.5
      */
     @Override
-/// @XmlElement(name = "attributeGroup")
+    // @XmlElement at the end of this class.
     public Collection<AttributeGroup> getAttributeGroups() {
         return attributeGroups = nonNullCollection(attributeGroups, AttributeGroup.class);
     }
@@ -232,22 +242,24 @@ public class DefaultCoverageDescription
      */
     @Override
     @Deprecated
-    @XmlElement(name = "contentType", required = true)
     @Dependencies("getAttributeGroups")
+    @XmlElement(name = "contentType", namespace = LegacyNamespaces.GMD)
     public CoverageContentType getContentType() {
         CoverageContentType type = null;
-        final Collection<AttributeGroup> groups = getAttributeGroups();
-        if (groups != null) {                                               // May be null on marshalling.
-            for (final AttributeGroup g : groups) {
-                final Collection<? extends CoverageContentType> contentTypes = g.getContentTypes();
-                if (contentTypes != null) {                                 // May be null on marshalling.
-                    for (final CoverageContentType t : contentTypes) {
-                        if (type == null) {
-                            type = t;
-                        } else {
-                            LegacyPropertyAdapter.warnIgnoredExtraneous(CoverageContentType.class,
-                                    DefaultCoverageDescription.class, "getContentType");
-                            break;
+        if (FilterByVersion.LEGACY_METADATA.accept()) {
+            final Collection<AttributeGroup> groups = getAttributeGroups();
+            if (groups != null) {                                               // May be null on marshalling.
+                for (final AttributeGroup g : groups) {
+                    final Collection<? extends CoverageContentType> contentTypes = g.getContentTypes();
+                    if (contentTypes != null) {                                 // May be null on marshalling.
+                        for (final CoverageContentType t : contentTypes) {
+                            if (type == null) {
+                                type = t;
+                            } else {
+                                LegacyPropertyAdapter.warnIgnoredExtraneous(CoverageContentType.class,
+                                        DefaultCoverageDescription.class, "getContentType");
+                                break;
+                            }
                         }
                     }
                 }
@@ -297,9 +309,10 @@ public class DefaultCoverageDescription
      */
     @Override
     @Deprecated
-    @XmlElement(name = "dimension")
     @Dependencies("getAttributeGroups")
+    @XmlElement(name = "dimension", namespace = LegacyNamespaces.GMD)
     public final Collection<RangeDimension> getDimensions() {
+        if (!FilterByVersion.LEGACY_METADATA.accept()) return null;
         return new LegacyPropertyAdapter<RangeDimension,AttributeGroup>(getAttributeGroups()) {
             /** Stores a legacy value into the new kind of value. */
             @Override protected AttributeGroup wrap(final RangeDimension value) {
@@ -358,4 +371,28 @@ public class DefaultCoverageDescription
     public void setRangeElementDescriptions(final Collection<? extends RangeElementDescription> newValues) {
         rangeElementDescriptions = writeCollection(newValues, rangeElementDescriptions, RangeElementDescription.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 = "attributeGroup")
+    private Collection<AttributeGroup> getAttributeGroup() {
+        return FilterByVersion.CURRENT_METADATA.accept() ? getAttributeGroups() : null;
+    }
 }

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultImageDescription.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultImageDescription.java?rev=1818791&r1=1818790&r2=1818791&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultImageDescription.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultImageDescription.java [UTF-8] Wed Dec 20 13:36:52 2017
@@ -23,6 +23,8 @@ import javax.xml.bind.annotation.XmlRoot
 import org.opengis.metadata.Identifier;
 import org.opengis.metadata.content.ImageDescription;
 import org.opengis.metadata.content.ImagingCondition;
+import org.apache.sis.internal.jaxb.LegacyNamespaces;
+import org.apache.sis.internal.jaxb.FilterByVersion;
 import org.apache.sis.measure.ValueRange;
 
 import static org.apache.sis.internal.metadata.MetadataUtilities.ensureInRange;
@@ -59,7 +61,7 @@ import static org.apache.sis.internal.me
     "imagingCondition",
     "imageQualityCode",
     "cloudCoverPercentage",
-    "processingLevelCode",
+    "processingLevel",
     "compressionGenerationQuantity",
     "triangulationIndicator",
     "radiometricCalibrationDataAvailable",
@@ -328,29 +330,6 @@ public class DefaultImageDescription ext
     }
 
     /**
-     * Returns the image distributor's code that identifies the level of radiometric and geometric
-     * processing that has been applied.
-     *
-     * @return the level of radiometric and geometric processing that has been applied, or {@code null} if unspecified.
-     */
-    @Override
-    @XmlElement(name = "processingLevelCode")
-    public Identifier getProcessingLevelCode() {
-        return super.getProcessingLevelCode();
-    }
-
-    /**
-     * Sets the image distributor's code that identifies the level of radiometric and geometric
-     * processing that has been applied.
-     *
-     * @param  newValue  the new processing level code.
-     */
-    @Override
-    public void setProcessingLevelCode(final Identifier newValue) {
-        super.setProcessingLevelCode(newValue);
-    }
-
-    /**
      * Returns the count of the number of lossy compression cycles performed on the image.
      *
      * @return the number of lossy compression cycles performed on the image, or {@code null} if unspecified.
@@ -481,4 +460,37 @@ public class DefaultImageDescription ext
         checkWritePermission();
         lensDistortionInformationAvailable = 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.                                              ////////
+    ////////                                                                                  ////////
+    //////////////////////////////////////////////////////////////////////////////////////////////////
+
+    /**
+     * An attribute which was defined in {@code ImageDescription} by ISO 19115:2003,
+     * and which moved to the parent class in ISO 19115:2014 revision. We handle the
+     * two versions separately for proper attribute ordering, and for avoiding this
+     * attribute to be written for subtypes other than {@code ImageDescription}.
+     */
+    @XmlElement(name = "processingLevelCode", namespace = LegacyNamespaces.GMD)
+    private Identifier getProcessingLevel() {
+        return FilterByVersion.LEGACY_METADATA.accept() ? getProcessingLevelCode() : null;
+    }
+
+    /**
+     * Invoked by JAXB at unmarshalling time.
+     */
+    @SuppressWarnings("unused")
+    private void setProcessingLevel(final Identifier newValue) {
+        setProcessingLevelCode(newValue);
+    }
 }



Mime
View raw message