sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1623886 - in /sis/branches/JDK8/core: sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/ sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/ sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/...
Date Tue, 09 Sep 2014 23:49:32 GMT
Author: desruisseaux
Date: Tue Sep  9 23:49:31 2014
New Revision: 1623886

URL: http://svn.apache.org/r1623886
Log:
Adapt SIS code for the GeoAPI change http://jira.codehaus.org/browse/GEO-242
This is about trying to provide a unified parameter API for ISO 19111, ISO 19115 and WPS standard.

Added:
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameter.java
      - copied, changed from r1623354, sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/DefaultParameter.java
    sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/metadata/
    sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/metadata/replace/
    sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameterTest.java
      - copied, changed from r1623833, sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/service/DefaultParameterTest.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/AbstractParameterDescriptor.java   (with props)
Removed:
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/DefaultParameter.java
    sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/service/DefaultParameterTest.java
Modified:
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/SV_ParameterDirection.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/SV_Parameter.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ReferenceSystemMetadata.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/MetadataUtilities.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/DefaultOperationMetadata.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/OperationName.java
    sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java
    sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java
    sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/service/DefaultCoupledResourceTest.java
    sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/service/DefaultServiceIdentificationTest.java
    sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorValues.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/package-info.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParametersTest.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifiedObject.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java
    sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/util/iso/TypesTest.java

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/SV_ParameterDirection.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/SV_ParameterDirection.java?rev=1623886&r1=1623885&r2=1623886&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/SV_ParameterDirection.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/code/SV_ParameterDirection.java [UTF-8] Tue Sep  9 23:49:31 2014
@@ -17,7 +17,7 @@
 package org.apache.sis.internal.jaxb.code;
 
 import javax.xml.bind.annotation.XmlElement;
-import org.opengis.metadata.service.ParameterDirection;
+import org.opengis.parameter.ParameterDirection;
 import org.apache.sis.internal.jaxb.gmd.EnumAdapter;
 import org.apache.sis.xml.Namespaces;
 

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/SV_Parameter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/SV_Parameter.java?rev=1623886&r1=1623885&r2=1623886&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/SV_Parameter.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/SV_Parameter.java [UTF-8] Tue Sep  9 23:49:31 2014
@@ -17,9 +17,9 @@
 package org.apache.sis.internal.jaxb.metadata;
 
 import javax.xml.bind.annotation.XmlElementRef;
-import org.opengis.metadata.service.Parameter;
-import org.apache.sis.metadata.iso.service.DefaultParameter;
+import org.opengis.parameter.ParameterDescriptor;
 import org.apache.sis.internal.jaxb.gco.PropertyType;
+import org.apache.sis.internal.jaxb.metadata.replace.ServiceParameter;
 
 
 /**
@@ -31,7 +31,7 @@ import org.apache.sis.internal.jaxb.gco.
  * @version 0.5
  * @module
  */
-public final class SV_Parameter extends PropertyType<SV_Parameter, Parameter> {
+public final class SV_Parameter extends PropertyType<SV_Parameter, ParameterDescriptor<?>> {
     /**
      * Empty constructor for JAXB only.
      */
@@ -43,17 +43,18 @@ public final class SV_Parameter extends 
      * This method is indirectly invoked by the private constructor
      * below, so it shall not depend on the state of this object.
      *
-     * @return {@code Parameter.class}
+     * @return {@code ParameterDescriptor.class}
      */
     @Override
-    protected Class<Parameter> getBoundType() {
-        return Parameter.class;
+    @SuppressWarnings("unchecked")
+    protected Class<ParameterDescriptor<?>> getBoundType() {
+        return (Class) ParameterDescriptor.class;
     }
 
     /**
      * Constructor for the {@link #wrap} method only.
      */
-    private SV_Parameter(final Parameter metadata) {
+    private SV_Parameter(final ParameterDescriptor<?> metadata) {
         super(metadata);
     }
 
@@ -65,7 +66,7 @@ public final class SV_Parameter extends 
      * @return A {@code PropertyType} wrapping the given the metadata element.
      */
     @Override
-    protected SV_Parameter wrap(final Parameter metadata) {
+    protected SV_Parameter wrap(final ParameterDescriptor<?> metadata) {
         return new SV_Parameter(metadata);
     }
 
@@ -77,8 +78,8 @@ public final class SV_Parameter extends 
      * @return The metadata to be marshalled.
      */
     @XmlElementRef
-    public DefaultParameter getElement() {
-        return DefaultParameter.castOrCopy(metadata);
+    public ServiceParameter<?> getElement() {
+        return ServiceParameter.castOrCopy(metadata);
     }
 
     /**
@@ -86,7 +87,7 @@ public final class SV_Parameter extends 
      *
      * @param metadata The unmarshalled metadata.
      */
-    public void setElement(final DefaultParameter metadata) {
+    public void setElement(final ServiceParameter<?> metadata) {
         this.metadata = metadata;
     }
 }

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ReferenceSystemMetadata.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ReferenceSystemMetadata.java?rev=1623886&r1=1623885&r2=1623886&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ReferenceSystemMetadata.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ReferenceSystemMetadata.java [UTF-8] Tue Sep  9 23:49:31 2014
@@ -91,7 +91,7 @@ public class ReferenceSystemMetadata ext
      * @param name The new primary name.
      */
     public void setName(final ReferenceIdentifier name) {
-        referenceSystemIdentifier = name;
+        this.name = name;
     }
 
     /**

Copied: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameter.java (from r1623354, sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/DefaultParameter.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameter.java?p2=sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameter.java&p1=sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/DefaultParameter.java&r1=1623354&r2=1623886&rev=1623886&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/DefaultParameter.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameter.java [UTF-8] Tue Sep  9 23:49:31 2014
@@ -14,53 +14,58 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.sis.metadata.iso.service;
+package org.apache.sis.internal.jaxb.metadata.replace;
 
+import java.util.Set;
 import javax.xml.bind.annotation.XmlType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import javax.measure.unit.Unit;
 import org.opengis.util.TypeName;
 import org.opengis.util.MemberName;
+import org.opengis.util.GenericName;
 import org.opengis.util.InternationalString;
-import org.opengis.metadata.service.Parameter;
-import org.opengis.metadata.service.ParameterDirection;
-import org.apache.sis.metadata.iso.ISOMetadata;
+import org.opengis.parameter.ParameterValue;
+import org.opengis.parameter.ParameterDirection;
+import org.opengis.parameter.ParameterDescriptor;
+import org.opengis.referencing.ReferenceIdentifier;
+import org.apache.sis.internal.simple.SimpleIdentifiedObject;
 import org.apache.sis.internal.jaxb.metadata.direct.GO_MemberName;
+import org.apache.sis.xml.Namespaces;
 
+import static org.apache.sis.internal.util.CollectionsExt.nonNull;
 import static org.apache.sis.internal.jaxb.gco.PropertyType.LEGACY_XML;
 
 
 /**
- * Parameter information.
+ * Parameter information conform to the ISO 19115:2014 specification.
+ * GeoAPI tries to provides a single API for the parameter classes defined in various specifications
+ * (ISO 19111, ISO 19115, Web Processing Service). But we still need separated representations at XML
+ * (un)marshalling time. This class is for the ISO 19115:2014 case.
  *
- * <p><b>Limitations:</b></p>
- * <ul>
- *   <li>Instances of this class are not synchronized for multi-threading.
- *       Synchronization, if needed, is caller's responsibility.</li>
- *   <li>Serialized objects of this class are not guaranteed to be compatible with future Apache SIS releases.
- *       Serialization support is appropriate for short term storage or RMI between applications running the
- *       same version of Apache SIS. For long term storage, use {@link org.apache.sis.xml.XML} instead.</li>
- * </ul>
+ * <p>Note that this implementation is simple and serves no other purpose than being a container for XML
+ * parsing and formatting. For real parameter framework, consider using {@link org.apache.sis.parameter}
+ * package instead.</p>
+ *
+ * @param <T> The type of parameter values.
  *
  * @author  Rémi Maréchal (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
  * @version 0.5
  * @since   0.5
  * @module
- *
- * @todo Merge with {@link org.apache.sis.parameter}?
  */
-@XmlType(name = "SV_Parameter_Type", propOrder = {
+@XmlType(name = "SV_Parameter_Type", namespace = Namespaces.SRV, propOrder = {
     "name",
     "direction",
     "description",
-    "optionalityLabel",
+    "optionality",
     "repeatability",
     "valueType"
 })
-@XmlRootElement(name = "SV_Parameter")
-public class DefaultParameter extends ISOMetadata implements Parameter {
+@XmlRootElement(name = "SV_Parameter", namespace = Namespaces.SRV)
+public final class ServiceParameter<T> extends SimpleIdentifiedObject implements ParameterDescriptor<T> {
     /**
      * Serial number for compatibility with different versions.
      */
@@ -68,228 +73,168 @@ public class DefaultParameter extends IS
 
     /**
      * The name, as used by the service for this parameter.
+     *
+     * @see #getValueType()
      */
-    private MemberName name;
+    @XmlElement(required = true)
+    @XmlJavaTypeAdapter(GO_MemberName.class)
+    public MemberName name;
 
     /**
      * Indication if the parameter is an input to the service, an output or both.
      */
-    private ParameterDirection direction;
+    @XmlElement
+    public ParameterDirection direction;
 
     /**
      * A narrative explanation of the role of the parameter.
      */
-    private InternationalString description;
+    @XmlElement
+    public InternationalString description;
 
     /**
      * Indication if the parameter is required.
+     *
+     * <ul>
+     *   <li>In ISO 19115, this is represented by "{@code true}" or "{@code false}".</li>
+     *   <li>In ISO 19119, this is marshalled as "{@code Optional}" or "{@code Mandatory}".</li>
+     * </ul>
+     *
+     * @see #getOptionality()
+     * @see #setOptionality(String)
      */
-    private Boolean optionality;
+    public boolean optionality;
 
     /**
      * Indication if more than one value of the parameter may be provided.
      */
-    private Boolean repeatability;
+    @XmlElement(required = true)
+    public boolean repeatability;
 
     /**
-     * Constructs an initially empty parameter.
+     * Creates an initially empty parameter.
+     * This constructor is needed by JAXB.
      */
-    public DefaultParameter() {
+    public ServiceParameter() {
     }
 
     /**
-     * Constructs a new parameter initialized to the specified values.
-     *
-     * @param name          The name, as used by the service for this parameter.
-     * @param optionality   Indication if the parameter is required.
-     * @param repeatability Indication if more than one value of the parameter may be provided.
-     */
-    public DefaultParameter(final MemberName name,
-                            final boolean optionality,
-                            final boolean repeatability)
-    {
-        this.name          = name;
-        this.optionality   = optionality;
-        this.repeatability = repeatability;
+     * Creates a parameter initialized to the values of the given one.
+     */
+    private ServiceParameter(final ParameterDescriptor<T> parameter) {
+        name          = getName(parameter);
+        direction     = parameter.getDirection();
+        description   = parameter.getDescription();
+        optionality   = parameter.getMinimumOccurs() > 0;
+        repeatability = parameter.getMaximumOccurs() > 1;
     }
 
     /**
-     * Constructs a new instance initialized with the values from the specified metadata object.
-     * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the
-     * given object are not recursively copied.
+     * Returns the given parameter as an instance of {@code ServiceParameter}.
      *
-     * @param object The metadata to copy values from, or {@code null} if none.
-     *
-     * @see #castOrCopy(Parameter)
+     * @param  parameter The parameter (may be {@code null}).
+     * @return The service parameter, or {@code null} if the given argument was null.
      */
-    public DefaultParameter(final Parameter object) {
-        super(object);
-        if (object != null) {
-            this.name          = object.getName();
-            this.direction     = object.getDirection();
-            this.description   = object.getDescription();
-            this.optionality   = object.getOptionality();
-            this.repeatability = object.getRepeatability();
+    public static ServiceParameter<?> castOrCopy(final ParameterDescriptor<?> parameter) {
+        if (parameter == null || parameter instanceof ServiceParameter<?>) {
+            return (ServiceParameter<?>) parameter;
         }
+        return new ServiceParameter<>(parameter);
     }
 
     /**
-     * Returns a SIS metadata implementation with the values of the given arbitrary implementation.
-     * This method performs the first applicable action in the following choices:
-     *
-     * <ul>
-     *   <li>If the given object is {@code null}, then this method returns {@code null}.</li>
-     *   <li>Otherwise if the given object is already an instance of
-     *       {@code DefaultParameter}, then it is returned unchanged.</li>
-     *   <li>Otherwise a new {@code DefaultParameter} instance is created using the
-     *       {@linkplain #DefaultParameter(Parameter) copy constructor}
-     *       and returned. Note that this is a <cite>shallow</cite> copy operation, since the other
-     *       metadata contained in the given object are not recursively copied.</li>
-     * </ul>
-     *
-     * @param  object The object to get as a SIS implementation, or {@code null} if none.
-     * @return A SIS implementation containing the values of the given object (may be the
-     *         given object itself), or {@code null} if the argument was null.
-     */
-    public static DefaultParameter castOrCopy(final Parameter object) {
-        if (object == null || object instanceof DefaultParameter) {
-            return (DefaultParameter) object;
+     * Gets the parameter name as a {@code MemberName}. This method first check if the primary name is an instance of
+     * {@code MemberName}. If not, this method searches for the first alias which is an instance of {@code MemberName}.
+     * If none is found, then this method tries to build a member name from the primary name and value class.
+     *
+     * @param  parameter The parameter from which to get the name (may be {@code null}).
+     * @return The member name, or {@code null} if none.
+     */
+    public static MemberName getName(final ParameterDescriptor<?> parameter) {
+        if (parameter != null) {
+            final ReferenceIdentifier id = parameter.getName();
+            if (id instanceof MemberName) {
+                return (MemberName) id;
+            }
+            for (final GenericName alias : nonNull(parameter.getAlias())) {
+                if (alias instanceof MemberName) {
+                    return (MemberName) alias;
+                }
+            }
+            if (id != null) {
+                final Class<?> valueClass = parameter.getValueClass();
+                if (valueClass != null) {
+                    final String code = id.getCode();
+                    if (code != null) {
+                        // TODO return Names.createMemberName(id.getCodeSpace(), ":", code, valueClass);
+                    }
+                }
+            }
         }
-        return new DefaultParameter(object);
+        return null;
     }
 
-    /**
-     * Returns the name, as used by the service for this parameter.
-     *
-     * @return The name, as used by the service for this parameter.
-     */
     @Override
-    @XmlJavaTypeAdapter(GO_MemberName.class)
-    @XmlElement(name = "name", required = true)
-    public MemberName getName() {
-        return name;
+    public Class<T> getValueClass() {
+        throw new UnsupportedOperationException("Not supported yet."); // TODO
     }
 
     /**
-     * Sets the name.
-     *
-     * @param newValue The new name, as used by the service for this parameter.
+     * For JAXB marhalling of ISO 19119 document only.
+     * Note that there is not setter method, since we expect the same information
+     * to be provided in the {@link #name} attribute type.
      */
-    public void setName(final MemberName newValue) {
-        checkWritePermission();
-        this.name = newValue;
+    @XmlElement(name = "valueType")
+    final TypeName getValueType() {
+        return (LEGACY_XML && name != null) ? name.getAttributeType() : null;
     }
 
-    /**
-     * Returns whether the parameter is an input to the service, an output or both.
-     *
-     * @return Indication if the parameter is an input to the service, an output or both, or {@code null} if none.
-     */
     @Override
-    @XmlElement(name = "direction")
     public ParameterDirection getDirection() {
         return direction;
     }
 
-    /**
-     * Sets whether the parameter is an input to the service, an output or both.
-     *
-     * @param newValue Whether the parameter is an input to the service, an output or both.
-     */
-    public void setDirection(final ParameterDirection newValue) {
-        checkWritePermission();
-        this.direction = newValue;
-    }
-
-    /**
-     * Returns a narrative explanation of the role of the parameter.
-     *
-     * @return A narrative explanation of the role of the parameter, or {@code null} if none.
-     */
     @Override
-    @XmlElement(name = "description")
     public InternationalString getDescription() {
         return description;
     }
 
     /**
-     * Sets the narrative explanation of the role of the parameter.
-     *
-     * @param newValue The new narrative explanation of the role of the parameter.
-     */
-    public void setDescription(final InternationalString newValue) {
-        checkWritePermission();
-        this.description = newValue;
-    }
-
-    /**
-     * Returns whether the parameter is required.
-     *
-     * @return Whether the parameter is required.
+     * Returns {@code true} if {@link #optionality} is "{@code true}" or "{@code Optional}",
+     * or {@code false} otherwise.
      */
-    @Override
-/// @XmlElement(name = "optionality", required = true)
-    public Boolean getOptionality() {
-        return optionality;
+    @XmlElement(name = "optionality", required = true)
+    final String getOptionality() {
+        return LEGACY_XML ? (optionality ? "Optional" : "Mandatory") : Boolean.toString(optionality);
     }
 
     /**
-     * Sets whether the parameter is required.
-     *
-     * @param newValue Whether the parameter is required.
+     * Sets whether this parameter is optional.
      */
-    public void setOptionality(final Boolean newValue) {
-        checkWritePermission();
-        this.optionality = newValue;
+    final void setOptionality(final String optional) {
+        if (optional != null) {
+            optionality = Boolean.parseBoolean(optional) || optional.equalsIgnoreCase("Optional");
+        }
     }
 
-    /**
-     * Returns whether more than one value of the parameter may be provided.
-     *
-     * @return Whether more than one value of the parameter may be provided.
-     */
     @Override
-    @XmlElement(name = "repeatability", required = true)
-    public Boolean getRepeatability() {
-        return repeatability;
+    public int getMinimumOccurs() {
+        return optionality ? 0 : 1;
     }
 
-    /**
-     * Sets whether more than one value of the parameter may be provided.
-     *
-     * @param newValue Whether more than one value of the parameter may be provided.
-     */
-    public void setRepeatability(final Boolean newValue) {
-        checkWritePermission();
-        this.repeatability = newValue;
-    }
-
-
-
-    // Bridges for elements from legacy ISO 19119
-
-    /**
-     * Returns the optionality as a "Optional" or "Mandatory" string.
-     */
-    @XmlElement(name = "optionality", required = true)
-    final String getOptionalityLabel() {
-        return (optionality == null) ? null : (optionality) ? "Optional" : "Mandatory";
+    @Override
+    public int getMaximumOccurs() {
+        return repeatability ? Integer.MAX_VALUE : 1;
     }
 
-    /**
-     * Sets optionality to {@code true} if the given string is equals, ignoring case, to {@code "Optional"}.
-     */
-    final void setOptionalityLabel(final String label) {
-        optionality = (label == null) ? null : label.equalsIgnoreCase("Optional");
-    }
+    @Override public Set<T>        getValidValues()  {return null;}
+    @Override public Comparable<T> getMinimumValue() {return null;}
+    @Override public Comparable<T> getMaximumValue() {return null;}
+    @Override public T             getDefaultValue() {return null;}
+    @Override public Unit<?>       getUnit()         {return null;}
 
-    /**
-     * For JAXB marhalling of ISO 19119 document only.
-     * Note that there is not setter method, since we expect the same information
-     * to be provided in the {@link #name} attribute type.
-     */
-    @XmlElement(name = "valueType")
-    final TypeName getValueType() {
-        return (LEGACY_XML && name != null) ? name.getAttributeType() : null;
+    @Override
+    public ParameterValue<T> createValue() {
+        throw new UnsupportedOperationException("Not supported yet."); // TODO
     }
 }

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/MetadataUtilities.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/MetadataUtilities.java?rev=1623886&r1=1623885&r2=1623886&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/MetadataUtilities.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/MetadataUtilities.java [UTF-8] Tue Sep  9 23:49:31 2014
@@ -89,6 +89,8 @@ public final class MetadataUtilities ext
             return true;
         }
         final boolean p = value;
+        // (value == Boolean.FALSE) is an optimization for a common case avoiding PrimitiveTypeProperties check.
+        // DO NOT REPLACE BY 'equals' OR 'booleanValue()' - the exact reference value matter.
         if (p || value == Boolean.FALSE || !(PrimitiveTypeProperties.property(value) instanceof NilReason)) {
             return p;
         }

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/DefaultOperationMetadata.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/DefaultOperationMetadata.java?rev=1623886&r1=1623885&r2=1623886&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/DefaultOperationMetadata.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/DefaultOperationMetadata.java [UTF-8] Tue Sep  9 23:49:31 2014
@@ -26,7 +26,7 @@ import org.apache.sis.metadata.iso.ISOMe
 import org.opengis.metadata.citation.OnlineResource;
 import org.opengis.metadata.service.DistributedComputingPlatform;
 import org.opengis.metadata.service.OperationMetadata;
-import org.opengis.metadata.service.Parameter;
+import org.opengis.parameter.ParameterDescriptor;
 
 
 /**
@@ -91,7 +91,7 @@ public class DefaultOperationMetadata ex
     /**
      * The parameters that are required for this interface.
      */
-    private Collection<Parameter> parameters;
+    private Collection<ParameterDescriptor<?>> parameters;
 
     /**
      * List of operation that must be completed immediately.
@@ -129,6 +129,7 @@ public class DefaultOperationMetadata ex
      *
      * @see #castOrCopy(OperationMetadata)
      */
+    @SuppressWarnings("unchecked")
     public DefaultOperationMetadata(final OperationMetadata object) {
         super(object);
         if (object != null) {
@@ -137,7 +138,7 @@ public class DefaultOperationMetadata ex
             this.operationDescription          = object.getOperationDescription();
             this.invocationName                = object.getInvocationName();
             this.connectPoints                 = copyCollection(object.getConnectPoints(), OnlineResource.class);
-            this.parameters                    = copySet(object.getParameters(), Parameter.class);
+            this.parameters                    = copySet(object.getParameters(), (Class) ParameterDescriptor.class);
             this.dependsOn                     = copyList(object.getDependsOn(), OperationMetadata.class);
         }
     }
@@ -277,9 +278,10 @@ public class DefaultOperationMetadata ex
      * @return The parameters that are required for this interface, or an empty collection if none.
      */
     @Override
+    @SuppressWarnings("unchecked")
     @XmlElement(name = "parameters")
-    public Collection<Parameter> getParameters() {
-        return parameters = nonNullCollection(parameters, Parameter.class);
+    public Collection<ParameterDescriptor<?>> getParameters() {
+        return parameters = nonNullCollection(parameters, (Class) ParameterDescriptor.class);
     }
 
     /**
@@ -287,8 +289,9 @@ public class DefaultOperationMetadata ex
      *
      * @param newValues The new set of parameters that are required for this interface.
      */
-    public void setParameters(final Collection<? extends Parameter> newValues) {
-        parameters = writeCollection(newValues, parameters, Parameter.class);
+    @SuppressWarnings("unchecked")
+    public void setParameters(final Collection<? extends ParameterDescriptor<?>> newValues) {
+        parameters = writeCollection(newValues, parameters, (Class) ParameterDescriptor.class);
     }
 
     /**

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/OperationName.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/OperationName.java?rev=1623886&r1=1623885&r2=1623886&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/OperationName.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/service/OperationName.java [UTF-8] Tue Sep  9 23:49:31 2014
@@ -26,7 +26,7 @@ import org.opengis.metadata.citation.Onl
 import org.opengis.metadata.service.CoupledResource;
 import org.opengis.metadata.service.DistributedComputingPlatform;
 import org.opengis.metadata.service.OperationMetadata;
-import org.opengis.metadata.service.Parameter;
+import org.opengis.parameter.ParameterDescriptor;
 import org.opengis.util.InternationalString;
 
 
@@ -65,7 +65,7 @@ final class OperationName implements Ope
     @Override public InternationalString                      getOperationDescription()          {return null;}
     @Override public Collection<DistributedComputingPlatform> getDistributedComputingPlatforms() {return Collections.emptySet();}
     @Override public Collection<OnlineResource>               getConnectPoints()                 {return Collections.emptySet();}
-    @Override public Collection<Parameter>                    getParameters()                    {return Collections.emptySet();}
+    @Override public Collection<ParameterDescriptor<?>>       getParameters()                    {return Collections.emptySet();}
     @Override public List<OperationMetadata>                  getDependsOn()                     {return Collections.emptyList();}
 
     /**

Copied: sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameterTest.java (from r1623833, sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/service/DefaultParameterTest.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameterTest.java?p2=sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameterTest.java&p1=sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/service/DefaultParameterTest.java&r1=1623833&r2=1623886&rev=1623886&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/service/DefaultParameterTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/metadata/replace/ServiceParameterTest.java [UTF-8] Tue Sep  9 23:49:31 2014
@@ -14,12 +14,12 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.sis.metadata.iso.service;
+package org.apache.sis.internal.jaxb.metadata.replace;
 
 import javax.xml.bind.JAXBException;
 import org.opengis.util.TypeName;
 import org.opengis.util.MemberName;
-import org.opengis.metadata.service.ParameterDirection;
+import org.opengis.parameter.ParameterDirection;
 import org.apache.sis.test.XMLTestCase;
 import org.apache.sis.xml.Namespaces;
 import org.junit.Test;
@@ -29,56 +29,68 @@ import static org.apache.sis.test.Assert
 
 
 /**
- * Tests {@link DefaultParameter}.
+ * Tests {@link ServiceParameter}.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.5
  * @version 0.5
  * @module
  */
-public final strictfp class DefaultParameterTest extends XMLTestCase {
+public final strictfp class ServiceParameterTest extends XMLTestCase {
     /**
      * Creates the parameter to use for testing purpose.
+     *
+     * @return The test parameter.
      */
-    static DefaultParameter create() {
+    public static ServiceParameter<?> create() {
         final TypeName   valueType = SIS_NAMES.createTypeName(null, "CharacterString");
         final MemberName paramName = SIS_NAMES.createMemberName(null, "Version", valueType);
-        final DefaultParameter param = new DefaultParameter(paramName, true, false);
+        final ServiceParameter<?> param = new ServiceParameter<>();
+        param.name          = paramName;
+        param.optionality   = true;
+        param.repeatability = false;
+        param.direction     = ParameterDirection.IN;
         assertSame("valueType", valueType, param.getValueType());
-        param.setDirection(ParameterDirection.IN);
         return param;
     }
 
     /**
-     * Tests {@link DefaultParameter#getOptionalityLabel()} and {@link DefaultParameter#setOptionalityLabel(String)}.
+     * Tests {@link ServiceParameter#getOptionality()} and {@link ServiceParameter#setOptionality(String)}.
      */
     @Test
     public void testOptionalityLabel() {
-        final DefaultParameter param = create();
-        assertEquals("Optional", param.getOptionalityLabel());
-
-        param.setOptionality(false);
-        assertEquals("Mandatory", param.getOptionalityLabel());
+        final ServiceParameter<?> param = create();
+        assertEquals("Optional", param.getOptionality());
 
-        param.setOptionality(null);
-        assertNull(param.getOptionalityLabel());
+        param.optionality = false;
+        assertEquals("Mandatory", param.getOptionality());
 
-        param.setOptionalityLabel("Optional");
-        assertTrue(param.getOptionality());
+        param.setOptionality("Optional");
+        assertTrue(param.optionality);
 
-        param.setOptionalityLabel("Mandatory");
-        assertFalse(param.getOptionality());
+        param.setOptionality("Mandatory");
+        assertFalse(param.optionality);
     }
 
     /**
-     * Tests marshalling of an empty parameter. The main purpose is to ensure that
-     * the XML does not contains spurious elements like empty enumeration wrapper.
+     * Tests marshalling of an almost empty parameter (except for default mandatory values).
+     * The main purpose is to ensure that the XML does not contains spurious elements like
+     * empty enumeration wrapper.
      *
      * @throws JAXBException if an error occurred during marshalling.
      */
     @Test
     public void testMarshalEmpty() throws JAXBException {
-        final String xml = marshal(new DefaultParameter());
-        assertXmlEquals("<srv:SV_Parameter xmlns:srv=\"" + Namespaces.SRV + "\"/>", xml, "xlmns:*");
+        final String xml = marshal(new ServiceParameter<>());
+        assertXmlEquals(
+                "<srv:SV_Parameter xmlns:srv=\"" + Namespaces.SRV + '"' +
+                                 " xmlns:gco=\"" + Namespaces.GCO + "\">\n" +
+                "  <srv:optionality>\n" +
+                "    <gco:CharacterString>Mandatory</gco:CharacterString>\n" +
+                "  </srv:optionality>\n" +
+                "  <srv:repeatability>\n" +
+                "    <gco:Boolean>false</gco:Boolean>\n" +
+                "  </srv:repeatability>\n" +
+                "</srv:SV_Parameter>\n", xml, "xlmns:*");
     }
 }

Modified: sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java?rev=1623886&r1=1623885&r2=1623886&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataTestCase.java [UTF-8] Tue Sep  9 23:49:31 2014
@@ -231,6 +231,8 @@ public abstract strictfp class MetadataT
              */
             final Class<?> propertyType = Numbers.primitiveToWrapper(accessor.type(i, TypeValuePolicy.PROPERTY_TYPE));
             final Class<?>  elementType = Numbers.primitiveToWrapper(accessor.type(i, TypeValuePolicy.ELEMENT_TYPE));
+            assertNotNull(testingMethod, propertyType);
+            assertNotNull(testingMethod, elementType);
             final boolean isCollection = Collection.class.isAssignableFrom(propertyType);
             assertFalse("Element type can not be Collection.", Collection.class.isAssignableFrom(elementType));
             assertEquals("Property and element types shall be the same if and only if not a collection.",

Modified: sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java?rev=1623886&r1=1623885&r2=1623886&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java [UTF-8] Tue Sep  9 23:49:31 2014
@@ -191,7 +191,6 @@ public final strictfp class AllMetadataT
             org.opengis.metadata.service.CoupledResource.class,
             org.opengis.metadata.service.OperationChainMetadata.class,
             org.opengis.metadata.service.OperationMetadata.class,
-            org.opengis.metadata.service.Parameter.class,
             org.opengis.metadata.service.ServiceIdentification.class,
             org.opengis.metadata.spatial.CellGeometry.class,
             org.opengis.metadata.spatial.Dimension.class,

Modified: sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/service/DefaultCoupledResourceTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/service/DefaultCoupledResourceTest.java?rev=1623886&r1=1623885&r2=1623886&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/service/DefaultCoupledResourceTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/service/DefaultCoupledResourceTest.java [UTF-8] Tue Sep  9 23:49:31 2014
@@ -18,8 +18,9 @@ package org.apache.sis.metadata.iso.serv
 
 import org.opengis.util.ScopedName;
 import org.opengis.metadata.citation.OnlineResource;
-import org.opengis.metadata.service.DistributedComputingPlatform;
 import org.opengis.metadata.service.OperationMetadata;
+import org.opengis.metadata.service.DistributedComputingPlatform;
+import org.apache.sis.internal.jaxb.metadata.replace.ServiceParameterTest;
 import org.apache.sis.xml.NilReason;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;
@@ -38,7 +39,7 @@ import static org.junit.Assert.*;
  * @version 0.5
  * @module
  */
-@DependsOn(DefaultParameterTest.class)
+@DependsOn(ServiceParameterTest.class)
 public final strictfp class DefaultCoupledResourceTest extends TestCase {
     /**
      * Creates the resource to use for testing purpose.
@@ -46,7 +47,7 @@ public final strictfp class DefaultCoupl
     static DefaultCoupledResource create() {
         final DefaultOperationMetadata operation = new DefaultOperationMetadata("Get Map",
                 DistributedComputingPlatform.WEB_SERVICES, null);
-        operation.setParameters(singleton(DefaultParameterTest.create()));
+        operation.setParameters(singleton(ServiceParameterTest.create()));
         operation.setConnectPoints(singleton(NilReason.MISSING.createNilObject(OnlineResource.class)));
 
         final DefaultCoupledResource resource = new DefaultCoupledResource();

Modified: sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/service/DefaultServiceIdentificationTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/service/DefaultServiceIdentificationTest.java?rev=1623886&r1=1623885&r2=1623886&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/service/DefaultServiceIdentificationTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/service/DefaultServiceIdentificationTest.java [UTF-8] Tue Sep  9 23:49:31 2014
@@ -38,7 +38,6 @@ import static org.apache.sis.internal.sy
  * @module
  */
 @DependsOn({
-    DefaultParameterTest.class,
     DefaultCoupledResourceTest.class,
     org.apache.sis.metadata.iso.identification.DefaultDataIdentificationTest.class
 })

Modified: sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java?rev=1623886&r1=1623885&r2=1623886&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java [UTF-8] Tue Sep  9 23:49:31 2014
@@ -72,7 +72,7 @@ import org.junit.BeforeClass;
     org.apache.sis.metadata.iso.identification.DefaultResolutionTest.class,
     org.apache.sis.metadata.iso.identification.DefaultBrowseGraphicTest.class,
     org.apache.sis.metadata.iso.identification.DefaultDataIdentificationTest.class,
-    org.apache.sis.metadata.iso.service.DefaultParameterTest.class,
+    org.apache.sis.internal.jaxb.metadata.replace.ServiceParameterTest.class,
     org.apache.sis.metadata.iso.service.DefaultCoupledResourceTest.class,
     org.apache.sis.metadata.iso.service.DefaultServiceIdentificationTest.class,
     org.apache.sis.metadata.iso.quality.AbstractElementTest.class,

Added: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/AbstractParameterDescriptor.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/AbstractParameterDescriptor.java?rev=1623886&view=auto
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/AbstractParameterDescriptor.java (added)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/AbstractParameterDescriptor.java [UTF-8] Tue Sep  9 23:49:31 2014
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.parameter;
+
+import java.util.Map;
+import org.opengis.util.InternationalString;
+import org.opengis.parameter.ParameterDirection;
+import org.opengis.parameter.GeneralParameterDescriptor;
+import org.apache.sis.referencing.AbstractIdentifiedObject;
+
+
+/**
+ * Base class of parameter descriptors.
+ *
+ * @author  Martin Desruisseaux (Geomatys)
+ * @since   0.5
+ * @version 0.5
+ * @module
+ */
+abstract class AbstractParameterDescriptor extends AbstractIdentifiedObject implements GeneralParameterDescriptor {
+
+    protected AbstractParameterDescriptor(final Map<String,?> properties) {
+        super(properties);
+    }
+
+    protected AbstractParameterDescriptor(final GeneralParameterDescriptor other) {
+        super(other);
+    }
+
+    @Override
+    public ParameterDirection getDirection() {
+        return ParameterDirection.IN;
+    }
+
+    @Override
+    public InternationalString getDescription() {
+        return null;
+    }
+
+    /**
+     * The minimum number of times that values for this parameter group or parameter are required.
+     * The default value is 1. A value of 0 means an optional parameter.
+     *
+     * @return The minimum occurrence.
+     */
+    @Override
+    public int getMinimumOccurs() {
+        return 1;
+    }
+
+    /**
+     * The maximum number of times that values for this parameter group or parameter can be included.
+     * The default value is 1. A value grater than 1 means a repeatable parameter.
+     *
+     * @return The maximum occurrence.
+     */
+    @Override
+    public int getMaximumOccurs() {
+        return 1;
+    }
+}

Propchange: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/AbstractParameterDescriptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/AbstractParameterDescriptor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java?rev=1623886&r1=1623885&r2=1623886&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java [UTF-8] Tue Sep  9 23:49:31 2014
@@ -68,13 +68,13 @@ import java.util.Objects;
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Johann Sorel (Geomatys)
  * @since   0.4 (derived from geotk-2.0)
- * @version 0.4
+ * @version 0.5
  * @module
  *
  * @see DefaultParameterValue
  * @see DefaultParameterDescriptorGroup
  */
-public class DefaultParameterDescriptor<T> extends AbstractIdentifiedObject implements ParameterDescriptor<T> {
+public class DefaultParameterDescriptor<T> extends AbstractParameterDescriptor implements ParameterDescriptor<T> {
     /**
      * Serial number for inter-operability with different versions.
      */

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java?rev=1623886&r1=1623885&r2=1623886&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java [UTF-8] Tue Sep  9 23:49:31 2014
@@ -89,13 +89,13 @@ import static org.apache.sis.util.Utilit
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Johann Sorel (Geomatys)
  * @since   0.4 (derived from geotk-2.0)
- * @version 0.4
+ * @version 0.5
  * @module
  *
  * @see DefaultParameterValueGroup
  * @see DefaultParameterDescriptor
  */
-public class DefaultParameterDescriptorGroup extends AbstractIdentifiedObject implements ParameterDescriptorGroup {
+public class DefaultParameterDescriptorGroup extends AbstractParameterDescriptor implements ParameterDescriptorGroup {
     /**
      * Serial number for inter-operability with different versions.
      */

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorValues.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorValues.java?rev=1623886&r1=1623885&r2=1623886&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorValues.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/TensorValues.java [UTF-8] Tue Sep  9 23:49:31 2014
@@ -31,7 +31,6 @@ import org.opengis.parameter.GeneralPara
 import org.opengis.parameter.GeneralParameterDescriptor;
 import org.opengis.parameter.ParameterNotFoundException;
 import org.apache.sis.referencing.IdentifiedObjects;
-import org.apache.sis.referencing.AbstractIdentifiedObject;
 import org.apache.sis.referencing.operation.matrix.Matrices;
 import org.apache.sis.internal.referencing.WKTUtilities;
 import org.apache.sis.internal.util.Numerics;
@@ -55,10 +54,10 @@ import org.apache.sis.util.Debug;
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.4 (derived from geotk-2.0)
- * @version 0.4
+ * @version 0.5
  * @module
  */
-final class TensorValues<E> extends AbstractIdentifiedObject
+final class TensorValues<E> extends AbstractParameterDescriptor
         implements ParameterDescriptorGroup, ParameterValueGroup, Cloneable
 {
     /**
@@ -171,22 +170,6 @@ final class TensorValues<E> extends Abst
     }
 
     /**
-     * Returns 1 since this group is considered mandatory.
-     */
-    @Override
-    public int getMinimumOccurs() {
-        return 1;
-    }
-
-    /**
-     * Returns 1 since we expect exactly one instance of this group.
-     */
-    @Override
-    public int getMaximumOccurs() {
-        return 1;
-    }
-
-    /**
      * Returns the current tensor dimensions.
      */
     private int[] dimensions() {

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/package-info.java?rev=1623886&r1=1623885&r2=1623886&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/package-info.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/parameter/package-info.java [UTF-8] Tue Sep  9 23:49:31 2014
@@ -20,8 +20,19 @@
  * An explanation for this package is provided in the {@linkplain org.opengis.parameter OpenGIS® javadoc}.
  * The remaining discussion on this page is specific to the SIS implementation.
  *
- * <p>Parameters are organized in <cite>groups</cite>. A group may be for example the set of all parameters needed
- * for the definition of a <cite>Mercator projection</cite>.
+ * <p>There is three categories of classes in this package:</p>
+ * <ul>
+ *   <li><b>Parameter descriptors</b> are immutable types that describes the parameters needed by an operation or a
+ *     process. Descriptors contain information like parameter name, optionality, repeatability and value type, but
+ *     do not contain the actual parameter value.</li>
+ *   <li><b>Parameter values</b> are (<var>descriptor</var>, <var>value</var>) tuples, together with convenience methods
+ *     for performing unit conversions and getting the values as instances of some commonly used types.</li>
+ *   <li>Builders, formatters and static methods aim to simplify the creation of {@code ParameterDescriptor}s,
+ *     the search for parameter values and visualizing them in a tabular format.</li>
+ * </ul>
+ *
+ * <p>Parameters are organized in <cite>groups</cite>.
+ * A group may be for example the set of all parameters needed for the definition of a <cite>Mercator projection</cite>.
  * Parameter groups have some similarities with {@code java.util.Map} where:</p>
  *
  * <ul>
@@ -73,7 +84,7 @@
  * if the given value is not assignable to the expected class or is not inside the value domain.
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
- * @since   0.4 (derived from geotk-2.0)
+ * @since   0.5 (derived from geotk-2.0)
  * @version 0.4
  * @module
  */

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParametersTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParametersTest.java?rev=1623886&r1=1623885&r2=1623886&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParametersTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/parameter/ParametersTest.java [UTF-8] Tue Sep  9 23:49:31 2014
@@ -20,6 +20,7 @@ import java.util.Collection;
 import java.util.Set;
 import javax.measure.unit.SI;
 import org.opengis.parameter.ParameterDescriptor;
+import org.opengis.parameter.ParameterDirection;
 import org.opengis.parameter.ParameterValue;
 import org.opengis.referencing.ReferenceIdentifier;
 import org.opengis.util.GenericName;
@@ -40,7 +41,7 @@ import static org.junit.Assert.*;
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.4
+ * @version 0.5
  * @module
  */
 @DependsOn({
@@ -113,6 +114,8 @@ public final strictfp class ParametersTe
             @Override public Collection<GenericName>  getAlias()         {return descriptor.getAlias();}
             @Override public Set<ReferenceIdentifier> getIdentifiers()   {return descriptor.getIdentifiers();}
             @Override public InternationalString      getRemarks()       {return descriptor.getRemarks();}
+            @Override public InternationalString      getDescription()   {return descriptor.getDescription();}
+            @Override public ParameterDirection       getDirection()     {return descriptor.getDirection();}
             @Override public int                      getMinimumOccurs() {return descriptor.getMinimumOccurs();}
             @Override public int                      getMaximumOccurs() {return descriptor.getMaximumOccurs();}
             @Override public Class<T>                 getValueClass()    {return descriptor.getValueClass();}

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifiedObject.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifiedObject.java?rev=1623886&r1=1623885&r2=1623886&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifiedObject.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifiedObject.java [UTF-8] Tue Sep  9 23:49:31 2014
@@ -41,7 +41,7 @@ import java.util.Objects;
  *
  * @author  Guilhem Legal (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
- * @since   0.3 (derived from geotk-3.00)
+ * @since   0.5 (derived from geotk-3.00)
  * @version 0.3
  * @module
  */
@@ -49,12 +49,12 @@ public class SimpleIdentifiedObject impl
     /**
      * For cross-version compatibility.
      */
-    private static final long serialVersionUID = 4773397959809985024L;
+    private static final long serialVersionUID = 5297493321524903545L;
 
     /**
      * The primary name by which this object is identified.
      */
-    protected ReferenceIdentifier referenceSystemIdentifier;
+    protected ReferenceIdentifier name;
 
     /**
      * Creates an identified object without identifier.
@@ -69,7 +69,7 @@ public class SimpleIdentifiedObject impl
      * @param object The identified object to partially copy.
      */
     public SimpleIdentifiedObject(final IdentifiedObject object) {
-        referenceSystemIdentifier = object.getName();
+        name = object.getName();
     }
 
     /**
@@ -78,7 +78,7 @@ public class SimpleIdentifiedObject impl
      * @param name The primary name by which this object is identified.
      */
     public SimpleIdentifiedObject(final ReferenceIdentifier name) {
-        referenceSystemIdentifier = name;
+        this.name = name;
     }
 
     /**
@@ -88,7 +88,7 @@ public class SimpleIdentifiedObject impl
      */
     @Override
     public ReferenceIdentifier getName() {
-        return referenceSystemIdentifier;
+        return name;
     }
 
     /**
@@ -150,9 +150,9 @@ public class SimpleIdentifiedObject impl
     @Override
     public final int hashCode() {
         int code = (int) serialVersionUID;
-        final ReferenceIdentifier id = referenceSystemIdentifier;
-        if (id != null) {
-            code ^= id.hashCode();
+        final ReferenceIdentifier name = this.name;
+        if (name != null) {
+            code ^= name.hashCode();
         }
         return code;
     }
@@ -183,12 +183,12 @@ public class SimpleIdentifiedObject impl
         if (mode == ComparisonMode.STRICT) {
             if (object != null && object.getClass() == getClass()) {
                 final SimpleIdentifiedObject that = (SimpleIdentifiedObject) object;
-                return Objects.equals(referenceSystemIdentifier, that.referenceSystemIdentifier);
+                return Objects.equals(name, that.name);
             }
         } else {
             if (object instanceof IdentifiedObject) {
                 final IdentifiedObject that = (IdentifiedObject) object;
-                return Utilities.deepEquals(referenceSystemIdentifier, that.getName(), mode);
+                return Utilities.deepEquals(name, that.getName(), mode);
             }
         }
         return false;
@@ -212,11 +212,11 @@ public class SimpleIdentifiedObject impl
     public String toString() {
         final String code, codespace;
         final Citation authority;
-        final ReferenceIdentifier id = referenceSystemIdentifier;
-        if (id != null) {
-            code      = id.getCode();
-            codespace = id.getCodeSpace();
-            authority = id.getAuthority();
+        final ReferenceIdentifier name = this.name;
+        if (name != null) {
+            code      = name.getCode();
+            codespace = name.getCodeSpace();
+            authority = name.getAuthority();
         } else {
             code      = null;
             codespace = null;

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java?rev=1623886&r1=1623885&r2=1623886&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java [UTF-8] Tue Sep  9 23:49:31 2014
@@ -211,6 +211,11 @@ public final class Classes extends Stati
                  * At this point we are not going to continue the loop anymore.
                  * Check if we have an array, then check the (component) class.
                  */
+                if (type instanceof ParameterizedType) {
+                    // Example: replace ParameterDescriptor<?> by ParameterDescriptor
+                    // before we test for instance of Class.
+                    type = ((ParameterizedType) type).getRawType();
+                }
                 int dimension = 0;
                 while (type instanceof GenericArrayType) {
                     type = ((GenericArrayType) type).getGenericComponentType();

Modified: sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/util/iso/TypesTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/util/iso/TypesTest.java?rev=1623886&r1=1623885&r2=1623886&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/util/iso/TypesTest.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/test/java/org/apache/sis/util/iso/TypesTest.java [UTF-8] Tue Sep  9 23:49:31 2014
@@ -26,7 +26,7 @@ import org.opengis.metadata.citation.Add
 import org.opengis.metadata.citation.Citation;
 import org.opengis.metadata.citation.OnLineFunction;
 import org.opengis.metadata.content.ImagingCondition;
-import org.opengis.metadata.service.ParameterDirection;
+import org.opengis.parameter.ParameterDirection;
 import org.opengis.referencing.datum.Datum;
 import org.opengis.referencing.cs.AxisDirection;
 import org.apache.sis.test.TestCase;



Mime
View raw message