Author: desruisseaux
Date: Fri Mar 7 16:25:39 2014
New Revision: 1575312
URL: http://svn.apache.org/r1575312
Log:
Initial port of DefaultParameterDescriptorGroup together with a few tests.
Added:
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java
(with props)
sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorGroupTest.java
(with props)
sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueGroupTest.java
(with props)
sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/MultiOccurrenceDescriptor.java
(with props)
Modified:
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValueGroup.java
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterValueList.java
sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
Modified:
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java?rev=1575312&r1=1575311&r2=1575312&view=diff
==============================================================================
---
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java
[UTF-8] (original)
+++
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java
[UTF-8] Fri Mar 7 16:25:39 2014
@@ -43,7 +43,7 @@ import java.util.Objects;
/**
- * The definition of a parameter used by an operation method.
+ * The definition of a single parameter used by an operation method.
* For {@linkplain org.apache.sis.referencing.crs.AbstractCRS Coordinate
Reference Systems}
* most parameter values are numeric, but other types of parameter values are
possible.
*
@@ -502,7 +502,7 @@ public class DefaultParameterDescriptor<
}
/**
- * {@inheritDoc}
+ * Invoked by {@link #hashCode()} for computing the hash code when first
needed.
*
* @return {@inheritDoc}
*/
Added:
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java?rev=1575312&view=auto
==============================================================================
---
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java
(added)
+++
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java
[UTF-8] Fri Mar 7 16:25:39 2014
@@ -0,0 +1,321 @@
+/*
+ * 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 java.util.Set;
+import java.util.List;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Collections;
+import org.opengis.parameter.ParameterValueGroup;
+import org.opengis.parameter.ParameterDescriptorGroup;
+import org.opengis.parameter.GeneralParameterDescriptor;
+import org.opengis.parameter.ParameterNotFoundException;
+import org.opengis.parameter.InvalidParameterNameException;
+import org.apache.sis.referencing.AbstractIdentifiedObject;
+import org.apache.sis.referencing.IdentifiedObjects;
+import org.apache.sis.internal.util.UnmodifiableArrayList;
+import org.apache.sis.util.resources.Errors;
+import org.apache.sis.util.ArgumentChecks;
+import org.apache.sis.util.ComparisonMode;
+
+import static org.apache.sis.util.Utilities.deepEquals;
+
+
+/**
+ * The definition of a group of related parameters used by an operation method.
+ *
+ * @author Martin Desruisseaux (IRD, Geomatys)
+ * @author Johann Sorel (Geomatys)
+ * @since 0.4 (derived from geotk-2.0)
+ * @version 0.4
+ * @module
+ *
+ * @see DefaultParameterValueGroup
+ * @see DefaultParameterDescriptor
+ */
+public class DefaultParameterDescriptorGroup extends AbstractIdentifiedObject
implements ParameterDescriptorGroup {
+ /**
+ * Serial number for inter-operability with different versions.
+ */
+ private static final long serialVersionUID = -4613190550542423839L;
+
+ /**
+ * The minimum number of times that values for this parameter group are
required.
+ */
+ private final int minimumOccurs;
+
+ /**
+ * The maximum number of times that values for this parameter group are
required.
+ */
+ private final int maximumOccurs;
+
+ /**
+ * The {@linkplain #descriptors() parameter descriptors} for this group.
+ */
+ private final GeneralParameterDescriptor[] parameters;
+
+ /**
+ * A view of {@link #parameters} as an immutable list.
+ * Will be constructed only when first needed.
+ */
+ private transient List<GeneralParameterDescriptor> asList;
+
+ /**
+ * Constructs a parameter group from a set of properties. The properties
map is given unchanged to the
+ * {@linkplain AbstractIdentifiedObject#AbstractIdentifiedObject(Map)
super-class constructor}.
+ * The following table is a reminder of main (not all) properties:
+ *
+ * <table class="sis">
+ * <tr>
+ * <th>Property name</th>
+ * <th>Value type</th>
+ * <th>Returned by</th>
+ * </tr>
+ * <tr>
+ * <td>{@value org.opengis.referencing.IdentifiedObject#NAME_KEY}</td>
+ * <td>{@link org.opengis.referencing.ReferenceIdentifier} or {@link
String}</td>
+ * <td>{@link #getName()}</td>
+ * </tr>
+ * <tr>
+ * <td>{@value org.opengis.referencing.IdentifiedObject#ALIAS_KEY}</td>
+ * <td>{@link org.opengis.util.GenericName} or {@link CharSequence}
(optionally as array)</td>
+ * <td>{@link #getAlias()}</td>
+ * </tr>
+ * <tr>
+ * <td>{@value
org.opengis.referencing.IdentifiedObject#IDENTIFIERS_KEY}</td>
+ * <td>{@link org.opengis.referencing.ReferenceIdentifier} (optionally
as array)</td>
+ * <td>{@link #getIdentifiers()}</td>
+ * </tr>
+ * <tr>
+ * <td>{@value
org.opengis.referencing.IdentifiedObject#REMARKS_KEY}</td>
+ * <td>{@link org.opengis.util.InternationalString} or {@link
String}</td>
+ * <td>{@link #getRemarks()}</td>
+ * </tr>
+ * </table>
+ *
+ * @param properties The properties to be given to the identified
object.
+ * @param minimumOccurs The {@linkplain #getMinimumOccurs() minimum number
of times}
+ * that values for this parameter group are required.
+ * @param maximumOccurs The {@linkplain #getMaximumOccurs() maximum number
of times}
+ * that values for this parameter group are required.
+ * @param parameters The {@linkplain #descriptors() parameter
descriptors} for this group.
+ */
+ public DefaultParameterDescriptorGroup(final Map<String,?> properties,
+ final int minimumOccurs, final int maximumOccurs,
GeneralParameterDescriptor... parameters)
+ {
+ super(properties);
+ this.minimumOccurs = minimumOccurs;
+ this.maximumOccurs = maximumOccurs;
+ if (minimumOccurs < 0 || minimumOccurs > maximumOccurs) {
+ throw new
IllegalArgumentException(Errors.getResources(properties).getString(
+ Errors.Keys.IllegalRange_2, minimumOccurs, maximumOccurs));
+ }
+ ArgumentChecks.ensureNonNull("parameters", parameters);
+ parameters = parameters.clone();
+ for (int i=0; i<parameters.length; i++) {
+ ArgumentChecks.ensureNonNullElement("parameters", i, parameters);
+ final String name = parameters[i].getName().getCode();
+ for (int j=0; j<i; j++) {
+ if (IdentifiedObjects.isHeuristicMatchForName(parameters[j],
name)) {
+ throw new
InvalidParameterNameException(Errors.getResources(properties).getString(
+ Errors.Keys.DuplicatedParameterName_4,
parameters[j].getName().getCode(), j, name, i),
+ name);
+ }
+ }
+ }
+ this.parameters = parameters;
+ }
+
+ /**
+ * Creates a new descriptor with the same values than the specified one.
+ * This copy constructor provides a way to convert an arbitrary
implementation into a SIS one or a
+ * user-defined one (as a subclass), usually in order to leverage some
implementation-specific API.
+ *
+ * <p>This constructor performs a shallow copy, i.e. the properties are
not cloned.</p>
+ *
+ * @param descriptor The descriptor to shallow copy.
+ */
+ protected DefaultParameterDescriptorGroup(final ParameterDescriptorGroup
descriptor) {
+ super(descriptor);
+ minimumOccurs = descriptor.getMinimumOccurs();
+ maximumOccurs = descriptor.getMaximumOccurs();
+ final List<GeneralParameterDescriptor> c = descriptor.descriptors();
+ parameters = c.toArray(new GeneralParameterDescriptor[c.size()]);
+ }
+
+ /**
+ * 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.}
+ *
+ * @return {@code ParameterDescriptorGroup.class} or a user-defined
sub-interface.
+ */
+ @Override
+ public Class<? extends ParameterDescriptorGroup> getInterface() {
+ return ParameterDescriptorGroup.class;
+ }
+
+ /**
+ * The minimum number of times that values for this parameter group or
parameter are required.
+ * A value of 0 means an optional parameter.
+ *
+ * @return The minimum occurrence.
+ */
+ @Override
+ public int getMinimumOccurs() {
+ return minimumOccurs;
+ }
+
+ /**
+ * The maximum number of times that values for this parameter group are
required.
+ *
+ * @return The maximum occurrence.
+ */
+ @Override
+ public int getMaximumOccurs() {
+ return maximumOccurs;
+ }
+
+ /**
+ * Creates a new instance of {@linkplain DefaultParameterValueGroup
parameter value group}
+ * initialized with the {@linkplain
DefaultParameterDescriptor#getDefaultValue default values}.
+ * The {@linkplain DefaultParameterValueGroup#getDescriptor() parameter
descriptor} for the
+ * created group will be {@code this} object.
+ *
+ * @return A new parameter instance initialized to the default value.
+ */
+ @Override
+ public ParameterValueGroup createValue() {
+ return new DefaultParameterValueGroup(this);
+ }
+
+ /**
+ * A view of {@link #parameters} as an unmodifiable list. This class
overrides {@link #contains(Object)}
+ * with a faster implementation based on {@link HashSet}. This
optimizations is helpful for map projection
+ * implementations, which test often for a parameter validity.
+ */
+ private static final class AsList extends
UnmodifiableArrayList<GeneralParameterDescriptor> {
+ /** For compatibility with different versions. */
+ private static final long serialVersionUID = -2116304004367396735L;
+
+ /** The element as a set. */
+ private final Set<GeneralParameterDescriptor> asSet;
+
+ /** Constructs a list for the specified array. */
+ public AsList(final GeneralParameterDescriptor[] array) {
+ super(array);
+ asSet = new HashSet<>(this);
+ }
+
+ /** Tests for the inclusion of the specified descriptor. */
+ @Override public boolean contains(final Object object) {
+ return asSet.contains(object);
+ }
+ }
+
+ /**
+ * Returns all parameters in this group.
+ *
+ * @return The parameter descriptors in this group.
+ */
+ @Override
+ public List<GeneralParameterDescriptor> descriptors() {
+ if (asList == null) {
+ switch (parameters.length) {
+ case 0: asList = Collections.emptyList();
break;
+ case 1: asList = Collections.singletonList(parameters[0]);
break;
+ case 2: // fall through
+ case 3: asList = UnmodifiableArrayList.wrap(parameters);
break;
+ default: asList = new AsList(parameters);
break;
+ }
+ }
+ return asList;
+ }
+
+ /**
+ * Returns the first parameter in this group for the specified name.
+ * This method does not search in sub-groups.
+ *
+ * @param name The name of the parameter to search for.
+ * @return The parameter for the given identifier name.
+ * @throws ParameterNotFoundException if there is no parameter for the
given name.
+ */
+ @Override
+ @SuppressWarnings("null")
+ public GeneralParameterDescriptor descriptor(final String name) throws
ParameterNotFoundException {
+ ArgumentChecks.ensureNonNull("name", name);
+ GeneralParameterDescriptor fallback = null, ambiguity = null;
+ for (final GeneralParameterDescriptor param : parameters) {
+ if (IdentifiedObjects.isHeuristicMatchForName(param, name)) {
+ if (name.equals(param.getName().getCode())) {
+ return param;
+ } else if (fallback == null) {
+ fallback = param;
+ } else {
+ ambiguity = param;
+ }
+ }
+ }
+ throw new ParameterNotFoundException(ambiguity != null
+ ? Errors.format(Errors.Keys.AmbiguousName_3,
fallback.getName(), ambiguity.getName(), name)
+ : Errors.format(Errors.Keys.ParameterNotFound_2, getName(),
name), name);
+ }
+
+ /**
+ * Compares the specified object with this parameter group for equality.
+ *
+ * @return {@inheritDoc}
+ */
+ @Override
+ public boolean equals(final Object object, final ComparisonMode mode) {
+ if (object == this) { // Optimization for a common case.
+ return true;
+ }
+ if (super.equals(object, mode)) {
+ switch (mode) {
+ case STRICT: {
+ final DefaultParameterDescriptorGroup that =
(DefaultParameterDescriptorGroup) object;
+ return minimumOccurs == that.minimumOccurs &&
+ maximumOccurs == that.maximumOccurs &&
+ Arrays.equals(parameters, that.parameters);
+ }
+ default: {
+ final ParameterDescriptorGroup that =
(ParameterDescriptorGroup) object;
+ return getMinimumOccurs() == that.getMinimumOccurs() &&
+ getMaximumOccurs() == that.getMaximumOccurs() &&
+ deepEquals(descriptors(), that.descriptors(), mode);
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Invoked by {@link #hashCode()} for computing the hash code when first
needed.
+ *
+ * @return {@inheritDoc}
+ */
+ @Override
+ protected long computeHashCode() {
+ return Arrays.hashCode(parameters) + super.computeHashCode();
+ }
+}
Propchange:
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java
------------------------------------------------------------------------------
svn:mime-type = text/plain;charset=UTF-8
Modified:
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java?rev=1575312&r1=1575311&r2=1575312&view=diff
==============================================================================
---
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java
[UTF-8] (original)
+++
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValue.java
[UTF-8] Fri Mar 7 16:25:39 2014
@@ -46,37 +46,43 @@ import java.nio.file.Path;
/**
- * A 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. The type and constraints on parameter
values are given by
- * the {@linkplain #getDescriptor() descriptor}.
+ * 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.
*
- * <p>The following table summarizes the ISO 19111 attributes with the
corresponding getter and
- * setter methods:</p>
+ * <p>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>
*
* <table class="sis">
- * <tr><th>ISO attribute</th> <th>Java type</th>
<th>Getter method</th> <th>Setter method</th></tr>
- * <tr><td></td> <td>{@link Object}</td>
<td>{@link #getValue()}</td> <td>{@link #setValue(Object)}</td></tr>
- * <tr><td>{@code stringValue}</td> <td>{@link String}</td>
<td>{@link #stringValue()}</td> <td>{@code setValue(Object)}</td></tr>
- * <tr><td>{@code value}</td> <td>{@code double}</td>
<td>{@link #doubleValue()}</td> <td>{@link #setValue(double)}</td></tr>
- * <tr><td></td> <td>{@code double}</td>
<td>{@link #doubleValue(Unit)}</td> <td>{@link #setValue(double,
Unit)}</td></tr>
- * <tr><td>{@code valueList}</td> <td>{@code double[]}</td>
<td>{@link #doubleValueList()}</td> <td>{@code setValue(Object)}</td></tr>
- * <tr><td></td> <td>{@code double[]}</td>
<td>{@link #doubleValueList(Unit)}</td> <td>{@link #setValue(double[],
Unit)}</td></tr>
- * <tr><td>{@code integerValue}</td> <td>{@code int}</td>
<td>{@link #intValue()}</td> <td>{@link #setValue(int)}</td></tr>
- * <tr><td>{@code integerValueList}</td> <td>{@code int[]}</td>
<td>{@link #intValueList()}</td> <td>{@code setValue(Object)}</td></tr>
- * <tr><td>{@code booleanValue}</td> <td>{@code boolean}</td>
<td>{@link #booleanValue()}</td> <td>{@link #setValue(boolean)}</td></tr>
- * <tr><td>{@code valueFile}</td> <td>{@link URI}</td>
<td>{@link #valueFile()}</td> <td>{@code setValue(Object)}</td></tr>
- * <tr><td>{@code valueFileCitation}</td> <td>{@link Citation}</td>
<td>{@code getValue()}</td> <td>{@code setValue(Object)}</td></tr>
+ * <tr><th>ISO attribute</th> <th>Java type</th> <th>Getter
method</th> <th>Setter method</th></tr>
+ * <tr><td></td> <td>{@link Object}</td> <td>{@link
#getValue()}</td> <td>{@link #setValue(Object)}</td></tr>
+ * <tr><td>stringValue</td> <td>{@link String}</td> <td>{@link
#stringValue()}</td> <td>{@link #setValue(Object)}</td></tr>
+ * <tr><td>value</td> <td>{@code double}</td> <td>{@link
#doubleValue()}</td> <td>{@link #setValue(double)}</td></tr>
+ * <tr><td></td> <td>{@code double}</td> <td>{@link
#doubleValue(Unit)}</td> <td>{@link #setValue(double, Unit)}</td></tr>
+ * <tr><td>valueList</td> <td>{@code double[]}</td> <td>{@link
#doubleValueList()}</td> <td>{@link #setValue(Object)}</td></tr>
+ * <tr><td></td> <td>{@code double[]}</td> <td>{@link
#doubleValueList(Unit)}</td> <td>{@link #setValue(double[], Unit)}</td></tr>
+ * <tr><td>integerValue</td> <td>{@code int}</td> <td>{@link
#intValue()}</td> <td>{@link #setValue(int)}</td></tr>
+ * <tr><td>integerValueList</td> <td>{@code int[]}</td> <td>{@link
#intValueList()}</td> <td>{@link #setValue(Object)}</td></tr>
+ * <tr><td>booleanValue</td> <td>{@code boolean}</td> <td>{@link
#booleanValue()}</td> <td>{@link #setValue(boolean)}</td></tr>
+ * <tr><td>valueFile</td> <td>{@link URI}</td> <td>{@link
#valueFile()}</td> <td>{@link #setValue(Object)}</td></tr>
+ * <tr><td>valueFileCitation</td> <td>{@link Citation}</td> <td>{@link
#getValue()}</td> <td>{@link #setValue(Object)}</td></tr>
* </table>
*
- * Instances of {@code ParameterValue} are created by the {@link
ParameterDescriptor#createValue()} method.
- * The parameter type can be fetch with the following idiom:
+ * The type and constraints on parameter values are given by the {@linkplain
#getDescriptor() descriptor},
+ * which is specified at construction time. The parameter type can be fetch
with the following idiom:
*
* {@preformat java
* Class<T> valueClass = parameter.getDescriptor().getValueClass();
* }
*
+ * {@section Instantiation}
+ * A {@linkplain DefaultParameterDescriptor parameter descriptor} must be
defined before parameter value can be created.
+ * Descriptors are usually pre-defined by map projection or process providers.
Given a descriptor, a parameter value can
+ * be created by a call to the {@link
#DefaultParameterValue(ParameterDescriptor)} constructor or by a call to the
+ * {@link ParameterDescriptor#createValue()} method. The later is recommended
since it allows descriptors to return
+ * specialized implementations.
+ *
* {@section Implementation note for subclasses}
* All read and write operations (except constructors, {@link #equals(Object)}
and {@link #hashCode()})
* ultimately delegates to the following methods:
Modified:
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValueGroup.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValueGroup.java?rev=1575312&r1=1575311&r2=1575312&view=diff
==============================================================================
---
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValueGroup.java
[UTF-8] (original)
+++
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterValueGroup.java
[UTF-8] Fri Mar 7 16:25:39 2014
@@ -39,6 +39,17 @@ import java.util.Objects;
/**
* A group of related parameter values.
*
+ * <p>This class defines the following convenience methods:</p>
+ * <ul>
+ * <li>{@link #parameter(String)} searches for a single parameter value of
the given name.</li>
+ * <li>{@link #groups(String)} searches for all groups of the given
name.</li>
+ * <li>{@link #addGroup(String)} for creating a new subgroup and adding it
to the list of subgroups.</li>
+ * </ul>
+ *
+ * <div class="note"><b>API note:</b> there is no
<code>parameter<b><u>s</u></b>(String)</code> method
+ * returning a list of parameter values because the ISO 19111 standard fixes
the {@code ParameterValue}
+ * {@linkplain DefaultParameterDescriptor#getMaximumOccurs() maximum
occurrence} to 1.</div>
+ *
* @author Martin Desruisseaux (IRD, Geomatys)
* @since 0.4 (derived from geotk-2.0)
* @version 0.4
@@ -129,29 +140,41 @@ public class DefaultParameterValueGroup
public ParameterValue<?> parameter(final String name) throws
ParameterNotFoundException {
ArgumentChecks.ensureNonNull("name", name);
final List<GeneralParameterValue> values = content.values;
+ ParameterValue<?> fallback = null, ambiguity = null;
for (final GeneralParameterValue value : values) {
if (value instanceof ParameterValue<?>) {
- if (isHeuristicMatchForName(value.getDescriptor(), name)) {
- return (ParameterValue<?>) value;
+ final GeneralParameterDescriptor descriptor =
value.getDescriptor();
+ if (isHeuristicMatchForName(descriptor, name)) {
+ if (name.equals(descriptor.getName().toString())) {
+ return (ParameterValue<?>) value;
+ } else if (fallback == null) {
+ fallback = (ParameterValue<?>) value;
+ } else {
+ ambiguity = (ParameterValue<?>) value;
+ }
}
}
}
+ if (fallback != null) {
+ if (ambiguity == null) {
+ return fallback;
+ }
+ throw new
ParameterNotFoundException(Errors.format(Errors.Keys.AmbiguousName_3,
+ fallback.getDescriptor().getName(),
ambiguity.getDescriptor().getName(), name), name);
+ }
/*
* No existing parameter found. Check if an optional parameter exists.
* If such a descriptor is found, create it, add it to the list of
values
* and returns it.
*/
- for (final GeneralParameterDescriptor descriptor :
getDescriptor().descriptors()) {
- if (descriptor instanceof ParameterDescriptor<?>) {
- if (isHeuristicMatchForName(descriptor, name)) {
- final ParameterValue<?> value = ((ParameterDescriptor<?>)
descriptor).createValue();
- values.add(value);
- return value;
- }
- }
+ final GeneralParameterDescriptor descriptor =
content.descriptor.descriptor(name);
+ if (descriptor instanceof ParameterDescriptor<?>) {
+ final ParameterValue<?> value = ((ParameterDescriptor<?>)
descriptor).createValue();
+ values.add(value);
+ return value;
}
- throw new ParameterNotFoundException(Errors.format(
- Errors.Keys.ParameterNotFound_2, content.descriptor.getName(),
name), name);
+ throw new
ParameterNotFoundException(Errors.format(Errors.Keys.ParameterNotFound_2,
+ content.descriptor.getName(), name), name);
}
/**
@@ -218,19 +241,13 @@ public class DefaultParameterValueGroup
throw new ParameterNotFoundException(Errors.format(
Errors.Keys.ParameterNotFound_2, descriptor.getName(),
name), name);
}
- int count = 0;
- final List<GeneralParameterValue> values = content.values;
- for (final GeneralParameterValue value : values) {
- if (isHeuristicMatchForName(value.getDescriptor(), name)) {
- count++;
- }
- }
+ final int count = content.count(child.getName());
if (count >= child.getMaximumOccurs()) {
throw new InvalidParameterCardinalityException(Errors.format(
Errors.Keys.TooManyOccurrences_2, count, name), name);
}
final ParameterValueGroup value = ((ParameterDescriptorGroup)
child).createValue();
- values.add(value);
+ content.values.add(value);
return value;
}
Modified:
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterValueList.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterValueList.java?rev=1575312&r1=1575311&r2=1575312&view=diff
==============================================================================
---
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterValueList.java
[UTF-8] (original)
+++
sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterValueList.java
[UTF-8] Fri Mar 7 16:25:39 2014
@@ -49,6 +49,9 @@ final class ParameterValueList extends A
/**
* The descriptor for the list as a whole.
+ *
+ * <p>This descriptor will not be used in {@link #equals(Object)} and
{@link #hashCode()}
+ * implementations in order to stay consistent with the {@link List}
contract.</p>
*/
final ParameterDescriptorGroup descriptor;
@@ -116,12 +119,7 @@ final class ParameterValueList extends A
/*
* Before to add the parameter, check the cardinality.
*/
- int count = 0;
- for (final GeneralParameterValue value : values) {
- if (name.equals(value.getDescriptor().getName())) {
- count++;
- }
- }
+ final int count = count(name);
if (count >= type.getMaximumOccurs()) {
throw new InvalidParameterCardinalityException(Errors.format(
Errors.Keys.TooManyOccurrences_2, count, name),
name.getCode());
@@ -131,6 +129,22 @@ final class ParameterValueList extends A
}
/**
+ * Count the number of parameter having the given name.
+ *
+ * @param name The name to search.
+ * @return Number of parameter having the given name.
+ */
+ final int count(final ReferenceIdentifier name) {
+ int count = 0;
+ for (final GeneralParameterValue value : values) {
+ if (name.equals(value.getDescriptor().getName())) {
+ count++;
+ }
+ }
+ return count;
+ }
+
+ /**
* Removes the value at the specified index, provided that this removal is
allowed by the
* parameter cardinality.
*
Added:
sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorGroupTest.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorGroupTest.java?rev=1575312&view=auto
==============================================================================
---
sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorGroupTest.java
(added)
+++
sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorGroupTest.java
[UTF-8] Fri Mar 7 16:25:39 2014
@@ -0,0 +1,96 @@
+/*
+ * 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 java.util.HashMap;
+import java.util.Locale;
+import org.opengis.parameter.GeneralParameterDescriptor;
+import javax.measure.unit.SI;
+import javax.measure.unit.Unit;
+import org.opengis.parameter.ParameterDescriptor;
+import org.opengis.parameter.ParameterDescriptorGroup;
+import org.opengis.parameter.ParameterValueGroup;
+import org.apache.sis.measure.Range;
+import org.apache.sis.measure.NumberRange;
+import org.apache.sis.measure.MeasurementRange;
+import org.apache.sis.test.DependsOnMethod;
+import org.apache.sis.test.DependsOn;
+import org.apache.sis.test.TestCase;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+import static org.opengis.test.Validators.*;
+import static java.util.Collections.singletonMap;
+import static org.opengis.referencing.IdentifiedObject.NAME_KEY;
+
+
+/**
+ * Tests the {@link DefaultParameterDescriptorGroup} class.
+ *
+ * @author Martin Desruisseaux (IRD, Geomatys)
+ * @author Johann Sorel (Geomatys)
+ * @since 0.4 (derived from geotk-2.1)
+ * @version 0.4
+ * @module
+ */
+@DependsOn(DefaultParameterDescriptorTest.class)
+public final strictfp class DefaultParameterDescriptorGroupTest extends
TestCase {
+ /**
+ * Returns a group of 4 parameters of type {@link Integer} with default
value 10.
+ * The two first parameters are mandatory, while the two last parameters
are optional.
+ * The very last parameter has a maximum number of occurrence of 2, which
is illegal
+ * according ISO 19111 but nevertheless supported by Apache SIS.
+ */
+ static final DefaultParameterDescriptorGroup createGroupOfIntegers() {
+ final Integer DEFAULT = 10;
+ final Class<Integer> type = Integer.class;
+ return new DefaultParameterDescriptorGroup(name("The group"), 0, 1,
+ new DefaultParameterDescriptor<>(name("Mandatory 1"), type, null,
null, DEFAULT, true),
+ new DefaultParameterDescriptor<>(name("Mandatory 2"), type, null,
null, DEFAULT, true),
+ new DefaultParameterDescriptor<>(name( "Optional 3"), type, null,
null, DEFAULT, false),
+ new MultiOccurrenceDescriptor <>(name( "Optional 4"), type, null,
null, DEFAULT, false)
+ );
+ }
+
+ /**
+ * Returns a map with only one entry, which is {@code
"name"}=<var>name</var>.
+ */
+ static Map<String,String> name(final String name) {
+ return singletonMap(NAME_KEY, name);
+ }
+
+ /**
+ * Tests descriptor validation.
+ */
+ @Test
+ public void testValidate() {
+ for (final GeneralParameterDescriptor descriptor :
createGroupOfIntegers().descriptors()) {
+ AssertionError error = null;
+ try {
+ validate(descriptor);
+ } catch (AssertionError e) {
+ error = e;
+ }
+ if (descriptor instanceof MultiOccurrenceDescriptor) {
+ assertNotNull("Validation methods should have detected that
the descriptor is invalid.", error);
+ } else if (error != null) {
+ throw error;
+ }
+ }
+ }
+}
Propchange:
sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorGroupTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterDescriptorGroupTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain;charset=UTF-8
Added:
sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueGroupTest.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueGroupTest.java?rev=1575312&view=auto
==============================================================================
---
sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueGroupTest.java
(added)
+++
sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueGroupTest.java
[UTF-8] Fri Mar 7 16:25:39 2014
@@ -0,0 +1,109 @@
+/*
+ * 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 java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import org.opengis.parameter.GeneralParameterDescriptor;
+import javax.measure.unit.SI;
+import javax.measure.unit.Unit;
+import org.opengis.parameter.ParameterDescriptor;
+import org.opengis.parameter.ParameterDescriptorGroup;
+import org.opengis.parameter.ParameterValueGroup;
+import org.apache.sis.measure.Range;
+import org.apache.sis.measure.NumberRange;
+import org.apache.sis.measure.MeasurementRange;
+import org.apache.sis.test.DependsOnMethod;
+import org.apache.sis.test.DependsOn;
+import org.apache.sis.test.TestCase;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+import static org.opengis.test.Validators.*;
+import static
org.apache.sis.parameter.DefaultParameterDescriptorGroupTest.name;
+
+
+/**
+ * Tests the {@link DefaultParameterValueGroup} class.
+ *
+ * @author Martin Desruisseaux (IRD, Geomatys)
+ * @since 0.4 (derived from geotk-2.1)
+ * @version 0.4
+ * @module
+ */
+@DependsOn({
+ DefaultParameterDescriptorGroupTest.class,
+ DefaultParameterValueTest.class
+})
+public final strictfp class DefaultParameterValueGroupTest extends TestCase {
+ /**
+ * Creates values for all parameters defines by the given descriptor,
+ * and assigns to them an integer value in sequence with the given step.
+ */
+ private static DefaultParameterValue<?>[] createValues(
+ final List<GeneralParameterDescriptor> descriptors, final int step)
+ {
+ final DefaultParameterValue<?>[] parameters = new
DefaultParameterValue<?>[descriptors.size()];
+ for (int i=0; i<parameters.length;) {
+ parameters[i] = new
DefaultParameterValue<>((ParameterDescriptor<?>) descriptors.get(i));
+ parameters[i].setValue(++i * step);
+ }
+ return parameters;
+ }
+
+ /**
+ * Tests parameter validation.
+ */
+ @Test
+ public void testValidate() {
+ for (final DefaultParameterValue<?> param : createValues(
+
DefaultParameterDescriptorGroupTest.createGroupOfIntegers().descriptors(), 10))
+ {
+ AssertionError error = null;
+ try {
+ validate(param);
+ } catch (AssertionError e) {
+ error = e;
+ }
+ if (param.getDescriptor() instanceof MultiOccurrenceDescriptor) {
+ assertNotNull("Validation methods should have detected that
the descriptor is invalid.", error);
+ } else if (error != null) {
+ throw error;
+ }
+ }
+ }
+
+ /**
+ * Tests the {@link DefaultParameterValueGroup#addGroup(String)} method.
+ * Ensures the descriptor is found and the new value correctly inserted.
+ */
+ @Test
+ public void testAddGroup() {
+ final ParameterDescriptorGroup groupDesc = new
DefaultParameterDescriptorGroup(name("theGroup"), 1, 1,
+ new DefaultParameterDescriptorGroup(name("theSubGroup"), 0, 10)
+ );
+ validate(groupDesc);
+
+ final ParameterValueGroup groupValues = groupDesc.createValue();
+ assertEquals("Size before add.", 0, groupValues.values().size());
+ final ParameterValueGroup subGroupValues =
groupValues.addGroup("theSubGroup");
+ assertEquals("Size after add.", 1, groupValues.values().size());
+ assertSame(subGroupValues, groupValues.values().get(0));
+ }
+}
Propchange:
sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueGroupTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/DefaultParameterValueGroupTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain;charset=UTF-8
Added:
sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/MultiOccurrenceDescriptor.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/MultiOccurrenceDescriptor.java?rev=1575312&view=auto
==============================================================================
---
sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/MultiOccurrenceDescriptor.java
(added)
+++
sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/MultiOccurrenceDescriptor.java
[UTF-8] Fri Mar 7 16:25:39 2014
@@ -0,0 +1,52 @@
+/*
+ * 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.apache.sis.measure.Range;
+
+
+/**
+ * A descriptor with a maximum occurrence of 2.
+ * This is illegal according ISO 19111 but nevertheless supported by Apache
SIS.
+ *
+ * @author Martin Desruisseaux (Geomatys)
+ * @since 0.4 (derived from geotk-2.1)
+ * @version 0.4
+ * @module
+ */
+@SuppressWarnings("serial")
+final class MultiOccurrenceDescriptor<T> extends DefaultParameterDescriptor<T>
{
+ /**
+ * Creates a new descriptor with the given name and default value.
+ */
+ MultiOccurrenceDescriptor(final Map<String,?> properties, final Class<T>
valueClass,
+ final Range<?> valueDomain, final T[] validValues, final T
defaultValue, final boolean required)
+ {
+ super(properties, valueClass, valueDomain, validValues, defaultValue,
required);
+ }
+
+ /**
+ * We are cheating here: {@code maximumOccurs} should always be 1 for
{@code ParameterValue}.
+ * However, the SIS implementation should be robust enough to accept other
values.
+ * We use this class test that.
+ */
+ @Override
+ public int getMaximumOccurs() {
+ return 2;
+ }
+}
Propchange:
sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/MultiOccurrenceDescriptor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/parameter/MultiOccurrenceDescriptor.java
------------------------------------------------------------------------------
svn:mime-type = text/plain;charset=UTF-8
Modified:
sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java?rev=1575312&r1=1575311&r2=1575312&view=diff
==============================================================================
---
sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
[UTF-8] (original)
+++
sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
[UTF-8] Fri Mar 7 16:25:39 2014
@@ -52,7 +52,9 @@ import org.junit.BeforeClass;
org.apache.sis.referencing.AbstractReferenceSystemTest.class,
org.apache.sis.referencing.BuilderTest.class,
org.apache.sis.parameter.DefaultParameterDescriptorTest.class,
+ org.apache.sis.parameter.DefaultParameterDescriptorGroupTest.class,
org.apache.sis.parameter.DefaultParameterValueTest.class,
+ org.apache.sis.parameter.DefaultParameterValueGroupTest.class,
org.apache.sis.parameter.ParametersTest.class,
org.apache.sis.parameter.ParameterBuilderTest.class,
org.apache.sis.referencing.datum.BursaWolfParametersTest.class,
Modified:
sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java?rev=1575312&r1=1575311&r2=1575312&view=diff
==============================================================================
---
sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
[UTF-8] (original)
+++
sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
[UTF-8] Fri Mar 7 16:25:39 2014
@@ -64,6 +64,11 @@ public final class Errors extends Indexe
}
/**
+ * Name “{2}” is ambiguous because it can be understood as either
“{0}” or “{1}”.
+ */
+ public static final short AmbiguousName_3 = 151;
+
+ /**
* No element can be added to this set because properties ‘{0}’ and
‘{1}’ are mutually
* exclusive.
*/
@@ -165,6 +170,11 @@ public final class Errors extends Indexe
public static final short DuplicatedOption_1 = 18;
/**
+ * Name or alias for parameter “{0}” at index {1} conflict with name
“{2}” at index {3}.
+ */
+ public static final short DuplicatedParameterName_4 = 150;
+
+ /**
* Element “{0}” is already present.
*/
public static final short ElementAlreadyPresent_1 = 19;
Modified:
sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
URL:
http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties?rev=1575312&r1=1575311&r2=1575312&view=diff
==============================================================================
---
sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
[ISO-8859-1] (original)
+++
sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
[ISO-8859-1] Fri Mar 7 16:25:39 2014
@@ -24,6 +24,7 @@
# programmatic parameters do not have to be last in the formatted text, since
each localized message
# can reorder the parameters as they want.
#
+AmbiguousName_3 = Name \u201c{2}\u201d is ambiguous because
it can be understood as either \u201c{0}\u201d or \u201c{1}\u201d.
CanNotAddToExclusiveSet_2 = No element can be added to this set
because properties \u2018{0}\u2019 and \u2018{1}\u2019 are mutually exclusive.
CanNotConnectTo_1 = Can not connect to \u201c{0}\u201d.
CanNotConvertFromType_2 = Can not convert from type \u2018{0}\u2019
to type \u2018{1}\u2019.
@@ -44,6 +45,7 @@ DeadThread_1 = Thre
DuplicatedElement_1 = Element \u201c{0}\u201d is duplicated.
DuplicatedIdentifier_1 = Identifier \u201c{0}\u201d is duplicated.
DuplicatedOption_1 = Option \u201c{0}\u201d is duplicated.
+DuplicatedParameterName_4 = Name or alias for parameter
\u201c{0}\u201d at index {1} conflict with name \u201c{2}\u201d at index {3}.
ElementAlreadyPresent_1 = Element \u201c{0}\u201d is already present.
ElementNotFound_1 = Element \u201c{0}\u201d has not been found.
EmptyArgument_1 = Argument \u2018{0}\u2019 shall not be
empty.
Modified:
sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
URL:
http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties?rev=1575312&r1=1575311&r2=1575312&view=diff
==============================================================================
---
sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
[ISO-8859-1] (original)
+++
sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
[ISO-8859-1] Fri Mar 7 16:25:39 2014
@@ -14,6 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
+AmbiguousName_3 = Le nom \u00ab\u202f{2}\u202f\u00bb est
ambigu\u00eb car il peut \u00eatre interpr\u00e9t\u00e9 comme
\u00ab\u202f{0}\u202f\u00bb ou \u00ab\u202f{1}\u202f\u00bb.
CanNotAddToExclusiveSet_2 = Aucun \u00e9l\u00e9ment ne peut \u00eatre
ajout\u00e9 \u00e0 cet ensemble car les propri\u00e9t\u00e9s \u2018{0}\u2019 et
\u2018{1}\u2019 sont mutuellement exclusives.
CanNotConnectTo_1 = Ne peut pas se connecter \u00e0
\u00ab\u202f{0}\u202f\u00bb.
CanNotConvertFromType_2 = Ne peut pas convertir du type
\u2018{0}\u2019 vers le type \u2018{1}\u2019.
@@ -34,6 +35,7 @@ DeadThread_1 = La t
DuplicatedElement_1 = L\u2019\u00e9lement
\u00ab\u202f{0}\u202f\u00bb est dupliqu\u00e9.
DuplicatedIdentifier_1 = L\u2019identifiant
\u00ab\u202f{0}\u202f\u00bb est dupliqu\u00e9.
DuplicatedOption_1 = L\u2019option \u00ab\u202f{0}\u202f\u00bb
est dupliqu\u00e9e.
+DuplicatedParameterName_4 = Le nom ou un alias pour le param\u00e8tre
\u00ab\u202f{0}\u202f\u00bb \u00e0 l\u2019index {1} duplique le nom
\u00ab\u202f{2}\u202f\u00bb \u00e0 l\u2019index {3}.
ElementAlreadyPresent_1 = L\u2019\u00e9lement
\u00ab\u202f{0}\u202f\u00bb est d\u00e9j\u00e0 pr\u00e9sent.
ElementNotFound_1 = L\u2019\u00e9lement
\u00ab\u202f{0}\u202f\u00bb n\u2019a pas \u00e9t\u00e9 trouv\u00e9.
EmptyArgument_1 = L\u2019argument \u2018{0}\u2019 ne doit
pas \u00eatre vide.