sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1673206 - in /sis/branches/JDK8/core: sis-metadata/src/main/java/org/apache/sis/metadata/iso/ sis-metadata/src/test/java/org/apache/sis/metadata/iso/ sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/ sis-referenci...
Date Mon, 13 Apr 2015 14:31:19 GMT
Author: desruisseaux
Date: Mon Apr 13 14:31:18 2015
New Revision: 1673206

URL: http://svn.apache.org/r1673206
Log:
Remove ImmutableIdentifier.remarks, which is replaced by 'description' (SIS-198).
Allows parameters to be declared deprecated.
Review Mercator parameters, declaring "scale_factor" in Mercator2SP as a deprecated parameter.

Modified:
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
    sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ImmutableIdentifierTest.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator1SP.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator2SP.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MercatorSpherical.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/RegionalMercator.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/Builder.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/DeprecatedCode.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/DeprecatedName.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/NamedIdentifier.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/CoordinateOperationMethodsHTML.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/MapProjectionTest.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/NamedIdentifierTest.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/HTMLGenerator.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Deprecable.java

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java?rev=1673206&r1=1673205&r2=1673206&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java [UTF-8] Mon Apr 13 14:31:18 2015
@@ -25,7 +25,6 @@ import org.opengis.metadata.Identifier;
 import org.opengis.metadata.citation.Citation;
 import org.opengis.parameter.ParameterValue;
 import org.opengis.util.InternationalString;
-import org.apache.sis.util.Deprecable;
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.util.iso.Types;
 import org.apache.sis.metadata.iso.citation.Citations;
@@ -39,7 +38,6 @@ import org.apache.sis.io.wkt.ElementKind
 import static org.apache.sis.util.ArgumentChecks.ensureNonNull;
 import static org.apache.sis.util.CharSequences.trimWhitespaces;
 import static org.apache.sis.util.collection.Containers.property;
-import static org.opengis.referencing.IdentifiedObject.REMARKS_KEY;
 
 // Branch-dependent imports
 import java.util.Objects;
@@ -129,7 +127,7 @@ import java.util.Objects;
  * @see DefaultIdentifier
  */
 @XmlRootElement(name = "RS_Identifier")
-public class ImmutableIdentifier extends FormattableObject implements Identifier, Deprecable, Serializable {
+public class ImmutableIdentifier extends FormattableObject implements Identifier, Serializable {
     /**
      * For cross-version compatibility.
      */
@@ -179,13 +177,6 @@ public class ImmutableIdentifier extends
     private final InternationalString description;
 
     /**
-     * Comments on or information about this identifier, or {@code null} if none.
-     *
-     * @see #getRemarks()
-     */
-    private final InternationalString remarks;
-
-    /**
      * Empty constructor for JAXB.
      */
     private ImmutableIdentifier() {
@@ -194,13 +185,11 @@ public class ImmutableIdentifier extends
         authority   = null;
         version     = null;
         description = null;
-        remarks     = null;
     }
 
     /**
-     * Creates a new identifier from the specified one. This is a copy constructor
-     * which will get the code, codespace, authority, version and (if available)
-     * the remarks from the given identifier.
+     * Creates a new identifier from the specified one. This is a copy constructor which
+     * get the code, codespace, authority and version from the given identifier.
      *
      * @param identifier The identifier to copy.
      */
@@ -211,11 +200,6 @@ public class ImmutableIdentifier extends
         authority   = identifier.getAuthority();
         version     = identifier.getVersion();
         description = identifier.getDescription();
-        if (identifier instanceof Deprecable) {
-            remarks = ((Deprecable) identifier).getRemarks();
-        } else {
-            remarks = null;
-        }
         validate(null);
     }
 
@@ -238,7 +222,7 @@ public class ImmutableIdentifier extends
 
     /**
      * Creates a new identifier from the specified code and authority,
-     * with an optional version number and remarks.
+     * with an optional version number and description.
      *
      * @param authority
      *          Organization or party responsible for definition and maintenance of the code
@@ -252,18 +236,17 @@ public class ImmutableIdentifier extends
      * @param version
      *          The version of the associated code space or code as specified by the code authority,
      *          or {@code null} if none.
-     * @param remarks
-     *          Comments on or information about this identifier, or {@code null} if none.
+     * @param description
+     *          Natural language description of the meaning of the code value, or {@code null} if none.
      */
     public ImmutableIdentifier(final Citation authority, final String codeSpace,
-            final String code, final String version, final InternationalString remarks)
+            final String code, final String version, final InternationalString description)
     {
         this.code        = code;
         this.codeSpace   = codeSpace;
         this.authority   = authority;
         this.version     = version;
-        this.description = null;
-        this.remarks     = remarks;
+        this.description = description;
         validate(null);
     }
 
@@ -306,11 +289,6 @@ public class ImmutableIdentifier extends
      *     <td>{@link #getDescription()}</td>
      *   </tr>
      *   <tr>
-     *     <td>{@value org.opengis.referencing.IdentifiedObject#REMARKS_KEY}</td>
-     *     <td>{@link String} or {@link InternationalString}</td>
-     *     <td>{@link #getRemarks()}</td>
-     *   </tr>
-     *   <tr>
      *     <td>{@value org.apache.sis.referencing.AbstractIdentifiedObject#LOCALE_KEY}</td>
      *     <td>{@link Locale}</td>
      *     <td>(none)</td>
@@ -318,10 +296,10 @@ public class ImmutableIdentifier extends
      * </table>
      *
      * <div class="section">Localization</div>
-     * {@code "remarks"} is a localizable attributes which may have a language and country
-     * code suffix. For example the {@code "remarks_fr"} property stands for remarks in
-     * {@linkplain Locale#FRENCH French} and the {@code "remarks_fr_CA"} property stands
-     * for remarks in {@linkplain Locale#CANADA_FRENCH French Canadian}.
+     * {@code "description"} is a localizable attributes which may have a language and country
+     * code suffix. For example the {@code "description_fr"} property stands for description in
+     * {@linkplain Locale#FRENCH French} and the {@code "description_fr_CA"} property stands
+     * for description in {@linkplain Locale#CANADA_FRENCH French Canadian}.
      *
      * <p>The {@code "locale"} property applies only to exception messages, if any.
      * After successful construction, {@code ImmutableIdentifier} instances do not keep the locale
@@ -335,7 +313,6 @@ public class ImmutableIdentifier extends
         code        = trimWhitespaces(  property (properties, CODE_KEY,    String.class));
         version     = trimWhitespaces(  property (properties, VERSION_KEY, String.class));
         description = Types.toInternationalString(properties, DESCRIPTION_KEY);
-        remarks     = Types.toInternationalString(properties, REMARKS_KEY);
         /*
          * Map String authority to one of the pre-defined constants (typically EPSG or OGC).
          */
@@ -490,10 +467,13 @@ public class ImmutableIdentifier extends
      * <div class="note"><b>Example:</b> "superseded by code XYZ".</div>
      *
      * @return Optional comments about this identifier, or {@code null} if none.
+     *
+     * @deprecated Replaced by {@link #getDescription()} for non-deprecated identifiers, or by
+     *             {@link org.apache.sis.util.Deprecable#getRemarks()} for identifiers that may be deprecated.
      */
-    @Override
+    @Deprecated
     public InternationalString getRemarks() {
-        return remarks;
+        return description;
     }
 
     /**
@@ -505,8 +485,11 @@ public class ImmutableIdentifier extends
      * @see org.apache.sis.referencing.AbstractIdentifiedObject#isDeprecated()
      *
      * @return {@code true} if this code is deprecated.
+     *
+     * @deprecated Moved to {@link org.apache.sis.util.Deprecable#isDeprecated()} if this
+     *             {@code ImmutableIdentifier} instance implements {@code Deprecable}.
      */
-    @Override
+    @Deprecated
     public boolean isDeprecated() {
         return false;
     }
@@ -539,11 +522,11 @@ public class ImmutableIdentifier extends
         }
         if (object != null && object.getClass() == getClass()) {
             final ImmutableIdentifier that = (ImmutableIdentifier) object;
-            return Objects.equals(code,      that.code)      &&
-                   Objects.equals(codeSpace, that.codeSpace) &&
-                   Objects.equals(authority, that.authority) &&
-                   Objects.equals(version,   that.version)   &&
-                   Objects.equals(remarks,   that.remarks);
+            return Objects.equals(code,        that.code)      &&
+                   Objects.equals(codeSpace,   that.codeSpace) &&
+                   Objects.equals(authority,   that.authority) &&
+                   Objects.equals(version,     that.version)   &&
+                   Objects.equals(description, that.description);
         }
         return false;
     }

Modified: sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ImmutableIdentifierTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ImmutableIdentifierTest.java?rev=1673206&r1=1673205&r2=1673206&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ImmutableIdentifierTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/ImmutableIdentifierTest.java [UTF-8] Mon Apr 13 14:31:18 2015
@@ -41,7 +41,7 @@ import static org.opengis.metadata.Ident
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.4
+ * @version 0.6
  * @module
  */
 @DependsOn({
@@ -54,18 +54,18 @@ public final strictfp class ImmutableIde
      */
     private static Map<String,Object> properties() {
         final Map<String,Object> properties = new HashMap<>();
-        assertNull(properties.put(CODE_KEY,        "This is a code"));
-        assertNull(properties.put(AUTHORITY_KEY,   "This is an authority"));
-        assertNull(properties.put(VERSION_KEY,     "This is a version"));
-        assertNull(properties.put("dummy",         "Doesn't matter"));
-        assertNull(properties.put("remarks",       "There is remarks"));
-        assertNull(properties.put("remarks_fr",    "Voici des remarques"));
-        assertNull(properties.put("remarks_fr_CA", "Pareil"));
+        assertNull(properties.put(CODE_KEY,            "This is a code"));
+        assertNull(properties.put(AUTHORITY_KEY,       "This is an authority"));
+        assertNull(properties.put(VERSION_KEY,         "This is a version"));
+        assertNull(properties.put("dummy",             "Doesn't matter"));
+        assertNull(properties.put("description",       "There is a description"));
+        assertNull(properties.put("description_fr",    "Voici une description"));
+        assertNull(properties.put("description_fr_CA", "Pareil"));
         return properties;
     }
 
     /**
-     * Tests the constructor with only {@link String} values, including localized remarks.
+     * Tests the constructor with only {@link String} values, including a localized description.
      */
     @Test
     public void testConstructorWithStringValues() {
@@ -73,34 +73,34 @@ public final strictfp class ImmutableIde
         final ImmutableIdentifier identifier = new ImmutableIdentifier(properties);
         Validators.validate(identifier);
 
-        assertEquals(CODE_KEY,        "This is a code",       identifier.getCode());
-        assertNull  (CODESPACE_KEY,                           identifier.getCodeSpace());
-        assertEquals(AUTHORITY_KEY,   "This is an authority", identifier.getAuthority().getTitle().toString());
-        assertEquals(VERSION_KEY,     "This is a version",    identifier.getVersion());
-        assertEquals("remarks",       "There is remarks",     identifier.getRemarks().toString(Locale.ENGLISH));
-        assertEquals("remarks_fr",    "Voici des remarques",  identifier.getRemarks().toString(Locale.FRENCH));
-        assertEquals("remarks_fr_CA", "Pareil",               identifier.getRemarks().toString(Locale.CANADA_FRENCH));
-        assertEquals("remarks_fr_BE", "Voici des remarques",  identifier.getRemarks().toString(new Locale("fr", "BE")));
+        assertEquals(CODE_KEY,            "This is a code",         identifier.getCode());
+        assertNull  (CODESPACE_KEY,                                 identifier.getCodeSpace());
+        assertEquals(AUTHORITY_KEY,       "This is an authority",   identifier.getAuthority().getTitle().toString());
+        assertEquals(VERSION_KEY,         "This is a version",      identifier.getVersion());
+        assertEquals("description",       "There is a description", identifier.getDescription().toString(Locale.ENGLISH));
+        assertEquals("description_fr",    "Voici une description",  identifier.getDescription().toString(Locale.FRENCH));
+        assertEquals("description_fr_CA", "Pareil",                 identifier.getDescription().toString(Locale.CANADA_FRENCH));
+        assertEquals("description_fr_BE", "Voici une description",  identifier.getDescription().toString(new Locale("fr", "BE")));
     }
 
     /**
-     * Tests the constructor with the {@code "remarks"} attribute as a {@link SimpleInternationalString}.
+     * Tests the constructor with the {@code "description"} attribute as a {@link SimpleInternationalString}.
      */
     @Test
     @DependsOnMethod("testConstructorWithStringValues")
     public void testConstructorWithInternationalString() {
         final Map<String,Object> properties = properties();
-        assertNotNull(properties.put("remarks", new SimpleInternationalString("Overwritten remarks")));
+        assertNotNull(properties.put("description", new SimpleInternationalString("Overwritten description")));
         final ImmutableIdentifier identifier = new ImmutableIdentifier(properties);
         Validators.validate(identifier);
 
-        assertEquals(CODE_KEY,        "This is a code",       identifier.getCode());
-        assertNull  (CODESPACE_KEY,                           identifier.getCodeSpace());
-        assertEquals(AUTHORITY_KEY,   "This is an authority", identifier.getAuthority().getTitle().toString());
-        assertEquals(VERSION_KEY,     "This is a version",    identifier.getVersion());
-        assertEquals("remarks",       "Overwritten remarks",  identifier.getRemarks().toString(Locale.ENGLISH));
-        assertEquals("remarks_fr",    "Voici des remarques",  identifier.getRemarks().toString(Locale.FRENCH));
-        assertEquals("remarks_fr_CA", "Pareil",               identifier.getRemarks().toString(Locale.CANADA_FRENCH));
+        assertEquals(CODE_KEY,            "This is a code",          identifier.getCode());
+        assertNull  (CODESPACE_KEY,                                  identifier.getCodeSpace());
+        assertEquals(AUTHORITY_KEY,       "This is an authority",    identifier.getAuthority().getTitle().toString());
+        assertEquals(VERSION_KEY,         "This is a version",       identifier.getVersion());
+        assertEquals("description",       "Overwritten description", identifier.getDescription().toString(Locale.ENGLISH));
+        assertEquals("description_fr",    "Voici une description",   identifier.getDescription().toString(Locale.FRENCH));
+        assertEquals("description_fr_CA", "Pareil",                  identifier.getDescription().toString(Locale.CANADA_FRENCH));
     }
 
     /**
@@ -114,13 +114,13 @@ public final strictfp class ImmutableIde
         final ImmutableIdentifier identifier = new ImmutableIdentifier(properties);
         Validators.validate(identifier);
 
-        assertEquals(CODE_KEY,        "This is a code",       identifier.getCode());
-        assertNull  (CODESPACE_KEY,                           identifier.getCodeSpace());
-        assertEquals(AUTHORITY_KEY,   "An other authority",   identifier.getAuthority().getTitle().toString());
-        assertEquals(VERSION_KEY,     "This is a version",    identifier.getVersion());
-        assertEquals("remarks",       "There is remarks",     identifier.getRemarks().toString(Locale.ENGLISH));
-        assertEquals("remarks_fr",    "Voici des remarques",  identifier.getRemarks().toString(Locale.FRENCH));
-        assertEquals("remarks_fr_CA", "Pareil",               identifier.getRemarks().toString(Locale.CANADA_FRENCH));
+        assertEquals(CODE_KEY,            "This is a code",         identifier.getCode());
+        assertNull  (CODESPACE_KEY,                                 identifier.getCodeSpace());
+        assertEquals(AUTHORITY_KEY,       "An other authority",     identifier.getAuthority().getTitle().toString());
+        assertEquals(VERSION_KEY,         "This is a version",      identifier.getVersion());
+        assertEquals("description",       "There is a description", identifier.getDescription().toString(Locale.ENGLISH));
+        assertEquals("description_fr",    "Voici une description",  identifier.getDescription().toString(Locale.FRENCH));
+        assertEquals("description_fr_CA", "Pareil",                 identifier.getDescription().toString(Locale.CANADA_FRENCH));
     }
 
     /**
@@ -136,13 +136,13 @@ public final strictfp class ImmutableIde
         final ImmutableIdentifier identifier = new ImmutableIdentifier(properties);
         Validators.validate(identifier);
 
-        assertEquals(CODE_KEY,        "This is a code",       identifier.getCode());
-        assertSame  (AUTHORITY_KEY,   Citations.EPSG,         identifier.getAuthority());
-        assertEquals(CODESPACE_KEY,   Constants.EPSG,         identifier.getCodeSpace()); // Inferred from authority.
-        assertEquals(VERSION_KEY,     "This is a version",    identifier.getVersion());
-        assertEquals("remarks",       "There is remarks",     identifier.getRemarks().toString(Locale.ENGLISH));
-        assertEquals("remarks_fr",    "Voici des remarques",  identifier.getRemarks().toString(Locale.FRENCH));
-        assertEquals("remarks_fr_CA", "Pareil",               identifier.getRemarks().toString(Locale.CANADA_FRENCH));
+        assertEquals(CODE_KEY,            "This is a code",         identifier.getCode());
+        assertSame  (AUTHORITY_KEY,       Citations.EPSG,           identifier.getAuthority());
+        assertEquals(CODESPACE_KEY,       Constants.EPSG,           identifier.getCodeSpace()); // Inferred from authority.
+        assertEquals(VERSION_KEY,         "This is a version",      identifier.getVersion());
+        assertEquals("description",       "There is a description", identifier.getDescription().toString(Locale.ENGLISH));
+        assertEquals("description_fr",    "Voici une description",  identifier.getDescription().toString(Locale.FRENCH));
+        assertEquals("description_fr_CA", "Pareil",                 identifier.getDescription().toString(Locale.CANADA_FRENCH));
     }
 
     /**

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator1SP.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator1SP.java?rev=1673206&r1=1673205&r2=1673206&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator1SP.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator1SP.java [UTF-8] Mon Apr 13 14:31:18 2015
@@ -41,11 +41,6 @@ public final class Mercator1SP extends A
      */
     private static final long serialVersionUID = -5886510621481710072L;
 
-    /*
-     * ACCESS POLICY: Only formal EPSG parameters shall be public.
-     * Parameters that we add ourselves should be package-privated.
-     */
-
     /**
      * The operation parameter descriptor for the <cite>Latitude of natural origin</cite> (φ₀) parameter value.
      * In theory, this parameter should not be used and its value should be 0 in all cases.

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator2SP.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator2SP.java?rev=1673206&r1=1673205&r2=1673206&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator2SP.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator2SP.java [UTF-8] Mon Apr 13 14:31:18 2015
@@ -18,6 +18,7 @@ package org.apache.sis.internal.referenc
 
 import org.opengis.parameter.ParameterDescriptor;
 import org.opengis.parameter.ParameterDescriptorGroup;
+import org.opengis.util.InternationalString;
 import org.apache.sis.parameter.ParameterBuilder;
 import org.apache.sis.metadata.iso.citation.Citations;
 
@@ -53,23 +54,6 @@ public final class Mercator2SP extends A
     public static final ParameterDescriptor<Double> STANDARD_PARALLEL = Equirectangular.STANDARD_PARALLEL;
 
     /**
-     * The operation parameter descriptor for the <cite>Latitude of natural origin</cite> (φ₀) parameter value.
-     * In theory, this parameter should not be used and its value should be 0 in all cases.
-     * This parameter is included in the EPSG dataset for completeness in CRS labelling only.
-     *
-     * <p>This parameter is used by {@link Mercator1SP} and is not formally a parameter of {@link Mercator2SP}
-     * projections. Nevertheless we declare it is as an optional parameter because it is sometime used in Well
-     * Known Text (WKT).</p>
-     */
-    static final ParameterDescriptor<Double> LATITUDE_OF_ORIGIN;
-
-    /**
-     * The operation parameter descriptor for the <cite>Longitude of natural origin</cite> (λ₀) parameter value.
-     * Valid values range is [-180 … 180]° and default value is 0°.
-     */
-    public static final ParameterDescriptor<Double> CENTRAL_MERIDIAN = Mercator1SP.CENTRAL_MERIDIAN;
-
-    /**
      * The operation parameter descriptor for the <cite>Scale factor</cite> (not necessarily at natural origin)
      * parameter value. Valid values range is (0 … ∞) and default value is 1.
      *
@@ -88,19 +72,23 @@ public final class Mercator2SP extends A
         final ParameterBuilder builder = builder();
         /*
          * "Latitude of natural origin" and "Scale factor" are not formally parameters of the "Mercator (variant B)"
-         * projection according EPSG. But we declare them as optional parameters because they are sometime used.
-         * However we remove the EPSG name and identifier at least for the scale factor, because its meaning does
-         * not fit well in this context. The EPSG name is "Scale factor at natural origin" while actually the scale
-         * factor applied here would rather at the standard parallel.
+         * projection according EPSG. But we declare them as optional parameters because they are sometime used in
+         * Well Known Text (WKT).
          */
         builder.setRequired(false); // Will apply to all remaining parameters.
-        LATITUDE_OF_ORIGIN = createConstant(exceptEPSG(Mercator1SP.LATITUDE_OF_ORIGIN, builder)
-                .setRemarks(Mercator1SP.LATITUDE_OF_ORIGIN.getRemarks()), 0.0);
-
+        final InternationalString remarks = notFormalParameter("Mercator (variant A)");
+        final ParameterDescriptor<Double> latitudeOfOrigin = createConstant(builder
+                .addNamesAndIdentifiers(Mercator1SP.LATITUDE_OF_ORIGIN)
+                .setRemarks(remarks), 0.0);
+        /*
+         * Remove the EPSG name and identifier at least for the scale factor, because its meaning does not fit well
+         * in this context. The EPSG name is "Scale factor at natural origin" while actually the scale factor applied
+         * here would rather be at the standard parallel.
+         */
         SCALE_FACTOR = createScale(exceptEPSG(Mercator1SP.SCALE_FACTOR, builder)
-                .setRemarks(notFormalParameter("Mercator (variant A)")));
+                .setRemarks(remarks).setDeprecated(true));
 
-        PARAMETERS = builder
+        PARAMETERS = builder.setDeprecated(false)
             .addIdentifier(             "9805")
             .addName(                   "Mercator (variant B)")     // Starting from EPSG version 7.6
             .addName(                   "Mercator (2SP)")           // Prior to EPSG version 7.6
@@ -112,8 +100,8 @@ public final class Mercator2SP extends A
             .addIdentifier(Citations.S57,       "8")
             .createGroupForMapProjection(
                     STANDARD_PARALLEL,
-                    LATITUDE_OF_ORIGIN,     // Not formally a Mercator2SP parameter.
-                    CENTRAL_MERIDIAN,
+                    latitudeOfOrigin,       // Not formally a Mercator2SP parameter.
+                    Mercator1SP.CENTRAL_MERIDIAN,
                     SCALE_FACTOR,           // Not formally a Mercator2SP parameter.
                     FALSE_EASTING,
                     FALSE_NORTHING);

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MercatorSpherical.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MercatorSpherical.java?rev=1673206&r1=1673205&r2=1673206&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MercatorSpherical.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MercatorSpherical.java [UTF-8] Mon Apr 13 14:31:18 2015
@@ -16,7 +16,6 @@
  */
 package org.apache.sis.internal.referencing.provider;
 
-import org.opengis.parameter.ParameterDescriptor;
 import org.opengis.parameter.ParameterDescriptorGroup;
 import org.apache.sis.parameter.ParameterBuilder;
 
@@ -54,25 +53,14 @@ public final class MercatorSpherical ext
     static final ParameterDescriptorGroup PARAMETERS;
     static {
         final ParameterBuilder builder = builder();
-        /*
-         * The "Latitude of 1st standard parallel" is not formally a parameter for this map projection.
-         * But we declare it (as an optional parameter) for compatibility with those who still use it.
-         */
-        final ParameterDescriptor<?> standardParallel = createLatitude(builder
-                .addNamesAndIdentifiers(Mercator2SP.STANDARD_PARALLEL)
-                .setRemarks(notFormalParameter("Mercator (variant B)"))
-                .setRequired(false), false);
-
         PARAMETERS = builder
             .addIdentifier(IDENTIFIER)
             .addDeprecatedIdentifier("9841", IDENTIFIER)
             .addName(NAME)                                          // Starting from EPSG version 7.6
             .addDeprecatedName("Mercator (1SP) (Spherical)", NAME)  // Prior to EPSG version 7.6
             .createGroupForMapProjection(
-                    standardParallel,                   // Not formally a Mercator Spherical parameter.
                     Mercator1SP.LATITUDE_OF_ORIGIN,
                     Mercator1SP.CENTRAL_MERIDIAN,
-                    Mercator2SP.SCALE_FACTOR,           // Not formally a Mercator Spherical parameter.
                     FALSE_EASTING,
                     FALSE_NORTHING);
     }

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/RegionalMercator.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/RegionalMercator.java?rev=1673206&r1=1673205&r2=1673206&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/RegionalMercator.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/RegionalMercator.java [UTF-8] Mon Apr 13 14:31:18 2015
@@ -18,6 +18,7 @@ package org.apache.sis.internal.referenc
 
 import org.opengis.parameter.ParameterDescriptor;
 import org.opengis.parameter.ParameterDescriptorGroup;
+import org.apache.sis.metadata.iso.citation.Citations;
 import org.apache.sis.parameter.ParameterBuilder;
 
 
@@ -82,18 +83,20 @@ public class RegionalMercator extends Ab
 
         EASTING_AT_FALSE_ORIGIN = createShift(builder
                 .addIdentifier("8826")
-                .addName("Easting at false origin"));
+                .addName("Easting at false origin")
+                .addName(sameNameAs(Citations.OGC, FALSE_EASTING)));
 
         NORTHING_AT_FALSE_ORIGIN = createShift(builder
                 .addIdentifier("8827")
-                .addName("Northing at false origin"));
+                .addName("Northing at false origin")
+                .addName(sameNameAs(Citations.OGC, FALSE_NORTHING)));
 
         PARAMETERS = builder
             .addIdentifier(IDENTIFIER)
             .addName(NAME)
             .createGroupForMapProjection(
                     Mercator2SP.STANDARD_PARALLEL,
-                    Mercator2SP.CENTRAL_MERIDIAN,
+                    Mercator1SP.CENTRAL_MERIDIAN,
                     LATITUDE_OF_FALSE_ORIGIN,
                     EASTING_AT_FALSE_ORIGIN,
                     NORTHING_AT_FALSE_ORIGIN);

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java?rev=1673206&r1=1673205&r2=1673206&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/AbstractIdentifiedObject.java [UTF-8] Mon Apr 13 14:31:18 2015
@@ -118,7 +118,7 @@ import org.apache.sis.util.iso.DefaultNa
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.4
- * @version 0.5
+ * @version 0.6
  * @module
  */
 @XmlType(name="IdentifiedObjectType", propOrder={
@@ -155,6 +155,17 @@ public class AbstractIdentifiedObject ex
     public static final String LOCALE_KEY = Errors.LOCALE_KEY;
 
     /**
+     * Optional key which can be given to the {@linkplain #AbstractIdentifiedObject(Map) constructor}
+     * for specifying the object is deprecated. If deprecated, then the replacement should be specified
+     * in the {@linkplain #getRemarks() remarks}.
+     *
+     * <div class="note"><b>Example:</b> "superseded by code XYZ".</div>
+     *
+     * @since 0.6
+     */
+    public static final String DEPRECATED_KEY = "deprecated";
+
+    /**
      * The name for this object or code. Shall never be {@code null}.
      *
      * <p><b>Consider this field as final!</b>
@@ -194,6 +205,13 @@ public class AbstractIdentifiedObject ex
     private final InternationalString remarks;
 
     /**
+     * {@code true} if this object is deprecated.
+     *
+     * @since 0.6
+     */
+    private final boolean deprecated;
+
+    /**
      * The cached hash code value, or 0 if not yet computed. This field is calculated only when
      * first needed. We do not declare it {@code volatile} because it is not a big deal if this
      * field is calculated many time, and the same value should be produced by all computations.
@@ -208,6 +226,7 @@ public class AbstractIdentifiedObject ex
      */
     AbstractIdentifiedObject() {
         remarks = null;
+        deprecated = false;
     }
 
     /**
@@ -273,6 +292,11 @@ public class AbstractIdentifiedObject ex
      *     <td>{@link #getRemarks()}</td>
      *   </tr>
      *   <tr>
+     *     <td>{@value #DEPRECATED_KEY}</td>
+     *     <td>{@link Boolean}</td>
+     *     <td>{@link #isDeprecated()}</td>
+     *   </tr>
+     *   <tr>
      *     <td>{@value #LOCALE_KEY}</td>
      *     <td>{@link Locale}</td>
      *     <td>(none)</td>
@@ -352,6 +376,18 @@ public class AbstractIdentifiedObject ex
         // "remarks": String or InternationalString
         // ----------------------------------------
         remarks = Types.toInternationalString(properties, REMARKS_KEY);
+
+        // ---------------------
+        // "deprecated": Boolean
+        // ---------------------
+        value = properties.get(DEPRECATED_KEY);
+        if (value == null) {
+            deprecated = false;
+        } else if (value instanceof Boolean) {
+            deprecated = (Boolean) value;
+        } else {
+            throw illegalPropertyType(properties, DEPRECATED_KEY, value);
+        }
     }
 
     /**
@@ -379,6 +415,7 @@ public class AbstractIdentifiedObject ex
         alias       = nonEmpty(object.getAlias()); // Favor null for empty set in case it is not Collections.EMPTY_SET
         identifiers = nonEmpty(object.getIdentifiers());
         remarks     =          object.getRemarks();
+        deprecated  = (object instanceof Deprecable) ? ((Deprecable) object).isDeprecated() : false;
     }
 
     /**
@@ -666,6 +703,8 @@ public class AbstractIdentifiedObject ex
 
     /**
      * Returns comments on or information about this object, including data source information.
+     * If this object {@linkplain #isDeprecated() is deprecated}, then the remarks should give
+     * indication about the replacement (e.g. <cite>"superceded by …"</cite>).
      *
      * @return The remarks, or {@code null} if none.
      */
@@ -676,44 +715,15 @@ public class AbstractIdentifiedObject ex
 
     /**
      * Returns {@code true} if this object is deprecated. Deprecated objects exist in some
-     * {@linkplain org.opengis.referencing.AuthorityFactory authority factories} like the
-     * EPSG database. Deprecated objects are usually obtained from a deprecated authority code.
-     * For this reason, the default implementation applies the following rules:
-     *
-     * <ul>
-     *   <li>If the {@linkplain #getName() name} is deprecated, then returns {@code true}.</li>
-     *   <li>Otherwise if <strong>all</strong> {@linkplain #getIdentifiers() identifiers}
-     *       are deprecated, ignoring the identifiers that are not instance of {@link Deprecable}
-     *       (because they can not be tested), then returns {@code true}.</li>
-     *   <li>Otherwise returns {@code false}.</li>
-     * </ul>
+     * {@linkplain org.opengis.referencing.AuthorityFactory authority factories} like the EPSG database.
+     * If this method returns {@code true}, then the {@linkplain #getRemarks() remarks} should give
+     * indication about the replacement (e.g. <cite>"superceded by …"</cite>).
      *
      * @return {@code true} if this object is deprecated.
-     *
-     * @see org.apache.sis.metadata.iso.ImmutableIdentifier#isDeprecated()
      */
     @Override
     public boolean isDeprecated() {
-        if (isDeprecated(name)) {
-            return true;
-        }
-        boolean isDeprecated = false;
-        for (final Identifier identifier : nonNull(identifiers)) {
-            if (identifier instanceof Deprecable) {
-                if (!((Deprecable) identifier).isDeprecated()) {
-                    return false;
-                }
-                isDeprecated = true;
-            }
-        }
-        return isDeprecated;
-    }
-
-    /**
-     * Returns {@code true} if the given identifier is deprecated.
-     */
-    private static boolean isDeprecated(final Identifier object) {
-        return (object instanceof Deprecable) && ((Deprecable) object).isDeprecated();
+        return deprecated;
     }
 
     /**

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/Builder.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/Builder.java?rev=1673206&r1=1673205&r2=1673206&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/Builder.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/Builder.java [UTF-8] Mon Apr 13 14:31:18 2015
@@ -38,49 +38,40 @@ import static org.apache.sis.util.Argume
 
 
 /**
- * Base class of builders for various kind of {@link IdentifiedObject}. {@code Builder}s aim to make object creation
- * easier — they do not add any new functionality compared to {@link org.opengis.referencing.ObjectFactory}.
- * Builder methods like {@link #addName(CharSequence)} and {@link #addIdentifier(String)} provide convenient ways
- * to fill the {@link #properties} map, which will be given to the {@code ObjectFactory} methods when any
- * {@code createXXX(…)} method is invoked.
- *
- * <p>This base class provides methods for defining the {@link IdentifiedObject} properties shown below:</p>
+ * Base class of builders for various kind of {@link IdentifiedObject}. This class provides convenience methods
+ * for filling the {@link #properties} map to be given to an {@link org.opengis.referencing.ObjectFactory}.
+ * The main properties are:
  *
  * <ul class="verbose">
- *   <li><b>{@linkplain AbstractIdentifiedObject#getName() Name}:</b>
+ *   <li><b>{@linkplain AbstractIdentifiedObject#getName() Name}:</b><br>
  *       each {@code IdentifiedObject} shall have a name, which can be specified by a call to any of the
  *       {@link #addName(CharSequence) addName(…)} methods defined in this class.</li>
  *
- *   <li><b>{@linkplain AbstractIdentifiedObject#getAlias() Aliases}:</b>
- *       identified objects can optionally have an arbitrary amount of aliases, which are also specified
+ *   <li><b>{@linkplain AbstractIdentifiedObject#getAlias() Aliases}:</b><br>
+ *       {@code IdentifiedObject}s can optionally have an arbitrary amount of aliases, which are also specified
  *       by the {@code addName(…)} methods. Each call after the first one adds an alias.</li>
  *
- *   <li><b>{@linkplain AbstractIdentifiedObject#getIdentifiers() Identifiers}:</b>
- *       identified objects can also have an arbitrary amount of identifiers, which are specified by any
+ *   <li><b>{@linkplain AbstractIdentifiedObject#getIdentifiers() Identifiers}:</b><br>
+ *       {@code IdentifiedObject}s can also have an arbitrary amount of identifiers, which are specified by any
  *       of the {@link #addIdentifier(String) addIdentifier(…)} methods. Like names, more than one identifier
  *       can be added by invoking the method many time.</li>
  *
- *   <li><b>{@linkplain AbstractIdentifiedObject#getRemarks() Remarks}:</b>
- *       identified objects can have at most one remark, which is specified by the {@code setRemarks(…)}
- *       method.</li>
- * </ul>
- *
- * The names and identifiers cited in the above table can be built from {@link CharSequence} given to the
- * {@code addName(…)} or {@code addIdentifier(…)} methods combined with the following properties:
- *
- * <ul class="verbose">
- *   <li><b>{@linkplain ImmutableIdentifier#getCodeSpace() Code space}:</b>
- *       each {@code Identifier} name or code can be local to a code space defined by an authority.
+ *   <li><b>{@linkplain ImmutableIdentifier#getCodeSpace() Code space}:</b><br>
+ *       {@code IdentifiedObject} names and identifiers can be local to a code space defined by an authority.
  *       Both the authority and code space can be specified by the {@link #setCodeSpace(Citation, String)} method,
  *       and usually (but not necessarily) apply to all {@code Identifier} instances.</li>
  *
- *   <li><b>{@linkplain ImmutableIdentifier#getVersion() Version}:</b>
- *       identifiers can optionally have a version specified by the {@link #setVersion(String)} method.
+ *   <li><b>{@linkplain ImmutableIdentifier#getVersion() Version}:</b><br>
+ *       {@code Identifier}s can optionally have a version specified by the {@link #setVersion(String)} method.
  *       The version usually (but not necessarily) applies to all {@code Identifier} instances.</li>
  *
- *   <li><b>{@linkplain ImmutableIdentifier#getDescription() Description}:</b>
- *       identifiers can optionally have a description specified by the {@link #setDescription(CharSequence)} method.
+ *   <li><b>{@linkplain ImmutableIdentifier#getDescription() Description}:</b><br>
+ *       {@code Identifier}s can optionally have a description specified by the {@link #setDescription(CharSequence)} method.
  *       The description applies only to the next identifier to create.</li>
+ *
+ *   <li><b>{@linkplain AbstractIdentifiedObject#getRemarks() Remarks}:</b><br>
+ *       {@code IdentifiedObject}s can have at most one remark, which is specified by the
+ *       {@link #setRemarks(CharSequence) code setRemarks(…)} method.</li>
  * </ul>
  *
  * <div class="section">Namespaces and scopes</div>
@@ -438,6 +429,31 @@ public abstract class Builder<B extends
     }
 
     /**
+     * Sets whether the next {@code IdentifiedObject}s to create shall be considered deprecated. Deprecated objects
+     * exist in some {@linkplain org.opengis.referencing.AuthorityFactory authority factories} like the EPSG database.
+     *
+     * <p>Note that this method does not apply to name and identifiers, which have their own
+     * {@code addDeprecatedFoo(…)} methods.</p>
+     *
+     * <p><b>Lifetime:</b>
+     * this property is kept unchanged until this {@code setDeprecated(…)} method is invoked again.</p>
+     *
+     * @param  deprecated {@code true} if the next names, identifiers and identified objects should be
+     *         considered deprecated, or {@code false} otherwise.
+     * @return {@code this}, for method call chaining.
+     *
+     * @see #addDeprecatedName(CharSequence, CharSequence)
+     * @see #addDeprecatedIdentifier(String, String)
+     * @see AbstractIdentifiedObject#isDeprecated()
+     *
+     * @since 0.6
+     */
+    public B setDeprecated(final boolean deprecated) {
+        properties.put(AbstractIdentifiedObject.DEPRECATED_KEY, deprecated);
+        return self();
+    }
+
+    /**
      * Adds an {@code IdentifiedObject} name given by a {@code String} or {@code InternationalString}.
      * The given string will be combined with the authority, {@link #setCodeSpace(Citation, String) code space}
      * and {@link #setVersion(String) version} information for creating the {@link Identifier} or {@link GenericName}
@@ -569,6 +585,9 @@ public abstract class Builder<B extends
      * @param  supersededBy The name to use instead of this one, or {@code null} if none.
      * @return {@code this}, for method call chaining.
      *
+     * @see #addDeprecatedIdentifier(String, String)
+     * @see #setDeprecated(boolean)
+     *
      * @since 0.6
      */
     public B addDeprecatedName(final CharSequence name, final CharSequence supersededBy) {
@@ -650,6 +669,9 @@ public abstract class Builder<B extends
      * @param  supersededBy The identifier to use instead of this one, or {@code null} if none.
      * @return {@code this}, for method call chaining.
      *
+     * @see #addDeprecatedName(CharSequence, CharSequence)
+     * @see #setDeprecated(boolean)
+     *
      * @since 0.6
      */
     public B addDeprecatedIdentifier(final String identifier, final String supersededBy) {

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/DeprecatedCode.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/DeprecatedCode.java?rev=1673206&r1=1673205&r2=1673206&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/DeprecatedCode.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/DeprecatedCode.java [UTF-8] Mon Apr 13 14:31:18 2015
@@ -16,8 +16,10 @@
  */
 package org.apache.sis.referencing;
 
+import org.opengis.util.InternationalString;
 import org.opengis.metadata.citation.Citation;
 import org.apache.sis.metadata.iso.ImmutableIdentifier;
+import org.apache.sis.util.Deprecable;
 import org.apache.sis.util.resources.Vocabulary;
 
 
@@ -30,13 +32,20 @@ import org.apache.sis.util.resources.Voc
  * @version 0.6
  * @module
  */
-final class DeprecatedCode extends ImmutableIdentifier {
+final class DeprecatedCode extends ImmutableIdentifier implements Deprecable {
     /**
      * For cross-version compatibility.
      */
     private static final long serialVersionUID = 357222258307746767L;
 
     /**
+     * Information about the replacement for this identifier.
+     *
+     * @see #getRemarks()
+     */
+    private final InternationalString remarks;
+
+    /**
      * Creates a deprecated identifier.
      *
      * @param supersededBy The code that replace this one.
@@ -44,8 +53,8 @@ final class DeprecatedCode extends Immut
     DeprecatedCode(final Citation authority, final String codeSpace,
             final String code, final String version, final CharSequence supersededBy)
     {
-        super(authority, codeSpace, code, version,
-                Vocabulary.formatInternational(Vocabulary.Keys.SupersededBy_1, supersededBy));
+        super(authority, codeSpace, code, version, null);
+        remarks = Vocabulary.formatInternational(Vocabulary.Keys.SupersededBy_1, supersededBy);
     }
 
     /**
@@ -57,4 +66,16 @@ final class DeprecatedCode extends Immut
     public boolean isDeprecated() {
         return true;
     }
+
+    /**
+     * Information about the replacement for this identifier.
+     *
+     * <div class="note"><b>Example:</b> "superseded by code XYZ".</div>
+     *
+     * @return Information about the replacement for this identifier, or {@code null} if none.
+     */
+    @Override
+    public InternationalString getRemarks() {
+        return remarks;
+    }
 }

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/DeprecatedName.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/DeprecatedName.java?rev=1673206&r1=1673205&r2=1673206&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/DeprecatedName.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/DeprecatedName.java [UTF-8] Mon Apr 13 14:31:18 2015
@@ -16,6 +16,7 @@
  */
 package org.apache.sis.referencing;
 
+import org.opengis.util.InternationalString;
 import org.opengis.metadata.citation.Citation;
 import org.apache.sis.util.resources.Vocabulary;
 
@@ -36,6 +37,13 @@ final class DeprecatedName extends Named
     private static final long serialVersionUID = 1792369861343798471L;
 
     /**
+     * Information about the replacement for this name.
+     *
+     * @see #getRemarks()
+     */
+    private final InternationalString remarks;
+
+    /**
      * Creates a new deprecated EPSG name.
      *
      * @param supersededBy The name that replace this one.
@@ -43,8 +51,8 @@ final class DeprecatedName extends Named
     DeprecatedName(final Citation authority, final String codeSpace, final CharSequence code, final String version,
             final CharSequence supersededBy)
     {
-        super(authority, codeSpace, code, version,
-                Vocabulary.formatInternational(Vocabulary.Keys.SupersededBy_1, supersededBy));
+        super(authority, codeSpace, code, version, null);
+        remarks = Vocabulary.formatInternational(Vocabulary.Keys.SupersededBy_1, supersededBy);
     }
 
     /**
@@ -56,4 +64,16 @@ final class DeprecatedName extends Named
     public boolean isDeprecated() {
         return true;
     }
+
+    /**
+     * Information about the replacement for this name.
+     *
+     * <div class="note"><b>Example:</b> "superseded by code XYZ".</div>
+     *
+     * @return Information about the replacement for this name, or {@code null} if none.
+     */
+    @Override
+    public InternationalString getRemarks() {
+        return remarks;
+    }
 }

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/NamedIdentifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/NamedIdentifier.java?rev=1673206&r1=1673205&r2=1673206&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/NamedIdentifier.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/NamedIdentifier.java [UTF-8] Mon Apr 13 14:31:18 2015
@@ -109,9 +109,8 @@ public class NamedIdentifier extends Imm
     private transient boolean isNameSupplied;
 
     /**
-     * Creates a new identifier from the specified one. This is a copy constructor
-     * which will get the code, codespace, authority, version and the remarks (if
-     * available) from the given identifier.
+     * Creates a new identifier from the specified one. This is a copy constructor which get the code,
+     * codespace, authority, version and the description (if available) from the given identifier.
      *
      * <p>If the given identifier implements the {@link GenericName} interface, then calls to
      * {@link #tip()}, {@link #head()}, {@link #scope()} and similar methods will delegate
@@ -177,7 +176,7 @@ public class NamedIdentifier extends Imm
 
     /**
      * Constructs an identifier from an authority and localizable code,
-     * with an optional version number and remarks.
+     * with an optional version number and description.
      *
      * <p>If the given code is an {@link InternationalString}, then the {@code code.toString(Locale.ROOT)}
      * return value will be used for the {@link #getCode() code} property, and the complete international
@@ -195,13 +194,13 @@ public class NamedIdentifier extends Imm
      * @param version
      *          The version of the associated code space or code as specified by the code authority,
      *          or {@code null} if none.
-     * @param remarks
-     *          Comments on or information about this identifier, or {@code null} if none.
+     * @param description
+     *          Natural language description of the meaning of the code value, or {@code null} if none.
      */
     public NamedIdentifier(final Citation authority, final String codeSpace, final CharSequence code,
-            final String version, final InternationalString remarks)
+            final String version, final InternationalString description)
     {
-        super(authority, codeSpace, toString(code), version, remarks);
+        super(authority, codeSpace, toString(code), version, description);
         if (code instanceof InternationalString) {
             name = createName(authority, codeSpace, code);
             isNameSupplied = true; // Because 'code' is an international string.

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/CoordinateOperationMethodsHTML.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/CoordinateOperationMethodsHTML.java?rev=1673206&r1=1673205&r2=1673206&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/CoordinateOperationMethodsHTML.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/CoordinateOperationMethodsHTML.java [UTF-8] Mon Apr 13 14:31:18 2015
@@ -154,8 +154,18 @@ public final class CoordinateOperationMe
         super("CoordinateOperationMethods.html", "Apache SIS™ Coordinate Operation Methods");
         domainOfValidity = Collections.emptyMap(); // TODO: not yet available.
         rangeFormat = new RangeFormat(LOCALE);
-        println("p", "The following tables summarize the coordinate operation methods known to Apache SIS, "
-                   + "together with the recognized parameters.");
+        int p = openTag("p");
+        println("The following tables summarize the coordinate operation methods known to Apache SIS, together with the recognized parameters.");
+        println("Unless otherwise noticed, all parameters are mandatory");
+        println("(in the sense that they should always be shown in forms, regardless of whether they have default value),");
+        println("but two of them are handled in a special way: the <code>semi-major</code> and <code>semi-minor</code> parameters.");
+        println("Those two parameters are needed for all map projections, but usually do not need to be specified explicitely since they are inferred from the ellipsoid.");
+        println("The only exception is when <a href=\"http://sis.apache.org/apidocs/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.html\">creating parameterized transforms directly</a>.");
+        closeTags(p);
+        p = openTag("p");
+        println("All map projections support also implicit <code>earth_radius</code> and <code>inverse_flattening</code> parameters (not shown below).");
+        println("Read and write operations on those implicit parameters are delegated to the <code>semi-major</code> and <code>semi-minor</code> parameters.");
+        closeTags(p);
     }
 
     /**
@@ -165,7 +175,7 @@ public final class CoordinateOperationMe
      * @throws IOException if an error occurred while writing to the file.
      */
     public void writeIndex(final Iterable<? extends OperationMethod> methods) throws IOException {
-        printlnHTML("p", "<b>Table of content:</b>");
+        println("p", "<b>Table of content:</b>");
         final int ul = openTag("ul");
         int innerUL  = ul + 1;
         int category = 0;
@@ -183,7 +193,7 @@ public final class CoordinateOperationMe
                 innerUL = openTag("ul");
                 category = nc;
             }
-            printlnHTML("li", "<a href=\"#" + getAnchor(method) + "\">" + escape(method.getName().getCode()) + "</a>");
+            println("li", "<a href=\"#" + getAnchor(method) + "\">" + escape(method.getName().getCode()) + "</a>");
         }
         closeTags(ul);
     }
@@ -195,7 +205,7 @@ public final class CoordinateOperationMe
      * @throws IOException if an error occurred while writing to the file.
      */
     public void write(final OperationMethod method) throws IOException {
-        println("h2 id=\"" + getAnchor(method) + '"', method.getName().getCode());
+        println("h2 id=\"" + getAnchor(method) + '"', escape(method.getName().getCode()));
         final int blockquote = openTag("blockquote");
         writeIdentification(method);
         writeParameters(method.getParameters());
@@ -236,7 +246,7 @@ public final class CoordinateOperationMe
         if (buffer.length() != 0) {
             final int tr = openTag("tr");
             println("th", "EPSG code:");
-            printlnHTML("td", buffer);
+            println("td", buffer);
             closeTags(tr);
         }
         /*
@@ -258,7 +268,7 @@ public final class CoordinateOperationMe
         if (buffer.length() != 0) {
             final int tr = openTag("tr");
             println("th", "Aliases:");
-            printlnHTML("td", buffer);
+            println("td", buffer);
             closeTags(tr);
         }
         /*
@@ -300,9 +310,12 @@ public final class CoordinateOperationMe
         println("th class=\"sep\"", "Default");
         final Map<String, Integer> footnotes = new LinkedHashMap<>();
         for (final GeneralParameterDescriptor gp : group.descriptors()) {
+            if (isDeprecated(gp)) {
+                continue;   // Hide deprecated parameters.
+            }
             final ParameterDescriptor<?> param = (ParameterDescriptor<?>) gp;
             reopenTag("tr");
-            println("td", getFirstEpsgCode(param.getIdentifiers()));
+            println("td", escape(getFirstEpsgCode(param.getIdentifiers())));
             writeName(param);
             String remarks = toLocalizedString(param.getRemarks());
             if (remarks != null) {
@@ -312,7 +325,7 @@ public final class CoordinateOperationMe
                 }
                 remarks = ((param.getMinimumOccurs() != 0) ? "Unmodifiable " : "Optional ") + toSuperScript(index);
             }
-            println("td class=\"sep\"", remarks);
+            println("td class=\"sep\"", escape(remarks));
             final String domain = toLocalizedString(Parameters.getValueDomain(param));
             final int s;
             if (domain != null && ((s = domain.indexOf('…')) >= 0)) {
@@ -322,7 +335,7 @@ public final class CoordinateOperationMe
             } else {
                 println("td class=\"sep center\" colspan=\"3\"", domain);
             }
-            println("td class=\"sep\"", getDefaultValue(param, getUnit(param)));
+            println("td class=\"sep\"", escape(getDefaultValue(param, getUnit(param))));
         }
         closeTags(table);
         if (!footnotes.isEmpty()) {
@@ -330,7 +343,7 @@ public final class CoordinateOperationMe
             for (final Map.Entry<String,Integer> entry : footnotes.entrySet()) {
                 reopenTag("tr");
                 println("td", String.valueOf(toSuperScript(entry.getValue())));
-                println("td", entry.getKey());
+                println("td", escape(entry.getKey()));
             }
             closeTags(table);
         }
@@ -345,16 +358,16 @@ public final class CoordinateOperationMe
         final Identifier name = param.getName();
         final String codeSpace = name.getCodeSpace();
         if (Constants.EPSG.equalsIgnoreCase(codeSpace)) {
-            println("summary", name.getCode());
+            println("summary", escape(name.getCode()));
         } else {
-            printlnHTML("summary", "<span class=\"non-epsg\">" + codeSpace
+            println("summary", "<span class=\"non-epsg\">" + codeSpace
                     + ":</span><code>" + name.getCode() + "</code>");
         }
         openTag("table class=\"aliases\"");
         for (final GenericName alias : param.getAlias()) {
             reopenTag("tr");
-            println("th", alias.head().toString() + ':');
-            println("td", alias.tip().toString());
+            println("th", escape(alias.head().toString() + ':'));
+            println("td", escape(alias.tip().toString()));
         }
         closeTags(td);
     }

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/MapProjectionTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/MapProjectionTest.java?rev=1673206&r1=1673205&r2=1673206&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/MapProjectionTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/MapProjectionTest.java [UTF-8] Mon Apr 13 14:31:18 2015
@@ -103,7 +103,7 @@ public final strictfp class MapProjectio
         assertParamEquals(null,                                SEMI_MAJOR,           true,  it.next());
         assertParamEquals(null,                                SEMI_MINOR,           true,  it.next());
         assertParamEquals("Latitude of 1st standard parallel", STANDARD_PARALLEL_1,  true,  it.next());
-        assertParamEquals(null,                               "latitude_of_origin",  false, it.next());
+        assertParamEquals("Latitude of natural origin",        "latitude_of_origin",  false, it.next());
         assertParamEquals("Longitude of natural origin",       CENTRAL_MERIDIAN,     true,  it.next());
         assertParamEquals(null,                                SCALE_FACTOR,         false, it.next());
         assertParamEquals("False easting",                     FALSE_EASTING,        true,  it.next());

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/NamedIdentifierTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/NamedIdentifierTest.java?rev=1673206&r1=1673205&r2=1673206&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/NamedIdentifierTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/NamedIdentifierTest.java [UTF-8] Mon Apr 13 14:31:18 2015
@@ -58,8 +58,7 @@ public final strictfp class NamedIdentif
         assertEquals("codeSpace", "EPSG", identifier.getCodeSpace());
         assertSame  ("authority",  IOGP,  identifier.getAuthority());
         assertEquals("version",   "8.3",  identifier.getVersion());
-        assertNull  ("remarks",           identifier.getRemarks());
-        assertFalse ("isDeprecated",      identifier.isDeprecated());
+        assertNull  ("description",       identifier.getDescription());
 
         // NamedIdentifier properties
         assertEquals("depth",  2,          identifier.depth());
@@ -85,8 +84,7 @@ public final strictfp class NamedIdentif
         assertEquals("codeSpace", "EPSG", identifier.getCodeSpace());
         assertEquals("authority", "IOGP", identifier.getAuthority().getTitle().toString());
         assertNull  ("version",           identifier.getVersion());
-        assertNull  ("remarks",           identifier.getRemarks());
-        assertFalse ("isDeprecated",      identifier.isDeprecated());
+        assertNull  ("description",       identifier.getDescription());
 
         // NamedIdentifier properties
         assertEquals("depth",  2,          identifier.depth());
@@ -124,8 +122,7 @@ public final strictfp class NamedIdentif
         assertEquals("codeSpace", "EPSG", identifier.getCodeSpace());
         assertSame  ("authority",  EPSG,  identifier.getAuthority());
         assertNull  ("version",           identifier.getVersion());
-        assertNull  ("remarks",           identifier.getRemarks());
-        assertFalse ("isDeprecated",      identifier.isDeprecated());
+        assertNull  ("description",       identifier.getDescription());
 
         // NamedIdentifier properties
         assertEquals("depth",  2,          identifier.depth());

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/HTMLGenerator.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/HTMLGenerator.java?rev=1673206&r1=1673205&r2=1673206&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/HTMLGenerator.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/HTMLGenerator.java [UTF-8] Mon Apr 13 14:31:18 2015
@@ -110,7 +110,7 @@ public abstract class HTMLGenerator impl
         out.write("<meta charset=\"" + ENCODING + "\"/>");
         out.newLine();
         println("title", CharSequences.replace(title, "™", ""));
-        openTag   ("style type=\"text/css\" media=\"all\"");
+        openTag("style type=\"text/css\" media=\"all\"");
         println("@import url(\"./reports.css\");");
         closeTags(head);
         openTag("body");
@@ -201,42 +201,32 @@ public abstract class HTMLGenerator impl
 
     /**
      * Writes the given text in the given HTML element.
-     * {@code &}, {@code <} and {@code >} characters in {@code value} will be escaped.
+     * The {@code &}, {@code <} and {@code >} characters are <strong>not</strong> escaped.
+     * For escaping those characters, invoke <code>println(tag, {@linkplain #escape(CharSequence) escape}(value))</code>.
      *
-     * @param  element The HTML element without brackets (e.g. {@code "h1"}).
+     * @param  tag The HTML tag without brackets (e.g. {@code "h1"}).
      * @param  value The text to write, or {@code null} for none.
      * @throws IOException if an error occurred while writing to the file.
      */
-    protected final void println(final String element, final CharSequence value) throws IOException {
-        printlnHTML(element, escape(value));
-    }
-
-    /**
-     * Writes the given text in the given HTML element without escaping the characters.
-     * This method can be invoked when the given {@code value} is already valid HTML
-     *
-     * @param  element The HTML element without brackets (e.g. {@code "h1"}).
-     * @param  value The text to write, or {@code null} for none.
-     * @throws IOException if an error occurred while writing to the file.
-     */
-    protected final void printlnHTML(final String element, final CharSequence value) throws IOException {
+    protected final void println(final String tag, final CharSequence value) throws IOException {
         out.write(margin);
         out.write('<');
-        out.write(element);
+        out.write(tag);
         out.write('>');
         if (value != null) {
             out.write(value.toString());
         }
         out.write("</");
-        final int s = element.indexOf(' ');
-        out.write(element, 0, (s >= 0) ? s : element.length());
+        final int s = tag.indexOf(' ');
+        out.write(tag, 0, (s >= 0) ? s : tag.length());
         out.write('>');
         out.newLine();
     }
 
     /**
      * Writes the given text on its own line, then write EOL sequence.
-     * {@code &}, {@code <} and {@code >} characters in {@code value} will be escaped.
+     * The {@code &}, {@code <} and {@code >} characters are <strong>not</strong> escaped.
+     * For escaping those characters, invoke <code>println({@linkplain #escape(CharSequence) escape}(value))</code>.
      *
      * @param  value The text to write, or {@code null} if none.
      * @throws IOException if an error occurred while writing to the file.
@@ -244,7 +234,7 @@ public abstract class HTMLGenerator impl
     protected final void println(final CharSequence value) throws IOException {
         if (value != null) {
             out.write(margin);
-            out.write(escape(value).toString());
+            out.write(value.toString());
             out.newLine();
         }
     }

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Deprecable.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Deprecable.java?rev=1673206&r1=1673205&r2=1673206&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Deprecable.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Deprecable.java [UTF-8] Mon Apr 13 14:31:18 2015
@@ -48,6 +48,7 @@ import org.opengis.util.InternationalStr
 public interface Deprecable {
     /**
      * Returns {@code true} if this instance is deprecated.
+     * In such case, the {@linkplain #getRemarks() remarks} may contain information about the new object to use.
      *
      * @return {@code true} if this instance is deprecated.
      */
@@ -57,6 +58,8 @@ public interface Deprecable {
      * If this instance is deprecated, the reason or the alternative to use.
      * Otherwise, an optional free text.
      *
+     * <div class="note"><b>Example:</b> "superseded by code XYZ".</div>
+     *
      * @return Comments about this instance, or {@code null} if none. Shall be the
      *         reason for deprecation or the alternative to use if this instance
      *         {@linkplain #isDeprecated() is deprecated}.



Mime
View raw message