You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2013/08/27 17:48:50 UTC
svn commit: r1517853 - in /sis/branches/JDK7:
core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/
core/sis-utility/src/main/java/org/apache/sis/xml/
profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/
profi...
Author: desruisseaux
Date: Tue Aug 27 15:48:50 2013
New Revision: 1517853
URL: http://svn.apache.org/r1517853
Log:
Removed all remaining reference to the French profile from the core metadata module.
The profile is now fully isolated.
Removed:
sis/branches/JDK7/profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/ReferenceSystemAdapter.java
sis/branches/JDK7/profiles/sis-french-profile/src/main/resources/META-INF/services/org.apache.sis.internal.jaxb.AdapterReplacement
Modified:
sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/RS_ReferenceSystem.java
sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/package-info.java
sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/xml/Namespaces.java
sis/branches/JDK7/profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/package-info.java
sis/branches/JDK7/profiles/sis-french-profile/src/main/java/org/apache/sis/profile/france/FrenchProfile.java
sis/branches/JDK7/profiles/sis-french-profile/src/test/java/org/apache/sis/internal/profile/fra/DirectReferenceSystemTest.java
Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/RS_ReferenceSystem.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/RS_ReferenceSystem.java?rev=1517853&r1=1517852&r2=1517853&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/RS_ReferenceSystem.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/RS_ReferenceSystem.java [UTF-8] Tue Aug 27 15:48:50 2013
@@ -16,10 +16,8 @@
*/
package org.apache.sis.internal.jaxb.metadata;
-import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementRef;
import org.opengis.referencing.ReferenceSystem;
-import org.apache.sis.xml.Namespaces;
import org.apache.sis.internal.jaxb.gco.PropertyType;
@@ -29,10 +27,10 @@ import org.apache.sis.internal.jaxb.gco.
*
* @author Guilhem Legal (Geomatys)
* @since 0.3 (derived from geotk-3.00)
- * @version 0.3
+ * @version 0.4
* @module
*/
-public class RS_ReferenceSystem extends PropertyType<RS_ReferenceSystem, ReferenceSystem> {
+public final class RS_ReferenceSystem extends PropertyType<RS_ReferenceSystem, ReferenceSystem> {
/**
* Empty constructor for JAXB only.
*/
@@ -96,46 +94,4 @@ public class RS_ReferenceSystem extends
public void setElement(final ReferenceSystemMetadata metadata) {
this.metadata = metadata;
}
-
- /**
- * A hook for the French profile.
- *
- * @return The metadata to be marshalled.
- *
- * @todo We need a better plugin mechanism.
- */
- @XmlElement(name = "FRA_DirectReferenceSystem", namespace = Namespaces.FRA)
- public ReferenceSystemMetadata getDirectReferenceSystem() {
- return null;
- }
-
- /**
- * Setter method for the French profile hook.
- *
- * @param metadata The unmarshalled metadata.
- */
- public void setDirectReferenceSystem(final ReferenceSystemMetadata metadata) {
- this.metadata = metadata;
- }
-
- /**
- * A hook for the French profile.
- *
- * @return The metadata to be marshalled.
- *
- * @todo We need a better plugin mechanism.
- */
- @XmlElement(name = "FRA_IndirectReferenceSystem", namespace = Namespaces.FRA)
- public ReferenceSystemMetadata getIndirectReferenceSystem() {
- return null;
- }
-
- /**
- * Setter method for the French profile hook.
- *
- * @param metadata The unmarshalled metadata.
- */
- public void setIndirectReferenceSystem(final ReferenceSystemMetadata metadata) {
- this.metadata = metadata;
- }
}
Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/package-info.java?rev=1517853&r1=1517852&r2=1517853&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/package-info.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/package-info.java [UTF-8] Tue Aug 27 15:48:50 2013
@@ -58,8 +58,7 @@
@XmlSchema(elementFormDefault = XmlNsForm.QUALIFIED, namespace = Namespaces.GMD, xmlns = {
@XmlNs(prefix = "gmd", namespaceURI = Namespaces.GMD),
@XmlNs(prefix = "gco", namespaceURI = Namespaces.GCO),
- @XmlNs(prefix = "xsi", namespaceURI = Namespaces.XSI),
- @XmlNs(prefix = "fra", namespaceURI = Namespaces.FRA)
+ @XmlNs(prefix = "xsi", namespaceURI = Namespaces.XSI)
})
@XmlAccessorType(XmlAccessType.NONE)
package org.apache.sis.internal.jaxb.metadata;
Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/xml/Namespaces.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/xml/Namespaces.java?rev=1517853&r1=1517852&r2=1517853&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/xml/Namespaces.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/xml/Namespaces.java [UTF-8] Tue Aug 27 15:48:50 2013
@@ -25,13 +25,22 @@ import org.apache.sis.util.ArgumentCheck
/**
- * List some namespaces URLs used by JAXB when (un)marshalling.
+ * Lists some namespaces URLs used by JAXB when (un)marshalling.
+ *
+ * {@section Profiles}
+ * Some countries or organizations define profiles of international standards, which may contain
+ * country-specific extensions. The namespace of such extensions are usually defined in a separated
+ * class dedicated to the profile. Some of them are listed below:
+ *
+ * <ul>
+ * <li>{@value org.apache.sis.profile.france.FrenchProfile#NAMESPACE}</li>
+ * </ul>
*
* @author Cédric Briançon (Geomatys)
* @author Quentin Boileau (Geomatys)
* @author Guilhem Legal (Geomatys)
* @since 0.3 (derived from geotk-3.00)
- * @version 0.3
+ * @version 0.4
* @module
*/
public final class Namespaces extends Static {
@@ -131,14 +140,6 @@ public final class Namespaces extends St
public static final String XLINK = "http://www.w3.org/1999/xlink";
/**
- * The <code>{@value}</code> URL.
- * The usual prefix for this namespace is {@code "fra"}.
- *
- * @category Profiles
- */
- public static final String FRA = "http://www.cnig.gouv.fr/2005/fra";
-
- /**
* URLs for which the prefix to use directly follows them.
*/
private static final String[] GENERIC_URLS = {
Modified: sis/branches/JDK7/profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/package-info.java?rev=1517853&r1=1517852&r2=1517853&view=diff
==============================================================================
--- sis/branches/JDK7/profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/package-info.java [UTF-8] (original)
+++ sis/branches/JDK7/profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/package-info.java [UTF-8] Tue Aug 27 15:48:50 2013
@@ -29,7 +29,7 @@
*
* @see org.apache.sis.profile.france
*/
-@XmlSchema(elementFormDefault = XmlNsForm.QUALIFIED, namespace = Namespaces.FRA)
+@XmlSchema(elementFormDefault = XmlNsForm.QUALIFIED, namespace = FrenchProfile.NAMESPACE)
@XmlAccessorType(XmlAccessType.NONE)
@XmlJavaTypeAdapters({
@XmlJavaTypeAdapter(CI_Citation.class)
@@ -43,4 +43,4 @@ import javax.xml.bind.annotation.XmlAcce
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters;
import org.apache.sis.internal.jaxb.metadata.CI_Citation;
-import org.apache.sis.xml.Namespaces;
+import org.apache.sis.profile.france.FrenchProfile;
Modified: sis/branches/JDK7/profiles/sis-french-profile/src/main/java/org/apache/sis/profile/france/FrenchProfile.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/profiles/sis-french-profile/src/main/java/org/apache/sis/profile/france/FrenchProfile.java?rev=1517853&r1=1517852&r2=1517853&view=diff
==============================================================================
--- sis/branches/JDK7/profiles/sis-french-profile/src/main/java/org/apache/sis/profile/france/FrenchProfile.java [UTF-8] (original)
+++ sis/branches/JDK7/profiles/sis-french-profile/src/main/java/org/apache/sis/profile/france/FrenchProfile.java [UTF-8] Tue Aug 27 15:48:50 2013
@@ -31,6 +31,14 @@ import org.apache.sis.util.Static;
*/
public final class FrenchProfile extends Static {
/**
+ * The <code>{@value}</code> URL.
+ * The usual prefix for this namespace is {@code "fra"}.
+ *
+ * @see org.apache.sis.xml.Namespaces
+ */
+ public static final String NAMESPACE = "http://www.cnig.gouv.fr/2005/fra";
+
+ /**
* Do not allow instantiation of this class.
*/
private FrenchProfile() {
Modified: sis/branches/JDK7/profiles/sis-french-profile/src/test/java/org/apache/sis/internal/profile/fra/DirectReferenceSystemTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/profiles/sis-french-profile/src/test/java/org/apache/sis/internal/profile/fra/DirectReferenceSystemTest.java?rev=1517853&r1=1517852&r2=1517853&view=diff
==============================================================================
--- sis/branches/JDK7/profiles/sis-french-profile/src/test/java/org/apache/sis/internal/profile/fra/DirectReferenceSystemTest.java [UTF-8] (original)
+++ sis/branches/JDK7/profiles/sis-french-profile/src/test/java/org/apache/sis/internal/profile/fra/DirectReferenceSystemTest.java [UTF-8] Tue Aug 27 15:48:50 2013
@@ -86,6 +86,11 @@ public final strictfp class DirectRefere
result = (DefaultMetadata) XML.unmarshal(in);
}
final DefaultMetadata expected = createMetadata();
+ /*
+ * Compare in debug mode before to perform the real comparison,
+ * for making easier to analyze the stack trace in case of failure.
+ */
assertTrue(expected.equals(result, ComparisonMode.DEBUG));
+ assertEquals(expected, result);
}
}