sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1578181 [1/2] - in /sis/trunk: ./ core/sis-feature/src/main/java/org/apache/sis/feature/ core/sis-metadata/src/main/java/org/apache/sis/io/wkt/ core/sis-referencing/src/main/java/org/apache/sis/parameter/ core/sis-referencing/src/main/java...
Date Sun, 16 Mar 2014 23:30:18 GMT
Author: desruisseaux
Date: Sun Mar 16 23:30:17 2014
New Revision: 1578181

URL: http://svn.apache.org/r1578181
Log:
Merge from the JDK6 branch.

Added:
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorParameters.java
      - copied, changed from r1578178, sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorParameters.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorValues.java
      - copied unchanged from r1578178, sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorValues.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/package-info.java
      - copied unchanged from r1578178, sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/package-info.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterValueGroupWrapper.java
      - copied unchanged from r1578178, sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterValueGroupWrapper.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/TensorParametersTest.java
      - copied, changed from r1578178, sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/parameter/TensorParametersTest.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/TensorValuesTest.java
      - copied unchanged from r1578178, sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/parameter/TensorValuesTest.java
Modified:
    sis/trunk/   (props changed)
    sis/trunk/NOTICE
    sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractIdentifiedType.java
    sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Colors.java
    sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/FormattableObject.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValueGroup.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterBuilder.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterFormat.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterTableRow.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java
    sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorGroupTest.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueGroupTest.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/MultiOccurrenceDescriptor.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterFormatTest.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParametersTest.java
    sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
    sis/trunk/core/sis-utility/src/main/java/org/apache/sis/internal/util/Numerics.java
    sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
    sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
    sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
    sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
    sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties
    sis/trunk/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
    sis/trunk/pom.xml

Propchange: sis/trunk/
------------------------------------------------------------------------------
  Merged /sis/branches/JDK7:r1576955-1578177
  Merged /sis/branches/JDK6:r1576976-1578178

Modified: sis/trunk/NOTICE
URL: http://svn.apache.org/viewvc/sis/trunk/NOTICE?rev=1578181&r1=1578180&r2=1578181&view=diff
==============================================================================
--- sis/trunk/NOTICE (original)
+++ sis/trunk/NOTICE Sun Mar 16 23:30:17 2014
@@ -1,5 +1,5 @@
 Apache Spatial Information System (SIS)
-Copyright 2010-2013 The Apache Software Foundation
+Copyright 2010-2014 The Apache Software Foundation
 
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).

Modified: sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractIdentifiedType.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractIdentifiedType.java?rev=1578181&r1=1578180&r2=1578181&view=diff
==============================================================================
--- sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractIdentifiedType.java [UTF-8] (original)
+++ sis/trunk/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractIdentifiedType.java [UTF-8] Sun Mar 16 23:30:17 2014
@@ -17,6 +17,7 @@
 package org.apache.sis.feature;
 
 import java.util.Map;
+import java.util.Locale;
 import java.io.Serializable;
 import org.opengis.util.GenericName;
 import org.opengis.util.InternationalString;

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Colors.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Colors.java?rev=1578181&r1=1578180&r2=1578181&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Colors.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Colors.java [UTF-8] Sun Mar 16 23:30:17 2014
@@ -49,11 +49,11 @@ public class Colors implements Cloneable
     private static final long serialVersionUID = 256160285861027191L;
 
     /**
-     * The default colors used by {@link FormattableObject#print(Convention)}.
+     * The default colors used by {@link FormattableObject#print()}.
      * Those colors give better results on a {@link java.io.Console} with black background.
      * This map is immutable.
      *
-     * @see FormattableObject#print(Convention)
+     * @see FormattableObject#print()
      */
     public static final Colors DEFAULT = new Colors();
     static {

Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/FormattableObject.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/FormattableObject.java?rev=1578181&r1=1578180&r2=1578181&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/FormattableObject.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/FormattableObject.java [UTF-8] Sun Mar 16 23:30:17 2014
@@ -43,7 +43,7 @@ import org.apache.sis.internal.util.X364
  * </ul>
  *
  * {@section Syntax coloring}
- * A convenience {@link #print(Convention)} method is provided, which is roughly equivalent to
+ * A convenience {@link #print()} method is provided, which is roughly equivalent to
  * {@code System.out.println(this)} except that syntax coloring is automatically applied
  * if the terminal seems to support the ANSI escape codes.
  *
@@ -54,7 +54,7 @@ import org.apache.sis.internal.util.X364
  * <ul>
  *   <li>{@link #toWKT()} will throw a {@link UnformattableObjectException}.</li>
  *   <li>{@link #toString()} will ignore the problem and uses non-standard elements if needed.</li>
- *   <li>{@link #print(Convention)} will show the non-standard elements in red if syntax coloring is enabled.</li>
+ *   <li>{@link #print()} will show the non-standard elements in red if syntax coloring is enabled.</li>
  * </ul>
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java?rev=1578181&r1=1578180&r2=1578181&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java [UTF-8] Sun Mar 16 23:30:17 2014
@@ -48,12 +48,12 @@ import static org.apache.sis.util.Utilit
  * to be shared by all users of that projection or process.
  *
  * {@section Instantiation}
- * Map projection or process <em>implementors</em> may use the {@link ParameterBuilder} class for making
+ * Coordinate operation or process <em>implementors</em> may use the {@link ParameterBuilder} class for making
  * their task easier.
  *
  * <div class="note"><b>Example:</b>
- * The following example creates a <cite>Mercator (variant A)</cite> projection valid
- * from 80°S to 84°N on all the longitude range (±180°).
+ * The following example declares the parameters for a <cite>Mercator (variant A)</cite> projection method
+ * valid from 80°S to 84°N on all the longitude range (±180°).
  *
  * {@preformat java
  *     public class Mercator {
@@ -76,14 +76,15 @@ import static org.apache.sis.util.Utilit
  *         }
  *     }
  * }
+ * </div>
  *
- * Users can simply reference the descriptor provided par projection or process providers like below:
+ * {@section Usage}
+ * Users can simply reference the descriptor provided par a coordinate operation or process providers like below:
  *
  * {@preformat java
  *     ParameterValueGroup parameters = Mercator.PARAMETERS.createValue();
  *     // See DefaultParameterValueGroup for examples on 'parameters' usage.
  * }
- * </div>
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Johann Sorel (Geomatys)
@@ -265,9 +266,10 @@ public class DefaultParameterDescriptorG
      * Returns the GeoAPI interface implemented by this class.
      * The SIS implementation returns {@code ParameterDescriptorGroup.class}.
      *
-     * {@note Subclasses usually do not need to override this method since GeoAPI does not define
-     *        <code>ParameterDescriptorGroup</code> sub-interface. Overriding possibility is left mostly
-     *        for implementors who wish to extend GeoAPI with their own set of interfaces.}
+     * <div class="note"><b>Note for implementors:</b>
+     * Subclasses usually do not need to override this method since GeoAPI does not define {@code ParameterDescriptorGroup}
+     * sub-interface. Overriding possibility is left mostly for implementors who wish to extend GeoAPI with their own
+     * set of interfaces.</div>
      *
      * @return {@code ParameterDescriptorGroup.class} or a user-defined sub-interface.
      */

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java?rev=1578181&r1=1578180&r2=1578181&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java [UTF-8] Sun Mar 16 23:30:17 2014
@@ -45,11 +45,14 @@ import org.apache.sis.internal.jdk7.Obje
 
 
 /**
- * A single parameter value used by an operation method. Most CRS parameter values are numeric and can be obtained
- * by the {@link #intValue()} or {@link #doubleValue()} methods. But other types of parameter values are possible
- * and can be handled by the more generic {@link #getValue()} and {@link #setValue(Object)} methods.
+ * A single parameter value used by an operation method. {@code ParameterValue} instances are elements in
+ * a {@linkplain DefaultParameterValueGroup parameter value group}, in a way similar to {@code Map.Entry}
+ * instances in a {@code java.util.Map}.
  *
- * <p>All {@code xxxValue()} methods in this class are convenience methods converting the value from {@code Object}
+ * <p>In the context of coordinate operations, most parameter values are numeric and can be obtained by the
+ * {@link #intValue()} or {@link #doubleValue()} methods. But other types of parameter values are possible
+ * and can be handled by the more generic {@link #getValue()} and {@link #setValue(Object)} methods.
+ * All {@code xxxValue()} methods in this class are convenience methods converting the value from {@code Object}
  * to some commonly used types. Those types are specified in ISO 19111 as an union of attributes, listed below with
  * the corresponding getter and setter methods:</p>
  *

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValueGroup.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValueGroup.java?rev=1578181&r1=1578180&r2=1578181&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValueGroup.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValueGroup.java [UTF-8] Sun Mar 16 23:30:17 2014
@@ -38,19 +38,30 @@ import org.apache.sis.internal.jdk7.Obje
 
 
 /**
- * A group of related parameter values. {@code ParameterValueGroup} instances are typically created by calls to
+ * A group of related parameter values. Parameter groups have some similarities with {@code java.util.Map}:
+ *
+ * <ul>
+ *   <li>{@link #parameter(String)} is similar in purpose to {@link java.util.Map#get(Object)},
+ *       with an additional level of indirection in both the argument and the return value.</li>
+ *   <li>{@link #values()} is similar in purpose to {@link java.util.Map#entrySet()},
+ *       with {@code ParameterValue} playing a role similar to {@code Map.Entry}.</li>
+ * </ul>
+ *
+ * {@section Instantiation and validity constraints}
+ * {@code ParameterValueGroup} instances are typically created by calls to
  * <code>descriptor.{@linkplain DefaultParameterDescriptorGroup#createValue() createValue()}</code> on a descriptor
- * supplied by a map projection or process provider. New instances are initialized with a {@linkplain #values() list
- * of values} containing all mandatory parameters, and no optional parameter. The values list is modifiable, but all
- * operations will first ensure that the modification would not violate the cardinality constraints (i.e. the minimum
+ * supplied by a coordinate operation or process provider. New instances are initialized with a {@linkplain #values()
+ * list of values} containing all mandatory parameters, and no optional parameter. The values list is modifiable, but
+ * all methods will first ensure that the modification would not violate the cardinality constraints (i.e. the minimum
  * and maximum occurrences of that parameter allowed by the descriptor). If a cardinality constraint is violated, then
  * an {@link InvalidParameterCardinalityException} will be thrown.
  *
- * <p>After a new {@code ParameterValueGroup} instance has been created, the parameter values can be set by chaining
+ * {@section Setting the parameter values}
+ * After a new {@code ParameterValueGroup} instance has been created, the parameter values can be set by chaining
  * calls to {@link #parameter(String)} with one of the {@code setValue(…)} methods defined in the returned object
  * (see the {@linkplain DefaultParameterValue table of setter methods}). The {@code parameter(String)} method can
  * be invoked regardless of whether the parameter is mandatory or optional: if the parameter was optional and not
- * yet present in this group, it will be created.</p>
+ * yet present in this group, it will be created.
  *
  * <div class="note"><b>Example:</b>
  * Assuming the descriptor defined in the {@link DefaultParameterDescriptorGroup} example,
@@ -181,8 +192,6 @@ public class DefaultParameterValueGroup 
      * @param  name The name of the parameter to search for.
      * @return The parameter value for the given name.
      * @throws ParameterNotFoundException if there is no parameter value for the given name.
-     *
-     * @see Parameters#getOrCreate(ParameterDescriptor, ParameterValueGroup)
      */
     @Override
     public ParameterValue<?> parameter(final String name) throws ParameterNotFoundException {

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterBuilder.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterBuilder.java?rev=1578181&r1=1578180&r2=1578181&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterBuilder.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterBuilder.java [UTF-8] Sun Mar 16 23:30:17 2014
@@ -29,11 +29,10 @@ import static org.apache.sis.util.Argume
 
 
 /**
- * Provides convenience methods for easier {@code ParameterDescriptor} instantiations.
- * This builder can be helpful for map projection <em>providers</em>, or for implementation of
- * any process that use parameters. Map projection or process <em>users</em> do not need this
- * builder since they can invoke {@link ParameterDescriptor#createValue()} on the descriptor
- * provided by the implementor.
+ * Helper class for {@linkplain DefaultParameterDescriptor parameter descriptor} instantiations.
+ * This builder can be helpful to operation or process <em>providers</em> (e.g. map projection
+ * implementors). Operation <em>users</em> do not need this builder since they can invoke
+ * {@link ParameterDescriptor#createValue()} on the descriptor provided by the implementor.
  *
  * {@section Identification properties}
  * Each parameter must have a name, which can be specified by any of the {@code addName(…)} methods.
@@ -252,12 +251,12 @@ public class ParameterBuilder extends Bu
      * The descriptor has no minimal or maximal value and no unit.
      *
      * <p>The {@code validValues} property is mostly for restricting values to
-     * a {@linkplain org.opengis.util.CodeList code list} or enumeration subset.
+     * a {@linkplain org.opengis.util.CodeList code list} or {@linkplain Enum enumeration} subset.
      * It is not necessary to provide this property when all values from the code list or enumeration are valid.</p>
      *
      * @param  <T>          The compile-time type of the {@code valueClass} argument.
      * @param  valueClass   The class that describe the type of the parameter values.
-     * @param  validValues  A finite set of valid values (usually from a {@linkplain CodeList code list})
+     * @param  validValues  A finite set of valid values (usually from a code list or enumeration)
      *                      or {@code null} if it doesn't apply.
      * @param  defaultValue The default value for the parameter, or {@code null} if none.
      * @return The parameter descriptor for the given set of valid values.
@@ -290,7 +289,8 @@ public class ParameterBuilder extends Bu
      * {@link #createGroup(int, int, GeneralParameterDescriptor[])} with a cardinality of [0 … 1]
      * or [1 … 1] depending on the value given to the last call to {@link #setRequired(boolean)}.
      *
-     * @param  parameters The {@linkplain #descriptors() parameter descriptors} for the group to create.
+     * @param  parameters The {@linkplain DefaultParameterDescriptorGroup#descriptors() parameter descriptors}
+     *         for the group to create.
      * @return The parameter descriptor group.
      */
     public ParameterDescriptorGroup createGroup(final GeneralParameterDescriptor... parameters) {
@@ -304,7 +304,8 @@ public class ParameterBuilder extends Bu
      *                       number of times that values for this parameter group are required.
      * @param  maximumOccurs The {@linkplain DefaultParameterDescriptorGroup#getMaximumOccurs() maximum}
      *                       number of times that values for this parameter group are required.
-     * @param  parameters    The {@linkplain #descriptors() parameter descriptors} for the group to create.
+     * @param  parameters    The {@linkplain DefaultParameterDescriptorGroup#descriptors() parameter descriptors}
+     *                       for the group to create.
      * @return The parameter descriptor group.
      */
     public ParameterDescriptorGroup createGroup(final int minimumOccurs, final int maximumOccurs,

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterFormat.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterFormat.java?rev=1578181&r1=1578180&r2=1578181&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterFormat.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterFormat.java [UTF-8] Sun Mar 16 23:30:17 2014
@@ -74,15 +74,15 @@ import static org.apache.sis.util.collec
  *
  * {@preformat text
  *   EPSG: Mercator (variant A)
- *   ┌────────────────────────────────┬────────┬───────────────┬───────────────┐
- *   │ Name (EPSG)                    │ Type   │ Value domain  │ Default value │
- *   ├────────────────────────────────┼────────┼───────────────┼───────────────┤
- *   │ Latitude of natural origin     │ Double │  [-80 … 84]°  │         0.0°  │
- *   │ Longitude of natural origin    │ Double │ [-180 … 180]° │         0.0°  │
- *   │ Scale factor at natural origin │ Double │    (0 … ∞)    │         1.0   │
- *   │ False easting                  │ Double │   (-∞ … ∞) m  │         0.0 m │
- *   │ False northing                 │ Double │   (-∞ … ∞) m  │         0.0 m │
- *   └────────────────────────────────┴────────┴───────────────┴───────────────┘
+ *   ┌────────────────────────────────┬────────┬────────────┬───────────────┬───────────────┐
+ *   │ Name (EPSG)                    │ Type   │ Obligation │ Value domain  │ Default value │
+ *   ├────────────────────────────────┼────────┼────────────┼───────────────┼───────────────┤
+ *   │ Latitude of natural origin     │ Double │ Mandatory  │  [-80 … 84]°  │         0.0°  │
+ *   │ Longitude of natural origin    │ Double │ Mandatory  │ [-180 … 180]° │         0.0°  │
+ *   │ Scale factor at natural origin │ Double │ Mandatory  │    (0 … ∞)    │         1.0   │
+ *   │ False easting                  │ Double │ Mandatory  │   (-∞ … ∞) m  │         0.0 m │
+ *   │ False northing                 │ Double │ Mandatory  │   (-∞ … ∞) m  │         0.0 m │
+ *   └────────────────────────────────┴────────┴────────────┴───────────────┴───────────────┘
  * }
  * </div>
  *
@@ -122,7 +122,7 @@ public class ParameterFormat extends Tab
     private static final String SEPARATOR = " │ ";
 
     /**
-     * The amount of information to put in the table to be formatted by {@link ParameterFormat}.
+     * The amount of information to include in the table formatted by {@link ParameterFormat}.
      * The content level controls whether the formatter should write all names and aliases
      * (at the cost of multi-line rows), or to pickup one name per parameter for a more compact table.
      *
@@ -147,24 +147,24 @@ public class ParameterFormat extends Tab
          *   EPSG: Mercator (variant A) (9804)
          *   EPSG: Mercator (1SP)
          *   OGC:  Mercator_1SP
-         *   ╔══════════════════════════════════════╤════════╤═══════════════╤═══════════════╗
-         *   ║ Name                                 │ Type   │ Value domain  │ Default value ║
-         *   ╟──────────────────────────────────────┼────────┼───────────────┼───────────────╢
-         *   ║ EPSG: Latitude of natural origin     │ Double │  [-80 … 84]°  │         0.0°  ║
-         *   ║ OGC:  latitude_of_origin             │        │               │               ║
-         *   ╟──────────────────────────────────────┼────────┼───────────────┼───────────────╢
-         *   ║ EPSG: Longitude of natural origin    │ Double │ [-180 … 180]° │         0.0°  ║
-         *   ║ OGC:  central_meridian               │        │               │               ║
-         *   ╟──────────────────────────────────────┼────────┼───────────────┼───────────────╢
-         *   ║ EPSG: Scale factor at natural origin │ Double │    (0 … ∞)    │         1.0   ║
-         *   ║ OGC:  scale_factor                   │        │               │               ║
-         *   ╟──────────────────────────────────────┼────────┼───────────────┼───────────────╢
-         *   ║ EPSG: False easting                  │ Double │   (-∞ … ∞) m  │         0.0 m ║
-         *   ║ OGC:  FalseEasting                   │        │               │               ║
-         *   ╟──────────────────────────────────────┼────────┼───────────────┼───────────────╢
-         *   ║ EPSG: False northing                 │ Double │   (-∞ … ∞) m  │         0.0 m ║
-         *   ║ OGC:  FalseNorthing                  │        │               │               ║
-         *   ╚══════════════════════════════════════╧════════╧═══════════════╧═══════════════╝
+         *   ╔══════════════════════════════════════╤════════╤════════════╤═══════════════╤═══════════════╗
+         *   ║ Name                                 │ Type   │ Obligation │ Value domain  │ Default value ║
+         *   ╟──────────────────────────────────────┼────────┼────────────┼───────────────┼───────────────╢
+         *   ║ EPSG: Latitude of natural origin     │ Double │ Mandatory  │  [-80 … 84]°  │         0.0°  ║
+         *   ║ OGC:  latitude_of_origin             │        │            │               │               ║
+         *   ╟──────────────────────────────────────┼────────┼────────────┼───────────────┼───────────────╢
+         *   ║ EPSG: Longitude of natural origin    │ Double │ Mandatory  │ [-180 … 180]° │         0.0°  ║
+         *   ║ OGC:  central_meridian               │        │            │               │               ║
+         *   ╟──────────────────────────────────────┼────────┼────────────┼───────────────┼───────────────╢
+         *   ║ EPSG: Scale factor at natural origin │ Double │ Mandatory  │    (0 … ∞)    │         1.0   ║
+         *   ║ OGC:  scale_factor                   │        │            │               │               ║
+         *   ╟──────────────────────────────────────┼────────┼────────────┼───────────────┼───────────────╢
+         *   ║ EPSG: False easting                  │ Double │ Mandatory  │   (-∞ … ∞) m  │         0.0 m ║
+         *   ║ OGC:  false_easting                  │        │            │               │               ║
+         *   ╟──────────────────────────────────────┼────────┼────────────┼───────────────┼───────────────╢
+         *   ║ EPSG: False northing                 │ Double │ Mandatory  │   (-∞ … ∞) m  │         0.0 m ║
+         *   ║ OGC:  false_northing                 │        │            │               │               ║
+         *   ╚══════════════════════════════════════╧════════╧════════════╧═══════════════╧═══════════════╝
          * }
          * </div>
          */
@@ -182,15 +182,15 @@ public class ParameterFormat extends Tab
          *
          * {@preformat text
          *   EPSG: Mercator (variant A)
-         *   ┌────────────────────────────────┬────────┬───────────────┬───────────────┐
-         *   │ Name (EPSG)                    │ Type   │ Value domain  │ Default value │
-         *   ├────────────────────────────────┼────────┼───────────────┼───────────────┤
-         *   │ Latitude of natural origin     │ Double │  [-80 … 84]°  │         0.0°  │
-         *   │ Longitude of natural origin    │ Double │ [-180 … 180]° │         0.0°  │
-         *   │ Scale factor at natural origin │ Double │    (0 … ∞)    │         1.0   │
-         *   │ False easting                  │ Double │   (-∞ … ∞) m  │         0.0 m │
-         *   │ False northing                 │ Double │   (-∞ … ∞) m  │         0.0 m │
-         *   └────────────────────────────────┴────────┴───────────────┴───────────────┘
+         *   ┌────────────────────────────────┬────────┬────────────┬───────────────┬───────────────┐
+         *   │ Name (EPSG)                    │ Type   │ Obligation │ Value domain  │ Default value │
+         *   ├────────────────────────────────┼────────┼────────────┼───────────────┼───────────────┤
+         *   │ Latitude of natural origin     │ Double │ Mandatory  │  [-80 … 84]°  │         0.0°  │
+         *   │ Longitude of natural origin    │ Double │ Mandatory  │ [-180 … 180]° │         0.0°  │
+         *   │ Scale factor at natural origin │ Double │ Mandatory  │    (0 … ∞)    │         1.0   │
+         *   │ False easting                  │ Double │ Mandatory  │   (-∞ … ∞) m  │         0.0 m │
+         *   │ False northing                 │ Double │ Mandatory  │   (-∞ … ∞) m  │         0.0 m │
+         *   └────────────────────────────────┴────────┴────────────┴───────────────┴───────────────┘
          * }
          * </div>
          */
@@ -202,7 +202,7 @@ public class ParameterFormat extends Tab
          * The summary contains the identifier names and aliases aligned in a table.
          *
          * <div class="note"><b>Example:</b>
-         * The <cite>Mercator (variant A)</cite> example given in {@link ParameterBuiler} javadoc
+         * The <cite>Mercator (variant A)</cite> example given in {@link ParameterBuilder} javadoc
          * formatted at this level produces a text like below:
          *
          * {@preformat text
@@ -213,8 +213,8 @@ public class ParameterFormat extends Tab
          *   │ Latitude of natural origin     │ latitude_of_origin │
          *   │ Longitude of natural origin    │ central_meridian   │
          *   │ Scale factor at natural origin │ scale_factor       │
-         *   │ False easting                  │ FalseEasting       │
-         *   │ False northing                 │ FalseNorthing      │
+         *   │ False easting                  │ false_easting      │
+         *   │ False northing                 │ false_northing     │
          *   └────────────────────────────────┴────────────────────┘
          * }
          * </div>
@@ -362,6 +362,14 @@ public class ParameterFormat extends Tab
     }
 
     /**
+     * Invoked when the formatter needs to move to the next column.
+     */
+    private void nextColumn(final TableAppender table) {
+        table.append(beforeFill);
+        table.nextColumn(fillCharacter);
+    }
+
+    /**
      * Formats the given object to the given stream of buffer.
      * The object may be an instance of any of the following types:
      *
@@ -421,11 +429,12 @@ public class ParameterFormat extends Tab
     private void format(final String name, final ParameterDescriptorGroup group,
             final ParameterValueGroup values, final Appendable out) throws IOException
     {
-        final boolean    isBrief       = (contentLevel == ContentLevel.BRIEF);
-        final boolean    hasColors     = (colors != null);
-        final String     lineSeparator = this.lineSeparator;
-        final ParameterTableRow header = new ParameterTableRow(group, displayLocale, preferredCodespaces, isBrief);
-        final String    groupCodespace = header.getCodeSpace();
+        final boolean    isBrief        = (contentLevel == ContentLevel.BRIEF);
+        final boolean    showObligation = !isBrief || (values == null);
+        final boolean    hasColors      = (colors != null);
+        final String     lineSeparator  = this.lineSeparator;
+        final ParameterTableRow header  = new ParameterTableRow(group, displayLocale, preferredCodespaces, isBrief);
+        final String    groupCodespace  = header.getCodeSpace();
         /*
          * Prepares the informations to be printed later as table rows. We scan all rows before to print them
          * in order to compute the width of codespaces. During this process, we split the objects to be printed
@@ -488,11 +497,11 @@ public class ParameterFormat extends Tab
          *   - Value domains are formatted.
          *   - Position of the character on which to do the alignment are remembered.
          */
-        int     unitWidth            = 0;
-        int     valueDomainAlignment = 0;
-        boolean writeCodespaces      = (groupCodespace == null);
-        final   StringBuffer  buffer = new StringBuffer();
-        final   FieldPosition fp     = new FieldPosition(-1);
+        int     unitWidth             = 0;
+        int     valueDomainAlignment  = 0;
+        boolean writeCodespaces       = (groupCodespace == null);
+        final   StringBuffer  buffer  = new StringBuffer();
+        final   FieldPosition dummyFP = new FieldPosition(-1);
         for (final Map.Entry<GeneralParameterDescriptor,ParameterTableRow> entry : descriptorValues.entrySet()) {
             final GeneralParameterDescriptor descriptor = entry.getKey();
             if (descriptor instanceof ParameterDescriptor<?>) {
@@ -524,7 +533,7 @@ public class ParameterFormat extends Tab
                 for (int i=0; i<length; i++) {
                     final Object unit = row.units.get(i);
                     if (unit != null) {
-                        if (getFormat(Unit.class).format(unit, buffer, fp).length() != 0) {
+                        if (getFormat(Unit.class).format(unit, buffer, dummyFP).length() != 0) {
                             if (Character.isLetterOrDigit(buffer.codePointAt(0))) {
                                 buffer.insert(0, ' ');
                             }
@@ -556,10 +565,30 @@ public class ParameterFormat extends Tab
             boolean end = false;
             final short key;
             switch (i) {
-                case 0: key = Vocabulary.Keys.Name; break;
-                case 1: key = Vocabulary.Keys.Type; break;
-                case 2: key = Vocabulary.Keys.ValueDomain; break;
-                case 3: key = (values == null) ? Vocabulary.Keys.DefaultValue : Vocabulary.Keys.Value; end = true; break;
+                case 0: {
+                    key = Vocabulary.Keys.Name;
+                    break;
+                }
+                case 1: {
+                    key = Vocabulary.Keys.Type;
+                    break;
+                }
+                case 2: {
+                    if (!showObligation) {
+                       continue;
+                    }
+                    key = Vocabulary.Keys.Obligation;
+                    break;
+                }
+                case 3: {
+                    key = Vocabulary.Keys.ValueDomain;
+                    break;
+                }
+                case 4: {
+                    key = (values == null) ? Vocabulary.Keys.DefaultValue : Vocabulary.Keys.Value;
+                    end = true;
+                    break;
+                }
                 default: throw new AssertionError(i);
             }
             if (hasColors) table.append(X364.BOLD.sequence());
@@ -569,8 +598,7 @@ public class ParameterFormat extends Tab
                 table.append(" (").append(groupCodespace).append(')');
             }
             if (end) break;
-            table.append(beforeFill);
-            table.nextColumn(fillCharacter);
+            nextColumn(table);
         }
         table.nextLine();
         /*
@@ -588,8 +616,7 @@ public class ParameterFormat extends Tab
             final ParameterTableRow row = entry.getValue();
             row.codespaceWidth = codespaceWidth;
             row.writeIdentifiers(table, writeCodespaces, null, hasColors, lineSeparator);
-            table.append(beforeFill);
-            table.nextColumn(fillCharacter);
+            nextColumn(table);
             final GeneralParameterDescriptor generalDescriptor = entry.getKey();
             if (generalDescriptor instanceof ParameterDescriptor<?>) {
                 /*
@@ -597,19 +624,39 @@ public class ParameterFormat extends Tab
                  */
                 final ParameterDescriptor<?> descriptor = (ParameterDescriptor<?>) generalDescriptor;
                 final Class<?> valueClass = descriptor.getValueClass();
-                table.append(getFormat(Class.class).format(valueClass, buffer, fp).toString());
-                table.append(beforeFill);
-                table.nextColumn(fillCharacter);
+                table.append(getFormat(Class.class).format(valueClass, buffer, dummyFP).toString());
+                nextColumn(table);
                 buffer.setLength(0);
                 /*
+                 * Writes the obligation (mandatory or optional).
+                 */
+                if (showObligation) {
+                    final int minimumOccurs = descriptor.getMinimumOccurs();
+                    final int maximumOccurs = descriptor.getMaximumOccurs();
+                    if (maximumOccurs == 1) {
+                        table.append(resources.getString(minimumOccurs == 0 ?
+                                Vocabulary.Keys.Optional : Vocabulary.Keys.Mandatory));
+                    } else {
+                        final Format f = getFormat(Integer.class);
+                        table.append(f.format(minimumOccurs, buffer, dummyFP).toString()).append(" … ");
+                        buffer.setLength(0);
+                        if (maximumOccurs == Integer.MAX_VALUE) {
+                            table.append('∞');
+                        } else {
+                            table.append(f.format(maximumOccurs, buffer, dummyFP).toString());
+                            buffer.setLength(0);
+                        }
+                    }
+                    nextColumn(table);
+                }
+                /*
                  * Writes minimum and maximum values, together with the unit of measurement (if any).
                  */
                 final String valueDomain = row.valueDomain;
                 if (valueDomain != null) {
                     table.append(CharSequences.spaces(valueDomainAlignment - row.valueDomainAlignment)).append(valueDomain);
                 }
-                table.append(beforeFill);
-                table.nextColumn(fillCharacter);
+                nextColumn(table);
                 /*
                  * Writes the values, each on its own line, together with their unit of measurement.
                  */
@@ -623,7 +670,7 @@ public class ParameterFormat extends Tab
                         }
                         final Format format = getFormat(value.getClass());
                         if (format != null) {
-                            value = format.format(value, buffer, fp);
+                            value = format.format(value, buffer, dummyFP);
                         }
                         table.append(value.toString());
                         buffer.setLength(0);
@@ -773,8 +820,7 @@ public class ParameterFormat extends Tab
                 codespace = X364.BOLD.sequence() + codespace + X364.NORMAL.sequence();
             }
             table.append(codespace);
-            table.append(beforeFill);
-            table.nextColumn(fillCharacter);
+            nextColumn(table);
         }
         table.appendHorizontalSeparator();
         /*
@@ -789,8 +835,7 @@ public class ParameterFormat extends Tab
                         table.append(name);
                     }
                 }
-                table.append(beforeFill);
-                table.nextColumn(fillCharacter);
+                nextColumn(table);
             }
             table.nextLine();
         }

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterTableRow.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterTableRow.java?rev=1578181&r1=1578180&r2=1578181&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterTableRow.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterTableRow.java [UTF-8] Sun Mar 16 23:30:17 2014
@@ -307,6 +307,9 @@ final class ParameterTableRow {
     final void writeIdentifiers(final Appendable out, final boolean writeCodespaces,
             final Colors colors, final boolean colorsForRows, final String lineSeparator) throws IOException
     {
+        if (codespaceWidth != 0) {
+            codespaceWidth++; // Add a space between codespace and code in e.g. "OGC: Mercator".
+        }
         boolean isNewLine = false;
         for (final Map.Entry<String,Set<Object>> entry : identifiers.entrySet()) {
             final String codespace = entry.getKey();
@@ -323,7 +326,7 @@ final class ParameterTableRow {
                  */
                 writeColor(out, colors, ElementKind.NAME);
                 if (writeCodespaces) {
-                    int pad = codespaceWidth + 1;
+                    int pad = codespaceWidth;
                     if (codespace != null) {
                         writeColor(out, FAINT, colorsForRows);
                         out.append(codespace).append(':');

Copied: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorParameters.java (from r1578178, sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorParameters.java)
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorParameters.java?p2=sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorParameters.java&p1=sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorParameters.java&r1=1578178&r2=1578181&rev=1578181&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorParameters.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorParameters.java [UTF-8] Sun Mar 16 23:30:17 2014
@@ -624,8 +624,8 @@ public class TensorParameters<E> impleme
                     cause = e;
                 }
                 if (indices == null) {
-                    throw new InvalidParameterNameException(Errors.format(
-                                Errors.Keys.UnexpectedParameter_1, name), cause, name);
+                    throw (InvalidParameterNameException) new InvalidParameterNameException(Errors.format(
+                                Errors.Keys.UnexpectedParameter_1, name), name).initCause(cause);
                 }
                 matrix.setElement(indices[0], indices[1], ((ParameterValue<?>) param).doubleValue());
             }

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java?rev=1578181&r1=1578180&r2=1578181&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/AbstractCRS.java [UTF-8] Sun Mar 16 23:30:17 2014
@@ -244,7 +244,9 @@ public class AbstractCRS extends Abstrac
      * will override this method with public access and more specific return type.
      */
     Datum getDatum() {
-        return null;
+        // User could provide his own CRS implementation outside this SIS package, so we have
+        // to check for SingleCRS interface. But all SIS classes override this implementation.
+        return (this instanceof SingleCRS) ? ((SingleCRS) this).getDatum() : null;
     }
 
     /**

Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java?rev=1578181&r1=1578180&r2=1578181&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java [UTF-8] Sun Mar 16 23:30:17 2014
@@ -24,6 +24,7 @@ import java.io.IOException;
 import java.io.ObjectInputStream;
 import javax.xml.bind.annotation.XmlType;
 import javax.xml.bind.annotation.XmlRootElement;
+import org.opengis.referencing.datum.Datum;
 import org.opengis.referencing.crs.SingleCRS;
 import org.opengis.referencing.crs.CompoundCRS;
 import org.opengis.referencing.crs.CoordinateReferenceSystem;
@@ -269,6 +270,14 @@ public class DefaultCompoundCRS extends 
     }
 
     /**
+     * Compound CRS do not have datum.
+     */
+    @Override
+    final Datum getDatum() {
+        return null;
+    }
+
+    /**
      * Returns the ordered list of coordinate reference systems.
      * This is the list of CRS given at construction time.
      * This list may contains other {@code CompoundCRS} instances, as described in class Javadoc.

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorGroupTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorGroupTest.java?rev=1578181&r1=1578180&r2=1578181&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorGroupTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorGroupTest.java [UTF-8] Sun Mar 16 23:30:17 2014
@@ -91,7 +91,7 @@ public final strictfp class DefaultParam
     }
 
     /**
-     * Validates the test parameter descriptors created by {@link #createGroup_2M_2O()}.
+     * Validates the test parameter descriptors given by {@link #M1_M1_O1_O2}.
      */
     @Test
     public void validateTestObjects() {

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueGroupTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueGroupTest.java?rev=1578181&r1=1578180&r2=1578181&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueGroupTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueGroupTest.java [UTF-8] Sun Mar 16 23:30:17 2014
@@ -92,7 +92,7 @@ public final strictfp class DefaultParam
     }
 
     /**
-     * Validates the test parameter values created by {@link #createValues(List, int)}.
+     * Validates the test parameter values created by {@link #createValues(int)}.
      */
     @Test
     public void validateTestObjects() {

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/MultiOccurrenceDescriptor.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/MultiOccurrenceDescriptor.java?rev=1578181&r1=1578180&r2=1578181&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/MultiOccurrenceDescriptor.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/MultiOccurrenceDescriptor.java [UTF-8] Sun Mar 16 23:30:17 2014
@@ -30,7 +30,7 @@ import org.apache.sis.measure.Range;
  * @module
  */
 @SuppressWarnings("serial")
-final class MultiOccurrenceDescriptor<T> extends DefaultParameterDescriptor<T> {
+final strictfp class MultiOccurrenceDescriptor<T> extends DefaultParameterDescriptor<T> {
     /**
      * Creates a new descriptor with the given name and default value.
      */

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterFormatTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterFormatTest.java?rev=1578181&r1=1578180&r2=1578181&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterFormatTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParameterFormatTest.java [UTF-8] Sun Mar 16 23:30:17 2014
@@ -63,11 +63,11 @@ public final strictfp class ParameterFor
         ParameterBuilder builder = new ParameterBuilder();
         builder.setCodeSpace(OGP, "EPSG").setRequired(true);
         ParameterDescriptor<?>[] parameters = {
-            builder.addName("Latitude of natural origin")    .addName(OGC, "latitude_of_origin").createBounded( -80,  +84,  40, NonSI.DEGREE_ANGLE),
-            builder.addName("Longitude of natural origin")   .addName(OGC, "central_meridian")  .createBounded(-180, +180, -60, NonSI.DEGREE_ANGLE),
-            builder.addName("Scale factor at natural origin").addName(OGC, "scale_factor")      .createStrictlyPositive(1, Unit.ONE),
-            builder.addName("False easting")                 .addName(OGC, "FalseEasting")      .create( 5000, SI.METRE),
-            builder.addName("False northing")                .addName(OGC, "FalseNorthing")     .create(10000, SI.METRE)
+            builder.addName("Latitude of natural origin")      .addName(OGC, "latitude_of_origin").createBounded( -80,  +84,  40, NonSI.DEGREE_ANGLE),
+            builder.addName("Longitude of natural origin")     .addName(OGC, "central_meridian")  .createBounded(-180, +180, -60, NonSI.DEGREE_ANGLE),
+            builder.addName("Scale factor at natural origin")  .addName(OGC, "scale_factor")      .createStrictlyPositive(1, Unit.ONE),
+            builder.addName("False easting").setRequired(false).addName(OGC, "false_easting")     .create( 5000, SI.METRE),
+            builder.addName("False northing")                  .addName(OGC, "false_northing")    .create(10000, SI.METRE)
         };
         builder.addIdentifier("9804")
                .addName("Mercator (variant A)")
@@ -86,55 +86,76 @@ public final strictfp class ParameterFor
 
     /**
      * Creates parameter values with some arbitrary values different than the default values.
+     * This method intentionally leaves {@code "central_meridian"} (a mandatory parameter) and
+     * {@code "false_easting"} (an optional parameter) undefined, in order to test whether the
+     * formatter fallback on default values.
      */
     private static ParameterValueGroup createParameterValues() {
         final ParameterValueGroup group = descriptor.createValue();
         group.parameter("latitude_of_origin").setValue(20);
-        group.parameter("central_meridian").setValue(-70);
         group.parameter("scale_factor").setValue(0.997);
-        group.parameter("FalseNorthing").setValue(20, SI.KILOMETRE);
+        group.parameter("false_northing").setValue(20, SI.KILOMETRE);
         return group;
     }
 
     /**
-     * Tests {@link ParameterFormat#format(Object, Appendable)} with {@code ContentLevel.BRIEF}.
+     * Tests {@link ParameterFormat#format(Object, Appendable)} for descriptors with {@code ContentLevel.BRIEF}.
+     * All parameter shall unconditionally be shown, even if optional. The table contains a column saying whether
+     * the parameter is mandatory or optional.
      */
     @Test
-    public void testFormatBrief() {
+    public void testFormatBriefDescriptors() {
         final ParameterFormat format = new ParameterFormat(null, null);
         format.setContentLevel(ParameterFormat.ContentLevel.BRIEF);
-        String text = format.format(descriptor);
+        final String text = format.format(descriptor);
         assertMultilinesEquals(
                 "EPSG: Mercator (variant A)\n" +
-                "┌────────────────────────────────┬────────┬───────────────┬───────────────┐\n" +
-                "│ Name (EPSG)                    │ Type   │ Value domain  │ Default value │\n" +
-                "├────────────────────────────────┼────────┼───────────────┼───────────────┤\n" +
-                "│ Latitude of natural origin     │ Double │  [-80 … 84]°  │        40.0°  │\n" +
-                "│ Longitude of natural origin    │ Double │ [-180 … 180]° │       -60.0°  │\n" +
-                "│ Scale factor at natural origin │ Double │    (0 … ∞)    │         1.0   │\n" +
-                "│ False easting                  │ Double │   (-∞ … ∞) m  │      5000.0 m │\n" +
-                "│ False northing                 │ Double │   (-∞ … ∞) m  │     10000.0 m │\n" +
-                "└────────────────────────────────┴────────┴───────────────┴───────────────┘\n", text);
+                "┌────────────────────────────────┬────────┬────────────┬───────────────┬───────────────┐\n" +
+                "│ Name (EPSG)                    │ Type   │ Obligation │ Value domain  │ Default value │\n" +
+                "├────────────────────────────────┼────────┼────────────┼───────────────┼───────────────┤\n" +
+                "│ Latitude of natural origin     │ Double │ Mandatory  │  [-80 … 84]°  │        40.0°  │\n" +
+                "│ Longitude of natural origin    │ Double │ Mandatory  │ [-180 … 180]° │       -60.0°  │\n" +
+                "│ Scale factor at natural origin │ Double │ Mandatory  │    (0 … ∞)    │         1.0   │\n" +
+                "│ False easting                  │ Double │ Optional   │   (-∞ … ∞) m  │      5000.0 m │\n" +
+                "│ False northing                 │ Double │ Optional   │   (-∞ … ∞) m  │     10000.0 m │\n" +
+                "└────────────────────────────────┴────────┴────────────┴───────────────┴───────────────┘\n", text);
+    }
 
-        text = format.format(createParameterValues());
+    /**
+     * Tests {@link ParameterFormat#format(Object, Appendable)} for values with {@code ContentLevel.BRIEF}.
+     * Expected behavior:
+     *
+     * <ul>
+     *   <li>{@code "Longitude of natural origin"} parameter, while not defined, shall be shown with its default
+     *       value, because this parameter is defined as mandatory in this test suite.</li>
+     *   <li>{@code "False easting"} parameter shall be omitted, because this parameter is defined as
+     *       optional in this test suite and its value has not been defined.</li>
+     *   <li>The obligation column is omitted, because not very useful in the case of parameter values..</li>
+     * </ul>
+     */
+    @Test
+    @DependsOnMethod("testFormatBriefDescriptors")
+    public void testFormatBriefValues() {
+        final ParameterFormat format = new ParameterFormat(null, null);
+        format.setContentLevel(ParameterFormat.ContentLevel.BRIEF);
+        final String text = format.format(createParameterValues());
         assertMultilinesEquals(
                 "EPSG: Mercator (variant A)\n" +
-                "┌────────────────────────────────┬────────┬───────────────┬───────────┐\n" +
-                "│ Name (EPSG)                    │ Type   │ Value domain  │ Value     │\n" +
-                "├────────────────────────────────┼────────┼───────────────┼───────────┤\n" +
-                "│ Latitude of natural origin     │ Double │  [-80 … 84]°  │   20.0°   │\n" +
-                "│ Longitude of natural origin    │ Double │ [-180 … 180]° │  -70.0°   │\n" +
-                "│ Scale factor at natural origin │ Double │    (0 … ∞)    │  0.997    │\n" +
-                "│ False easting                  │ Double │   (-∞ … ∞) m  │ 5000.0 m  │\n" +
-                "│ False northing                 │ Double │   (-∞ … ∞) m  │   20.0 km │\n" +
-                "└────────────────────────────────┴────────┴───────────────┴───────────┘\n", text);
+                "┌────────────────────────────────┬────────┬───────────────┬──────────┐\n" +
+                "│ Name (EPSG)                    │ Type   │ Value domain  │ Value    │\n" +
+                "├────────────────────────────────┼────────┼───────────────┼──────────┤\n" +
+                "│ Latitude of natural origin     │ Double │  [-80 … 84]°  │  20.0°   │\n" +
+                "│ Longitude of natural origin    │ Double │ [-180 … 180]° │ -60.0°   │\n" +
+                "│ Scale factor at natural origin │ Double │    (0 … ∞)    │ 0.997    │\n" +
+                "│ False northing                 │ Double │   (-∞ … ∞) m  │  20.0 km │\n" +
+                "└────────────────────────────────┴────────┴───────────────┴──────────┘\n", text);
     }
 
     /**
      * Tests formatting in a non-English locale.
      */
     @Test
-    @DependsOnMethod("testFormatBrief")
+    @DependsOnMethod("testFormatBriefValues")
     public void testFormatLocalized() {
         final ParameterFormat format = new ParameterFormat(Locale.FRANCE, null);
         format.setContentLevel(ParameterFormat.ContentLevel.BRIEF);
@@ -145,67 +166,73 @@ public final strictfp class ParameterFor
                 "│ Nom (EPSG)                     │ Type   │ Domaine des valeurs │ Valeur   │\n" +
                 "├────────────────────────────────┼────────┼─────────────────────┼──────────┤\n" +
                 "│ Latitude of natural origin     │ Double │  [-80 … 84]°        │    20°   │\n" +
-                "│ Longitude of natural origin    │ Double │ [-180 … 180]°       │   -70°   │\n" +
+                "│ Longitude of natural origin    │ Double │ [-180 … 180]°       │   -60°   │\n" +
                 "│ Scale factor at natural origin │ Double │    (0 … ∞)          │ 0,997    │\n" +
-                "│ False easting                  │ Double │   (-∞ … ∞) m        │ 5 000 m  │\n" +
                 "│ False northing                 │ Double │   (-∞ … ∞) m        │    20 km │\n" +
                 "└────────────────────────────────┴────────┴─────────────────────┴──────────┘\n", text);
     }
 
     /**
-     * Tests {@link ParameterFormat#format(Object, Appendable)} with {@code ContentLevel.DETAILED}.
+     * Tests {@link ParameterFormat#format(Object, Appendable)} for descriptors with {@code ContentLevel.DETAILED}.
      */
     @Test
-    public void testFormatDetailed() {
+    public void testFormatDetailedDescriptors() {
         final ParameterFormat format = new ParameterFormat(null, null);
         format.setContentLevel(ParameterFormat.ContentLevel.DETAILED);
-        String text = format.format(descriptor);
+        final String text = format.format(descriptor);
         assertMultilinesEquals(
                 "EPSG: Mercator (variant A) (9804)\n" +
                 "EPSG: Mercator (1SP)\n" +
                 "OGC:  Mercator_1SP\n" +
-                "╔══════════════════════════════════════╤════════╤═══════════════╤═══════════════╗\n" +
-                "║ Name                                 │ Type   │ Value domain  │ Default value ║\n" +
-                "╟──────────────────────────────────────┼────────┼───────────────┼───────────────╢\n" +
-                "║ EPSG: Latitude of natural origin     │ Double │  [-80 … 84]°  │        40.0°  ║\n" +
-                "║ OGC:  latitude_of_origin             │        │               │               ║\n" +
-                "╟──────────────────────────────────────┼────────┼───────────────┼───────────────╢\n" +
-                "║ EPSG: Longitude of natural origin    │ Double │ [-180 … 180]° │       -60.0°  ║\n" +
-                "║ OGC:  central_meridian               │        │               │               ║\n" +
-                "╟──────────────────────────────────────┼────────┼───────────────┼───────────────╢\n" +
-                "║ EPSG: Scale factor at natural origin │ Double │    (0 … ∞)    │         1.0   ║\n" +
-                "║ OGC:  scale_factor                   │        │               │               ║\n" +
-                "╟──────────────────────────────────────┼────────┼───────────────┼───────────────╢\n" +
-                "║ EPSG: False easting                  │ Double │   (-∞ … ∞) m  │      5000.0 m ║\n" +
-                "║ OGC:  FalseEasting                   │        │               │               ║\n" +
-                "╟──────────────────────────────────────┼────────┼───────────────┼───────────────╢\n" +
-                "║ EPSG: False northing                 │ Double │   (-∞ … ∞) m  │     10000.0 m ║\n" +
-                "║ OGC:  FalseNorthing                  │        │               │               ║\n" +
-                "╚══════════════════════════════════════╧════════╧═══════════════╧═══════════════╝\n", text);
+                "╔══════════════════════════════════════╤════════╤════════════╤═══════════════╤═══════════════╗\n" +
+                "║ Name                                 │ Type   │ Obligation │ Value domain  │ Default value ║\n" +
+                "╟──────────────────────────────────────┼────────┼────────────┼───────────────┼───────────────╢\n" +
+                "║ EPSG: Latitude of natural origin     │ Double │ Mandatory  │  [-80 … 84]°  │        40.0°  ║\n" +
+                "║ OGC:  latitude_of_origin             │        │            │               │               ║\n" +
+                "╟──────────────────────────────────────┼────────┼────────────┼───────────────┼───────────────╢\n" +
+                "║ EPSG: Longitude of natural origin    │ Double │ Mandatory  │ [-180 … 180]° │       -60.0°  ║\n" +
+                "║ OGC:  central_meridian               │        │            │               │               ║\n" +
+                "╟──────────────────────────────────────┼────────┼────────────┼───────────────┼───────────────╢\n" +
+                "║ EPSG: Scale factor at natural origin │ Double │ Mandatory  │    (0 … ∞)    │         1.0   ║\n" +
+                "║ OGC:  scale_factor                   │        │            │               │               ║\n" +
+                "╟──────────────────────────────────────┼────────┼────────────┼───────────────┼───────────────╢\n" +
+                "║ EPSG: False easting                  │ Double │ Optional   │   (-∞ … ∞) m  │      5000.0 m ║\n" +
+                "║ OGC:  false_easting                  │        │            │               │               ║\n" +
+                "╟──────────────────────────────────────┼────────┼────────────┼───────────────┼───────────────╢\n" +
+                "║ EPSG: False northing                 │ Double │ Optional   │   (-∞ … ∞) m  │     10000.0 m ║\n" +
+                "║ OGC:  false_northing                 │        │            │               │               ║\n" +
+                "╚══════════════════════════════════════╧════════╧════════════╧═══════════════╧═══════════════╝\n", text);
+    }
 
-        text = format.format(createParameterValues());
+    /**
+     * Tests {@link ParameterFormat#format(Object, Appendable)} for values with {@code ContentLevel.DETAILED}.
+     * The same comments than {@link #testFormatBriefValues()} apply, except that the column of obligation is
+     * still shown.
+     */
+    @Test
+    public void testFormatDetailedValues() {
+        final ParameterFormat format = new ParameterFormat(null, null);
+        format.setContentLevel(ParameterFormat.ContentLevel.DETAILED);
+        final String text = format.format(createParameterValues());
         assertMultilinesEquals(
                 "EPSG: Mercator (variant A) (9804)\n" +
                 "EPSG: Mercator (1SP)\n" +
                 "OGC:  Mercator_1SP\n" +
-                "╔══════════════════════════════════════╤════════╤═══════════════╤═══════════╗\n" +
-                "║ Name                                 │ Type   │ Value domain  │ Value     ║\n" +
-                "╟──────────────────────────────────────┼────────┼───────────────┼───────────╢\n" +
-                "║ EPSG: Latitude of natural origin     │ Double │  [-80 … 84]°  │   20.0°   ║\n" +
-                "║ OGC:  latitude_of_origin             │        │               │           ║\n" +
-                "╟──────────────────────────────────────┼────────┼───────────────┼───────────╢\n" +
-                "║ EPSG: Longitude of natural origin    │ Double │ [-180 … 180]° │  -70.0°   ║\n" +
-                "║ OGC:  central_meridian               │        │               │           ║\n" +
-                "╟──────────────────────────────────────┼────────┼───────────────┼───────────╢\n" +
-                "║ EPSG: Scale factor at natural origin │ Double │    (0 … ∞)    │  0.997    ║\n" +
-                "║ OGC:  scale_factor                   │        │               │           ║\n" +
-                "╟──────────────────────────────────────┼────────┼───────────────┼───────────╢\n" +
-                "║ EPSG: False easting                  │ Double │   (-∞ … ∞) m  │ 5000.0 m  ║\n" +
-                "║ OGC:  FalseEasting                   │        │               │           ║\n" +
-                "╟──────────────────────────────────────┼────────┼───────────────┼───────────╢\n" +
-                "║ EPSG: False northing                 │ Double │   (-∞ … ∞) m  │   20.0 km ║\n" +
-                "║ OGC:  FalseNorthing                  │        │               │           ║\n" +
-                "╚══════════════════════════════════════╧════════╧═══════════════╧═══════════╝\n", text);
+                "╔══════════════════════════════════════╤════════╤════════════╤═══════════════╤══════════╗\n" +
+                "║ Name                                 │ Type   │ Obligation │ Value domain  │ Value    ║\n" +
+                "╟──────────────────────────────────────┼────────┼────────────┼───────────────┼──────────╢\n" +
+                "║ EPSG: Latitude of natural origin     │ Double │ Mandatory  │  [-80 … 84]°  │  20.0°   ║\n" +
+                "║ OGC:  latitude_of_origin             │        │            │               │          ║\n" +
+                "╟──────────────────────────────────────┼────────┼────────────┼───────────────┼──────────╢\n" +
+                "║ EPSG: Longitude of natural origin    │ Double │ Mandatory  │ [-180 … 180]° │ -60.0°   ║\n" +
+                "║ OGC:  central_meridian               │        │            │               │          ║\n" +
+                "╟──────────────────────────────────────┼────────┼────────────┼───────────────┼──────────╢\n" +
+                "║ EPSG: Scale factor at natural origin │ Double │ Mandatory  │    (0 … ∞)    │ 0.997    ║\n" +
+                "║ OGC:  scale_factor                   │        │            │               │          ║\n" +
+                "╟──────────────────────────────────────┼────────┼────────────┼───────────────┼──────────╢\n" +
+                "║ EPSG: False northing                 │ Double │ Optional   │   (-∞ … ∞) m  │  20.0 km ║\n" +
+                "║ OGC:  false_northing                 │        │            │               │          ║\n" +
+                "╚══════════════════════════════════════╧════════╧════════════╧═══════════════╧══════════╝\n", text);
     }
 
     /**
@@ -232,8 +259,8 @@ public final strictfp class ParameterFor
                 "│ Latitude of natural origin     │ latitude_of_origin │\n" +
                 "│ Longitude of natural origin    │ central_meridian   │\n" +
                 "│ Scale factor at natural origin │ scale_factor       │\n" +
-                "│ False easting                  │ FalseEasting       │\n" +
-                "│ False northing                 │ FalseNorthing      │\n" +
+                "│ False easting                  │ false_easting      │\n" +
+                "│ False northing                 │ false_northing     │\n" +
                 "└────────────────────────────────┴────────────────────┘\n", text);
     }
 
@@ -241,7 +268,7 @@ public final strictfp class ParameterFor
      * Tests the effect of {@link ParameterFormat#setPreferredCodespaces(String[])}.
      */
     @Test
-    @DependsOnMethod({"testFormatNameSummary", "testFormatBrief"})
+    @DependsOnMethod({"testFormatNameSummary", "testFormatBriefValues"})
     public void testPreferredCodespaces() {
         final ParameterFormat format = new ParameterFormat(null, null);
         format.setContentLevel(ParameterFormat.ContentLevel.NAME_SUMMARY);
@@ -270,14 +297,36 @@ public final strictfp class ParameterFor
         text = format.format(createParameterValues());
         assertMultilinesEquals(
                 "OGC: Mercator_1SP\n" +
-                "┌────────────────────┬────────┬───────────────┬───────────┐\n" +
-                "│ Name (OGC)         │ Type   │ Value domain  │ Value     │\n" +
-                "├────────────────────┼────────┼───────────────┼───────────┤\n" +
-                "│ latitude_of_origin │ Double │  [-80 … 84]°  │   20.0°   │\n" +
-                "│ central_meridian   │ Double │ [-180 … 180]° │  -70.0°   │\n" +
-                "│ scale_factor       │ Double │    (0 … ∞)    │  0.997    │\n" +
-                "│ FalseEasting       │ Double │   (-∞ … ∞) m  │ 5000.0 m  │\n" +
-                "│ FalseNorthing      │ Double │   (-∞ … ∞) m  │   20.0 km │\n" +
-                "└────────────────────┴────────┴───────────────┴───────────┘\n", text);
+                "┌────────────────────┬────────┬───────────────┬──────────┐\n" +
+                "│ Name (OGC)         │ Type   │ Value domain  │ Value    │\n" +
+                "├────────────────────┼────────┼───────────────┼──────────┤\n" +
+                "│ latitude_of_origin │ Double │  [-80 … 84]°  │  20.0°   │\n" +
+                "│ central_meridian   │ Double │ [-180 … 180]° │ -60.0°   │\n" +
+                "│ scale_factor       │ Double │    (0 … ∞)    │ 0.997    │\n" +
+                "│ false_northing     │ Double │   (-∞ … ∞) m  │  20.0 km │\n" +
+                "└────────────────────┴────────┴───────────────┴──────────┘\n", text);
+    }
+
+    /**
+     * Tests the formatting of a parameter value group with an invalid cardinality.
+     * While not allowed by ISO 19111, the Apache SIS implementation shall be robust
+     * to those cases.
+     */
+    @Test
+    @DependsOnMethod("testFormatBriefDescriptors")
+    public void testInvalidCardinality() {
+        final ParameterFormat format = new ParameterFormat(null, null);
+        format.setContentLevel(ParameterFormat.ContentLevel.BRIEF);
+        final String text = format.format(DefaultParameterDescriptorGroupTest.M1_M1_O1_O2);
+        assertMultilinesEquals(
+                "Test group\n" +
+                "┌─────────────┬─────────┬────────────┬──────────────┬───────────────┐\n" +
+                "│ Name        │ Type    │ Obligation │ Value domain │ Default value │\n" +
+                "├─────────────┼─────────┼────────────┼──────────────┼───────────────┤\n" +
+                "│ Mandatory 1 │ Integer │ Mandatory  │              │            10 │\n" +
+                "│ Mandatory 2 │ Integer │ Mandatory  │              │            10 │\n" +
+                "│ Optional 3  │ Integer │ Optional   │              │            10 │\n" +
+                "│ Optional 4  │ Integer │ 0 … 2      │              │            10 │\n" +
+                "└─────────────┴─────────┴────────────┴──────────────┴───────────────┘\n", text);
     }
 }

Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParametersTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParametersTest.java?rev=1578181&r1=1578180&r2=1578181&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParametersTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParametersTest.java [UTF-8] Sun Mar 16 23:30:17 2014
@@ -43,8 +43,11 @@ import static org.junit.Assert.*;
  * @version 0.4
  * @module
  */
-@DependsOn({DefaultParameterDescriptorTest.class, DefaultParameterValueTest.class})
-public final class ParametersTest extends TestCase {
+@DependsOn({
+    DefaultParameterDescriptorTest.class,
+    DefaultParameterValueTest.class
+})
+public final strictfp class ParametersTest extends TestCase {
     /**
      * Tests the {@link Parameters#cast(ParameterDescriptor, Class)} and
      * {@link Parameters#cast(ParameterValue, Class)} methods.

Copied: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/TensorParametersTest.java (from r1578178, sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/parameter/TensorParametersTest.java)
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/TensorParametersTest.java?p2=sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/TensorParametersTest.java&p1=sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/parameter/TensorParametersTest.java&r1=1578178&r2=1578181&rev=1578181&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/parameter/TensorParametersTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/parameter/TensorParametersTest.java [UTF-8] Sun Mar 16 23:30:17 2014
@@ -31,7 +31,6 @@ import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
 import static java.util.Collections.singletonMap;
-import static org.opengis.test.Validators.validate;
 import static org.opengis.referencing.IdentifiedObject.NAME_KEY;
 import static org.apache.sis.parameter.TensorParameters.WKT1;
 import static org.apache.sis.test.Assert.*;
@@ -180,7 +179,6 @@ public final strictfp class TensorParame
                     }
                 }
                 final ParameterValueGroup group = WKT1.createValueGroup(singletonMap(NAME_KEY, "Test"), matrix);
-                validate(group);
                 assertEquals("num_row",  numRow, group.parameter("num_row").intValue());
                 assertEquals("num_col",  numCol, group.parameter("num_col").intValue());
                 assertEquals("elements", matrix, WKT1.toMatrix(group));



Mime
View raw message