sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1823027 - in /sis/branches/ISO-19115-3/core/sis-metadata/src: main/java/org/apache/sis/internal/jaxb/code/ main/java/org/apache/sis/internal/jaxb/gmi/ main/java/org/apache/sis/internal/jaxb/metadata/replace/ main/java/org/apache/sis/metada...
Date Sat, 03 Feb 2018 14:10:21 GMT
Author: desruisseaux
Date: Sat Feb  3 14:10:21 2018
New Revision: 1823027

URL: http://svn.apache.org/viewvc?rev=1823027&view=rev
Log:
Fixed some @XmlNs annotations and first draft of value type verification.
Note that JUnit tests still don't pass; this will be fixed before merge.

Modified:
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/package-info.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/package-info.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ReferenceSystemMetadata.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameter.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/package-info.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/package-info.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/package-info.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-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/package-info.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/package-info.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/package-info.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/package-info.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/package-info.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/package-info.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/package-info.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/package-info.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/test/xml/PackageVerifier.java
    sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/test/xml/SchemaCompliance.java

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/package-info.java?rev=1823027&r1=1823026&r2=1823027&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/package-info.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/package-info.java
[UTF-8] Sat Feb  3 14:10:21 2018
@@ -41,7 +41,6 @@
  * @module
  */
 @XmlSchema(elementFormDefault = XmlNsForm.QUALIFIED, xmlns = {
-    @XmlNs(prefix = "mdb", namespaceURI = Namespaces.MDB),      // Metadata Base
     @XmlNs(prefix = "mri", namespaceURI = Namespaces.MRI),      // Metadata for Resource
Identification
     @XmlNs(prefix = "mrc", namespaceURI = Namespaces.MRC),      // Metadata for Resource
Content
     @XmlNs(prefix = "mrd", namespaceURI = Namespaces.MRD),      // Metadata for Resource
Distribution

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/package-info.java?rev=1823027&r1=1823026&r2=1823027&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/package-info.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gmi/package-info.java
[UTF-8] Sat Feb  3 14:10:21 2018
@@ -37,8 +37,7 @@
  * @module
  */
 @XmlSchema(elementFormDefault = XmlNsForm.QUALIFIED, namespace = Namespaces.GMI, xmlns =
{
-    @XmlNs(prefix = "gmi", namespaceURI = Namespaces.GMI),
-    @XmlNs(prefix = "gco", namespaceURI = Namespaces.GCO)
+    @XmlNs(prefix = "gmi", namespaceURI = Namespaces.GMI)
 })
 @XmlAccessorType(XmlAccessType.NONE)
 package org.apache.sis.internal.jaxb.gmi;

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ReferenceSystemMetadata.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ReferenceSystemMetadata.java?rev=1823027&r1=1823026&r2=1823027&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ReferenceSystemMetadata.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ReferenceSystemMetadata.java
[UTF-8] Sat Feb  3 14:10:21 2018
@@ -18,6 +18,7 @@ package org.apache.sis.internal.jaxb.met
 
 import java.util.Objects;
 import javax.xml.bind.Marshaller;
+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;
@@ -29,6 +30,7 @@ import org.apache.sis.internal.simple.Si
 import org.apache.sis.internal.jaxb.FilterByVersion;
 import org.apache.sis.internal.jaxb.LegacyNamespaces;
 import org.apache.sis.util.ComparisonMode;
+import org.apache.sis.xml.Namespaces;
 
 
 /**
@@ -51,7 +53,8 @@ import org.apache.sis.util.ComparisonMod
  * @since 0.3
  * @module
  */
-@XmlRootElement(name = "MD_ReferenceSystem")
+@XmlType(name = "MD_ReferenceSystem_Type", namespace = Namespaces.MRS)
+@XmlRootElement(name = "MD_ReferenceSystem", namespace = Namespaces.MRS)
 public class ReferenceSystemMetadata extends SimpleIdentifiedObject implements ReferenceSystem
{
     /**
      * For cross-version compatibility.

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameter.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameter.java?rev=1823027&r1=1823026&r2=1823027&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameter.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameter.java
[UTF-8] Sat Feb  3 14:10:21 2018
@@ -236,7 +236,7 @@ public final class ServiceParameter exte
      * Note that there is not setter method, since we expect the same information
      * to be provided in the {@link #name} attribute type.
      */
-    @XmlElement(name = "valueType")
+    @XmlElement(name = "valueType", namespace = LegacyNamespaces.SRV)
     final TypeName getValueType() {
         if (memberName != null && FilterByVersion.LEGACY_METADATA.accept()) {
             return memberName.getAttributeType();

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/package-info.java?rev=1823027&r1=1823026&r2=1823027&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/package-info.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/package-info.java
[UTF-8] Sat Feb  3 14:10:21 2018
@@ -34,12 +34,12 @@
  * @since   0.5
  * @module
  */
-@XmlSchema(elementFormDefault = XmlNsForm.QUALIFIED, namespace = Namespaces.MRS, xmlns =
{
-    @XmlNs(prefix = "mrs", namespaceURI = Namespaces.MRS),
-    @XmlNs(prefix = "mdb", namespaceURI = Namespaces.MDB),
-    @XmlNs(prefix = "srv", namespaceURI = Namespaces.SRV),
-    @XmlNs(prefix = "gco", namespaceURI = Namespaces.GCO),
-    @XmlNs(prefix = "xsi", namespaceURI = Namespaces.XSI)
+@XmlSchema(elementFormDefault = XmlNsForm.QUALIFIED, xmlns = {
+    @XmlNs(prefix = "mcc",  namespaceURI = Namespaces.MCC),        // Metadata Common Classes
+    @XmlNs(prefix = "mrs",  namespaceURI = Namespaces.MRS),        // Metadata for Reference
System
+    @XmlNs(prefix = "srv",  namespaceURI = Namespaces.SRV),        // Metadata for Services
2.0
+    @XmlNs(prefix = "srv1", namespaceURI = LegacyNamespaces.SRV),  // Metadata for Services
1.0
+    @XmlNs(prefix = "gmd",  namespaceURI = LegacyNamespaces.GMD)   // Metadata ISO 19139:2007
 })
 @XmlAccessorType(XmlAccessType.NONE)
 @XmlJavaTypeAdapters({
@@ -62,6 +62,7 @@ import javax.xml.bind.annotation.XmlAcce
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters;
+import org.apache.sis.internal.jaxb.LegacyNamespaces;
 import org.apache.sis.internal.jaxb.metadata.RS_Identifier;
 import org.apache.sis.internal.jaxb.code.SV_ParameterDirection;
 import org.apache.sis.internal.jaxb.gco.*;

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/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/acquisition/package-info.java?rev=1823027&r1=1823026&r2=1823027&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/package-info.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/acquisition/package-info.java
[UTF-8] Sat Feb  3 14:10:21 2018
@@ -93,10 +93,7 @@
  */
 @XmlSchema(location=Schemas.METADATA_XSD_ACQUISITION, elementFormDefault=XmlNsForm.QUALIFIED,
namespace=Namespaces.MAC, xmlns = {
     @XmlNs(prefix = "mac", namespaceURI = Namespaces.MAC),      // Metadata for Acquisition
-    @XmlNs(prefix = "gmw", namespaceURI = Namespaces.GMW),      // Geographic Markup Wrappers
-    @XmlNs(prefix = "mcc", namespaceURI = Namespaces.MCC),      // Metadata Common Classes
-    @XmlNs(prefix = "gco", namespaceURI = Namespaces.GCO),      // Geographic Common
-    @XmlNs(prefix = "xsi", namespaceURI = Namespaces.XSI)       // XML schema instance
+    @XmlNs(prefix = "mcc", namespaceURI = Namespaces.MCC)       // Metadata Common Classes
 })
 @XmlAccessorType(XmlAccessType.NONE)
 @XmlJavaTypeAdapters({

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=1823027&r1=1823026&r2=1823027&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] Sat Feb  3 14:10:21 2018
@@ -93,10 +93,7 @@
  */
 @XmlSchema(location=Schemas.METADATA_XSD_CITATION, elementFormDefault=XmlNsForm.QUALIFIED,
namespace=Namespaces.CIT, xmlns = {
     @XmlNs(prefix = "cit", namespaceURI = Namespaces.CIT),      // Citation and responsible
party information
-    @XmlNs(prefix = "mrd", namespaceURI = Namespaces.MRD),      // Metadata for Resource
Distribution
     @XmlNs(prefix = "mcc", namespaceURI = Namespaces.MCC),      // Metadata Common Classes
-    @XmlNs(prefix = "gco", namespaceURI = Namespaces.GCO),      // Geographic Common
-    @XmlNs(prefix = "xsi", namespaceURI = Namespaces.XSI),      // XML schema instance
     @XmlNs(prefix = "gmd", namespaceURI = LegacyNamespaces.GMD)
 })
 @XmlAccessorType(XmlAccessType.NONE)

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=1823027&r1=1823026&r2=1823027&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] Sat Feb  3 14:10:21 2018
@@ -70,10 +70,7 @@
  */
 @XmlSchema(location=Schemas.METADATA_XSD_CONSTRAINT, elementFormDefault=XmlNsForm.QUALIFIED,
namespace=Namespaces.MCO, xmlns = {
     @XmlNs(prefix = "mco", namespaceURI = Namespaces.MCO),      // Metadata for Constraints
-    @XmlNs(prefix = "mcc", namespaceURI = Namespaces.MCC),      // Metadata Common Classes
-    @XmlNs(prefix = "gco", namespaceURI = Namespaces.GCO),      // Geographic Common
-    @XmlNs(prefix = "xsi", namespaceURI = Namespaces.XSI),      // XML schema instance
-    @XmlNs(prefix = "gmd", namespaceURI = LegacyNamespaces.GMD)
+    @XmlNs(prefix = "mcc", namespaceURI = Namespaces.MCC)       // Metadata Common Classes
 })
 @XmlAccessorType(XmlAccessType.NONE)
 @XmlJavaTypeAdapters({
@@ -94,7 +91,6 @@ 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.*;

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/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/content/package-info.java?rev=1823027&r1=1823026&r2=1823027&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/package-info.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/package-info.java
[UTF-8] Sat Feb  3 14:10:21 2018
@@ -88,12 +88,8 @@
 @XmlSchema(location=Schemas.METADATA_XSD_CONTENT, elementFormDefault=XmlNsForm.QUALIFIED,
namespace=Namespaces.MRC, xmlns = {
     @XmlNs(prefix = "mrc", namespaceURI = Namespaces.MRC),      // Metadata for Resource
Content
     @XmlNs(prefix = "lan", namespaceURI = Namespaces.LAN),      // Language localization
-    @XmlNs(prefix = "fcc", namespaceURI = Namespaces.FCC),      // Feature Catalog Common
     @XmlNs(prefix = "mcc", namespaceURI = Namespaces.MCC),      // Metadata Common Classes
-    @XmlNs(prefix = "gco", namespaceURI = Namespaces.GCO),      // Geographic Common
-    @XmlNs(prefix = "xsi", namespaceURI = Namespaces.XSI),      // XML schema instance
-    @XmlNs(prefix = "gmd", namespaceURI = LegacyNamespaces.GMD),
-    @XmlNs(prefix = "gmi", namespaceURI = LegacyNamespaces.GMI)
+    @XmlNs(prefix = "gmd", namespaceURI = LegacyNamespaces.GMD)
 })
 @XmlAccessorType(XmlAccessType.NONE)
 @XmlJavaTypeAdapters({

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/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/distribution/package-info.java?rev=1823027&r1=1823026&r2=1823027&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/package-info.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/package-info.java
[UTF-8] Sat Feb  3 14:10:21 2018
@@ -78,10 +78,7 @@
     @XmlNs(prefix = "mrd", namespaceURI = Namespaces.MRD),      // Metadata for Resource
Distribution
     @XmlNs(prefix = "mdt", namespaceURI = Namespaces.MDT),      // Metadata for Data Transfer
     @XmlNs(prefix = "mcc", namespaceURI = Namespaces.MCC),      // Metadata Common Classes
-    @XmlNs(prefix = "gmw", namespaceURI = Namespaces.GMW),      // Geographic Markup Wrappers
-    @XmlNs(prefix = "gco", namespaceURI = Namespaces.GCO),      // Geographic Common
-    @XmlNs(prefix = "gcx", namespaceURI = Namespaces.GCX),      // Geospatial Common eXtension
-    @XmlNs(prefix = "xsi", namespaceURI = Namespaces.XSI),      // XML schema instance
+    @XmlNs(prefix = "gmd", namespaceURI = LegacyNamespaces.GMD)
 })
 @XmlAccessorType(XmlAccessType.NONE)
 @XmlJavaTypeAdapters({
@@ -113,6 +110,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.code.*;

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/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/extent/package-info.java?rev=1823027&r1=1823026&r2=1823027&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/package-info.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/package-info.java
[UTF-8] Sat Feb  3 14:10:21 2018
@@ -142,11 +142,7 @@
  */
 @XmlSchema(location=Schemas.METADATA_XSD_EXTENT, elementFormDefault=XmlNsForm.QUALIFIED,
namespace=Namespaces.GEX, xmlns = {
     @XmlNs(prefix = "gex", namespaceURI = Namespaces.GEX),      // Geospatial Extent
-    @XmlNs(prefix = "rce", namespaceURI = Namespaces.RCE),      // Referencing By Coordinates
Common
-    @XmlNs(prefix = "mcc", namespaceURI = Namespaces.MCC),      // Metadata Common Classes
-    @XmlNs(prefix = "gmw", namespaceURI = Namespaces.GMW),      // Geographic Markup Wrappers
-    @XmlNs(prefix = "gco", namespaceURI = Namespaces.GCO),      // Geographic Common
-    @XmlNs(prefix = "xsi", namespaceURI = Namespaces.XSI),      // XML schema instance
+    @XmlNs(prefix = "mcc", namespaceURI = Namespaces.MCC)       // Metadata Common Classes
 })
 @XmlAccessorType(XmlAccessType.NONE)
 @XmlJavaTypeAdapters({

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/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/identification/package-info.java?rev=1823027&r1=1823026&r2=1823027&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/package-info.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/package-info.java
[UTF-8] Sat Feb  3 14:10:21 2018
@@ -101,15 +101,12 @@
  * @module
  */
 @XmlSchema(location=Schemas.METADATA_XSD_IDENTIFICATION, elementFormDefault=XmlNsForm.QUALIFIED,
namespace=Namespaces.MRI, xmlns = {
-    @XmlNs(prefix = "mri", namespaceURI = Namespaces.MRI),      // Metadata for Resource
Identification
-    @XmlNs(prefix = "srv", namespaceURI = Namespaces.SRV),      // Metadata for Services
-    @XmlNs(prefix = "cit", namespaceURI = Namespaces.CIT),      // Citation and responsible
party information
-    @XmlNs(prefix = "lan", namespaceURI = Namespaces.LAN),      // Language localization
-    @XmlNs(prefix = "mcc", namespaceURI = Namespaces.MCC),      // Metadata Common Classes
-    @XmlNs(prefix = "gco", namespaceURI = Namespaces.GCO),      // Geographic Common
-    @XmlNs(prefix = "gmw", namespaceURI = Namespaces.GMW),      // Geographic Markup Wrappers
-    @XmlNs(prefix = "xsi", namespaceURI = Namespaces.XSI),      // XML schema instance
-    @XmlNs(prefix = "gmd", namespaceURI = LegacyNamespaces.GMD)
+    @XmlNs(prefix = "mri",  namespaceURI = Namespaces.MRI),        // Metadata for Resource
Identification
+    @XmlNs(prefix = "srv",  namespaceURI = Namespaces.SRV),        // Metadata for Services
2.0
+    @XmlNs(prefix = "lan",  namespaceURI = Namespaces.LAN),        // Language localization
+    @XmlNs(prefix = "mcc",  namespaceURI = Namespaces.MCC),        // Metadata Common Classes
+    @XmlNs(prefix = "gmd",  namespaceURI = LegacyNamespaces.GMD),  // Metadata ISO 19139:2007
+    @XmlNs(prefix = "srv1", namespaceURI = LegacyNamespaces.SRV)   // Metadata for Services
1.0
 })
 @XmlAccessorType(XmlAccessType.NONE)
 @XmlJavaTypeAdapters({

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/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/lineage/package-info.java?rev=1823027&r1=1823026&r2=1823027&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/package-info.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/lineage/package-info.java
[UTF-8] Sat Feb  3 14:10:21 2018
@@ -73,10 +73,8 @@
 @XmlSchema(location=Schemas.METADATA_XSD_LINEAGE, elementFormDefault=XmlNsForm.QUALIFIED,
namespace=Namespaces.MRL, xmlns = {
     @XmlNs(prefix = "mrl", namespaceURI = Namespaces.MRL),      // Metadata for Resource
Lineage
     @XmlNs(prefix = "mcc", namespaceURI = Namespaces.MCC),      // Metadata Common Classes
-    @XmlNs(prefix = "gmw", namespaceURI = Namespaces.GMW),      // Geographic Markup Wrappers
-    @XmlNs(prefix = "gco", namespaceURI = Namespaces.GCO),      // Geographic Common
-    @XmlNs(prefix = "gcx", namespaceURI = Namespaces.GCX),      // Geospatial Common eXtension
-    @XmlNs(prefix = "xsi", namespaceURI = Namespaces.XSI),      // XML schema instance
+    @XmlNs(prefix = "gmd", namespaceURI = LegacyNamespaces.GMD),
+    @XmlNs(prefix = "gmi", namespaceURI = LegacyNamespaces.GMI)
 })
 @XmlAccessorType(XmlAccessType.NONE)
 @XmlJavaTypeAdapters({
@@ -107,6 +105,7 @@ import javax.xml.bind.annotation.adapter
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters;
 
 import org.apache.sis.xml.Namespaces;
+import org.apache.sis.internal.jaxb.LegacyNamespaces;
 import org.apache.sis.internal.jaxb.Schemas;
 import org.apache.sis.internal.jaxb.gco.*;
 import org.apache.sis.internal.jaxb.metadata.*;

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/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/maintenance/package-info.java?rev=1823027&r1=1823026&r2=1823027&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/package-info.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/package-info.java
[UTF-8] Sat Feb  3 14:10:21 2018
@@ -70,9 +70,7 @@
 @XmlSchema(location=Schemas.METADATA_XSD_MAINTENANCE, elementFormDefault=XmlNsForm.QUALIFIED,
namespace=Namespaces.MMI, xmlns = {
     @XmlNs(prefix = "mmi", namespaceURI = Namespaces.MMI),      // Metadata for Maintenance
Information
     @XmlNs(prefix = "mcc", namespaceURI = Namespaces.MCC),      // Metadata Common Classes
-    @XmlNs(prefix = "gmw", namespaceURI = Namespaces.GMW),      // Geographic Markup Wrappers
-    @XmlNs(prefix = "gco", namespaceURI = Namespaces.GCO),      // Geographic Common
-    @XmlNs(prefix = "xsi", namespaceURI = Namespaces.XSI),      // XML schema instance
+    @XmlNs(prefix = "gmd", namespaceURI = LegacyNamespaces.GMD)
 })
 @XmlAccessorType(XmlAccessType.NONE)
 @XmlJavaTypeAdapters({
@@ -103,6 +101,7 @@ import javax.xml.bind.annotation.adapter
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters;
 
 import org.apache.sis.xml.Namespaces;
+import org.apache.sis.internal.jaxb.LegacyNamespaces;
 import org.apache.sis.internal.jaxb.Schemas;
 import org.apache.sis.internal.jaxb.gco.*;
 import org.apache.sis.internal.jaxb.code.*;

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/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/package-info.java?rev=1823027&r1=1823026&r2=1823027&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/package-info.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/package-info.java
[UTF-8] Sat Feb  3 14:10:21 2018
@@ -91,11 +91,9 @@
     @XmlNs(prefix = "mpc", namespaceURI = Namespaces.MPC),      // Metadata for Portrayal
Catalog
     @XmlNs(prefix = "mas", namespaceURI = Namespaces.MAS),      // Metadata for Application
Schema
     @XmlNs(prefix = "mex", namespaceURI = Namespaces.MEX),      // Metadata with Schema Extensions
-    @XmlNs(prefix = "cit", namespaceURI = Namespaces.CIT),      // Citation and responsible
party information
     @XmlNs(prefix = "lan", namespaceURI = Namespaces.LAN),      // Language localization
     @XmlNs(prefix = "mcc", namespaceURI = Namespaces.MCC),      // Metadata Common Classes
-    @XmlNs(prefix = "gco", namespaceURI = Namespaces.GCO),      // Geographic Common
-    @XmlNs(prefix = "xsi", namespaceURI = Namespaces.XSI),      // XML schema instance
+    @XmlNs(prefix = "dqc", namespaceURI = Namespaces.DQC),      // Data Quality Common Classes
     @XmlNs(prefix = "gmd", namespaceURI = LegacyNamespaces.GMD)
 })
 @XmlAccessorType(XmlAccessType.NONE)

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/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/quality/package-info.java?rev=1823027&r1=1823026&r2=1823027&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/package-info.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/quality/package-info.java
[UTF-8] Sat Feb  3 14:10:21 2018
@@ -116,11 +116,9 @@
  */
 @XmlSchema(location=Schemas.METADATA_XSD_QUALITY, elementFormDefault=XmlNsForm.QUALIFIED,
namespace=Namespaces.MDQ, xmlns = {
     @XmlNs(prefix = "mdq", namespaceURI = Namespaces.MDQ),      // Metadata for Data Quality
-    @XmlNs(prefix = "mrc", namespaceURI = Namespaces.MRC),      // Metadata for Resource
Content
     @XmlNs(prefix = "mrd", namespaceURI = Namespaces.MRD),      // Metadata for Resource
Distribution
-    @XmlNs(prefix = "cit", namespaceURI = Namespaces.CIT),      // Citation and responsible
party information
-    @XmlNs(prefix = "gco", namespaceURI = Namespaces.GCO),      // Geographic Common
-    @XmlNs(prefix = "xsi", namespaceURI = Namespaces.XSI),      // XML schema instance
+    @XmlNs(prefix = "dqc", namespaceURI = Namespaces.DQC),      // Data Quality Common Classes
+    @XmlNs(prefix = "mcc", namespaceURI = Namespaces.MCC),      // Metadata Common Classes
     @XmlNs(prefix = "gmd", namespaceURI = LegacyNamespaces.GMD),
     @XmlNs(prefix = "gmi", namespaceURI = LegacyNamespaces.GMI)
 })

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/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/spatial/package-info.java?rev=1823027&r1=1823026&r2=1823027&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/package-info.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/package-info.java
[UTF-8] Sat Feb  3 14:10:21 2018
@@ -91,10 +91,7 @@
 @XmlSchema(location=Schemas.METADATA_XSD_SPATIAL, elementFormDefault=XmlNsForm.QUALIFIED,
namespace=Namespaces.MSR, xmlns = {
     @XmlNs(prefix = "msr", namespaceURI = Namespaces.MSR),      // Metadata for Spatial Representation
     @XmlNs(prefix = "mcc", namespaceURI = Namespaces.MCC),      // Metadata Common Classes
-    @XmlNs(prefix = "dqc", namespaceURI = Namespaces.DQC),      // Data Quality Common Classes
-    @XmlNs(prefix = "gmw", namespaceURI = Namespaces.GMW),      // Geographic Markup Wrappers
-    @XmlNs(prefix = "gco", namespaceURI = Namespaces.GCO),      // Geographic Common
-    @XmlNs(prefix = "xsi", namespaceURI = Namespaces.XSI),      // XML schema instance
+    @XmlNs(prefix = "dqc", namespaceURI = Namespaces.DQC)       // Data Quality Common Classes
 })
 @XmlAccessorType(XmlAccessType.NONE)
 @XmlJavaTypeAdapters({

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/test/xml/PackageVerifier.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/test/xml/PackageVerifier.java?rev=1823027&r1=1823026&r2=1823027&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/test/xml/PackageVerifier.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/test/xml/PackageVerifier.java
[UTF-8] Sat Feb  3 14:10:21 2018
@@ -21,6 +21,7 @@ import java.util.Map;
 import java.util.HashMap;
 import java.lang.reflect.Method;
 import java.util.Arrays;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
@@ -32,6 +33,8 @@ import javax.xml.bind.annotation.XmlRoot
 import javax.xml.parsers.ParserConfigurationException;
 import org.xml.sax.SAXException;
 import org.apache.sis.internal.jaxb.LegacyNamespaces;
+import org.apache.sis.util.Classes;
+import org.opengis.annotation.UML;
 
 
 /**
@@ -51,6 +54,20 @@ final strictfp class PackageVerifier {
             Arrays.asList(LegacyNamespaces.GMD, LegacyNamespaces.GMI, LegacyNamespaces.SRV)));
 
     /**
+     * Types declared in JAXB annotations to be considered as equivalent to types in XML
schemas.
+     */
+    private static final Map<String,String> TYPE_EQUIVALENCES;
+    static {
+        final Map<String,String> m = new HashMap<>();
+        m.put("PT_FreeText",             "CharacterString");
+        m.put("Abstract_Citation",       "CI_Citation");
+        m.put("AbstractCI_Party",        "CI_Party");
+        m.put("Abstract_Responsibility", "CI_Responsibility");
+        m.put("Abstract_Extent",         "EX_Extent");
+        TYPE_EQUIVALENCES = Collections.unmodifiableMap(m);
+    }
+
+    /**
      * The schemas to compare with the JAXB annotations.
      * Additional schemas will be loaded as needed.
      */
@@ -98,10 +115,10 @@ final strictfp class PackageVerifier {
                     final String ns = xmlns.namespaceURI();
                     final String cr = schemas.allXmlNS.put(pr, ns);
                     if (cr != null && !cr.equals(ns)) {
-                        throw new SchemaException("Prefix \"" + pr + "\" associated to two
different namespaces:\n" + cr + '\n' + ns);
+                        throw new SchemaException(String.format("Prefix \"%s\" associated
to two different namespaces:%n%s%n%s", pr, cr, ns));
                     }
                     if (namespaceIsUsed.put(ns, Boolean.FALSE) != null) {
-                        throw new SchemaException("Duplicated namespace in package " + name
+ ":\n" + ns);
+                        throw new SchemaException(String.format("Duplicated namespace in
package %s:%n%s", name, ns));
                     }
                 }
             }
@@ -185,7 +202,7 @@ final strictfp class PackageVerifier {
         }
         final String expectedNS = properties.get(null).namespace;
         if (!namespace.equals(expectedNS)) {
-            throw new SchemaException(className + " shall be associated to namespace " +
expectedNS);
+            throw new SchemaException(String.format("%s shall be associated to namespace
%s", className, expectedNS));
         }
         for (final Method method : type.getDeclaredMethods()) {
             final XmlElement element = method.getDeclaredAnnotation(XmlElement.class);
@@ -197,32 +214,77 @@ final strictfp class PackageVerifier {
             if (ns.equals(AnnotationConsistencyCheck.DEFAULT)) {
                 ns = namespace;
             }
+            if (namespaceIsUsed.put(ns, Boolean.TRUE) == null) {
+                throw new SchemaException(String.format("Missing @XmlNs in %s package for
namespace:%n%s", packageName, ns));
+            }
             /*
              * We do not verify fully the properties in legacy namespaces because we didn't
loaded their schemas.
              * However we verify at least that those properties are not declared as required.
              */
             if (LEGACY_NAMESPACES.contains(ns)) {
                 if (element.required()) {
-                    throw new SchemaException("Legacy property " + className + '.' + name
+ " should not be required.");
+                    throw new SchemaException(String.format("Legacy property %s.%s should
not be required.", className, name));
                 }
                 continue;                               // Property in a legacy namespace
- skip it.
             }
             /*
-             * Property in non-legacy namespaces should not be deprecated. Verify also their
namespace.
+             * Property in non-legacy namespaces should not be deprecated. Verify also their
namespace
+             * and whether the property is required or optional, and whether it should be
a collection.
              */
             if (method.isAnnotationPresent(Deprecated.class)) {
-                throw new SchemaException("Unexpected deprecation status of " + className
+ '.' + name);
+                throw new SchemaException(String.format("Unexpected deprecation status of
%s.%s", className, name));
             }
             final SchemaCompliance.Info info = properties.get(name);
             if (info == null) {
-                throw new SchemaException("Unexpected XML element " + className + '.' + name);
+                throw new SchemaException(String.format("Unexpected XML element %s.%s", className,
name));
             }
             if (info.namespace != null && !ns.equals(info.namespace)) {
-                throw new SchemaException(className + '.' + name + " is associated to namespace
" + ns
-                        + " while " + info.namespace + " was expected.");
+                throw new SchemaException(String.format("%s.%s is associated to namespace
%s while %s was expected.",
+                                                        className, name, ns, info.namespace));
             }
             if (element.required() != info.isRequired) {
-                throw new SchemaException("Wrong requirement flag for " + className + '.'
+ name);
+                throw new SchemaException(String.format("Wrong requirement flag for %s.%s",
className, name));
+            }
+            /*
+             * Following is a continuation of our check for cardinality, but also the beginning
of the check
+             * for return value type. The return type should be an interface with a UML annotation;
we check
+             * that this annotation contains the name of the expected type.
+             */
+            Class<?> valueType = method.getReturnType();
+            if (Collection.class.isAssignableFrom(valueType)) {
+                valueType = Classes.boundOfParameterizedProperty(method);
+                if (!info.isCollection) {
+                    if (false)  // Temporarily disabled because require GeoAPI modifications.
+                    throw new SchemaException(String.format("%s.%s should be a singleton.",
className, name));
+                }
+            } else if (info.isCollection) {
+                if (false)  // Temporarily disabled because require GeoAPI modifications.
+                throw new SchemaException(String.format("%s.%s should be a collection.",
className, name));
+            }
+            if (valueType != null) {
+                final UML valueUML = valueType.getAnnotation(UML.class);
+                if (valueUML != null) {
+                    String expected = info.typeName;
+                    String actual   = valueUML.identifier();
+                    expected = TYPE_EQUIVALENCES.getOrDefault(expected, expected);
+                    actual   = TYPE_EQUIVALENCES.getOrDefault(actual,   actual);
+                    if (!expected.equals(actual)) {
+                        if (false)  // Temporarily disabled because require GeoAPI modifications.
+                        throw new SchemaException(String.format("Type of %s.%s should be
%s, but found %s.",
+                                                                className, name, expected,
actual));
+                    }
+                }
+            }
+            /*
+             * Verify if we have a @XmlNs for the type of the value. This is probably not
required, but we
+             * do that as a safety. A common namespace added by this check is Metadata Common
Classes (MCC).
+             */
+            final Map<String, SchemaCompliance.Info> valueInfo = schemas.typeDefinition(info.typeName);
+            if (valueInfo != null) {
+                final String valueNS = valueInfo.get(null).namespace;
+                if (namespaceIsUsed.put(valueNS, Boolean.TRUE) == null) {
+                    throw new SchemaException(String.format("Missing @XmlNs in %s package
for namespace:%n%s", packageName, valueNS));
+                }
             }
         }
     }
@@ -233,8 +295,7 @@ final strictfp class PackageVerifier {
     final void reportUnused() throws SchemaException {
         for (final Map.Entry<String,Boolean> entry : namespaceIsUsed.entrySet()) {
             if (!entry.getValue()) {
-//              TODO: to be enabled after we processed properties.
-//              throw new SchemaException("Unused namespace in package " + packageName +
":\n" + entry.getKey());
+                throw new SchemaException(String.format("Unused namespace in package %s:%n%s",
packageName, entry.getKey()));
             }
         }
     }

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/test/xml/SchemaCompliance.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/test/xml/SchemaCompliance.java?rev=1823027&r1=1823026&r2=1823027&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/test/xml/SchemaCompliance.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/test/xml/SchemaCompliance.java
[UTF-8] Sat Feb  3 14:10:21 2018
@@ -256,7 +256,7 @@ public final strictfp class SchemaCompli
      * The given directory must be a sub-directory of the root directory given at construction
time.
      * This method will invoke itself for scanning sub-directories.
      *
-     * @param  directory  the directory to scan for classes.
+     * @param  directory  the directory to scan for classes, relative to class root directory.
      * @throws IOException if an error occurred while reading files or schemas.
      * @throws ClassNotFoundException if an error occurred while loading a {@code "*.class"}
file.
      * @throws ParserConfigurationException if {@link javax.xml.parsers.DocumentBuilder} can
not be created.
@@ -268,7 +268,7 @@ public final strictfp class SchemaCompli
             throws IOException, ClassNotFoundException, ParserConfigurationException, SAXException,
SchemaException
     {
         PackageVerifier verifier = null;
-        try (DirectoryStream<Path> stream = Files.newDirectoryStream(directory)) {
+        try (DirectoryStream<Path> stream = Files.newDirectoryStream(classRootDirectory.resolve(directory)))
{
             for (Path path : stream) {
                 final String filename = path.getFileName().toString();
                 if (!filename.startsWith(".")) {
@@ -358,7 +358,7 @@ public final strictfp class SchemaCompli
                         properties.put(null, info);     // Remember namespace of the code
list.
                         properties.put(name, info);     // Pseudo-property used in our CodeList
adapters.
                         if (typeDefinitions.put(name, properties) != null) {
-                            throw new SchemaException("Code list " + name + " defined twice.");
+                            throw new SchemaException(String.format("Code list \"%s\" is
defined twice.", name));
                         }
                     } else {
                         verifyNamingConvention(schemaLocations.getLast(), name, type, TYPE_SUFFIX);
@@ -477,9 +477,10 @@ public final strictfp class SchemaCompli
      * Verifies that the relationship between the name of the given entity and its type are
consistent with
      * OGC/ISO conventions. This method ignore the prefix (e.g. {@code "mdb:"} in {@code
"mdb:MD_Metadata"}).
      *
-     * @param  name    the class or property name. Example: {@code "MD_Metadata"}, {@code
"citation"}.
-     * @param  type    the type of the above named object. Example: {@code "MD_Metadata_Type"},
{@code "CI_Citation_PropertyType"}.
-     * @param  suffix  the expected suffix at the end of {@code type}.
+     * @param  enclosing  schema or other container where the error happened.
+     * @param  name       the class or property name. Example: {@code "MD_Metadata"}, {@code
"citation"}.
+     * @param  type       the type of the above named object. Example: {@code "MD_Metadata_Type"},
{@code "CI_Citation_PropertyType"}.
+     * @param  suffix     the expected suffix at the end of {@code type}.
      * @throws SchemaException if the given {@code name} and {@code type} are not compliant
with expected convention.
      */
     static void verifyNamingConvention(final String enclosing,
@@ -498,9 +499,9 @@ public final strictfp class SchemaCompli
                 return;
             }
         }
-        throw new SchemaException("Error in " + enclosing + ":\n"
-                + "The type name should be the name with \"" + suffix + "\" suffix, "
-                + "but found name=\"" + name + "\" and type=\"" + type + "\">.");
+        throw new SchemaException(String.format("Error in %s:%n" +
+                "The type name should be the name with \"%s\" suffix, but found name=\"%s\"
and type=\"%s\">.",
+                enclosing, suffix, name, type));
     }
 
     /**
@@ -511,9 +512,9 @@ public final strictfp class SchemaCompli
         final Info info = new Info(type, targetNamespace, isRequired, isCollection);
         final Info old = currentProperties.put(name, info);
         if (old != null && !old.equal(info)) {
-            throw new SchemaException("Error while parsing " + schemaLocations.getLast()
+ ":\n"
-                    + "Property \"" + name + "\" is associated to type \"" + type + "\",
but that "
-                    + "property was already associated to \"" + old + "\".");
+            throw new SchemaException(String.format("Error while parsing %s:%n" +
+                    "Property \"%s\" is associated to type \"%s\", but that property was
already associated to \"%s\".",
+                    schemaLocations.getLast(), name, type, old));
         }
     }
 
@@ -532,7 +533,7 @@ public final strictfp class SchemaCompli
         if (name.endsWith(suffix)) {
             return name.substring(name.indexOf(PREFIX_SEPARATOR) + 1, name.length() - suffix.length());
         }
-        throw new SchemaException("Expected a name ending with \"" + suffix + "\" but got
\"" + name + "\".");
+        throw new SchemaException(String.format("Expected a name ending with \"%s\" but got
\"%s\".", suffix, name));
     }
 
     /**
@@ -550,7 +551,7 @@ public final strictfp class SchemaCompli
                 }
             }
         }
-        throw new SchemaException("Node " + node.getNodeName() + " should have a '" + name
+ "' attribute.");
+        throw new SchemaException(String.format("Node \"%s\" should have a '%s' attribute.",
node.getNodeName(), name));
     }
 
     /**



Mime
View raw message