sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1627546 [2/3] - in /sis/branches/JDK6: ./ core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/ core/sis-build-helper/src/main/javadoc/ core/sis-feature/src/test/java/org/apache/sis/feature/ core/sis-metadata/src/main/java/or...
Date Thu, 25 Sep 2014 13:59:58 GMT
Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java?rev=1627546&r1=1627545&r2=1627546&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/MetadataStandard.java [UTF-8] Thu Sep 25 13:59:56 2014
@@ -18,10 +18,11 @@ package org.apache.sis.metadata;
 
 import java.util.Set;
 import java.util.Map;
-import java.util.IdentityHashMap;
 import java.util.LinkedHashSet;
 import java.util.Collection;
 import java.util.Iterator;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.ConcurrentHashMap;
 import java.io.IOException;
 import java.io.Serializable;
 import java.io.ObjectInputStream;
@@ -40,6 +41,11 @@ import org.apache.sis.internal.system.Sy
 import org.apache.sis.internal.simple.SimpleCitation;
 
 import static org.apache.sis.util.ArgumentChecks.ensureNonNull;
+import static org.apache.sis.util.ArgumentChecks.ensureNonNullElement;
+
+// Branch-specific imports
+import org.apache.sis.internal.jdk8.JDK8;
+import org.apache.sis.internal.jdk8.BiFunction;
 
 
 /**
@@ -136,10 +142,10 @@ public class MetadataStandard implements
         final String[] acronyms = {"CoordinateSystem", "CS", "CoordinateReferenceSystem", "CRS"};
 
         // If new StandardImplementation instances are added below, please update StandardImplementation.readResolve().
-        ISO_19111 = new StandardImplementation("ISO 19111", "org.opengis.referencing.", "org.apache.sis.referencing.", acronyms);
-        ISO_19115 = new StandardImplementation("ISO 19115", "org.opengis.metadata.", "org.apache.sis.metadata.iso.", null);
-        ISO_19119 = new MetadataStandard      ("ISO 19119", "org.opengis.service.");
-        ISO_19123 = new MetadataStandard      ("ISO 19123", "org.opengis.coverage.");
+        ISO_19115 = new StandardImplementation("ISO 19115", "org.opengis.metadata.", "org.apache.sis.metadata.iso.", null, null);
+        ISO_19111 = new StandardImplementation("ISO 19111", "org.opengis.referencing.", "org.apache.sis.referencing.", acronyms, new MetadataStandard[] {ISO_19115});
+        ISO_19119 = new MetadataStandard      ("ISO 19119", "org.opengis.service.", ISO_19111.dependencies);
+        ISO_19123 = new MetadataStandard      ("ISO 19123", "org.opengis.coverage.", new MetadataStandard[] {ISO_19111});
         INSTANCES = new MetadataStandard[] {
             ISO_19111,
             ISO_19115,
@@ -161,37 +167,54 @@ public class MetadataStandard implements
     final Citation citation;
 
     /**
-     * The root packages for metadata interfaces. Must have a trailing {@code '.'}.
+     * The root package for metadata interfaces. Must have a trailing {@code '.'}.
      */
     final String interfacePackage;
 
     /**
+     * The dependencies, or {@code null} if none.
+     *
+     * Note: the {@code null} value is for serialization compatibility.
+     */
+    private final MetadataStandard[] dependencies;
+
+    /**
      * Accessors for the specified implementations.
      * The only legal value types are:
      *
      * <ul>
-     *   <li>{@link Class} if we have determined the standard interface for a given type
-     *       but did not yet created the {@link PropertyAccessor} for it.</li>
+     *   <li>{@link MetadataStandard} if type is handled by {@linkplain #dependencies} rather than this standard.</li>
+     *   <li>{@link Class} if we found the interface for the type but did not yet created the {@link PropertyAccessor}.</li>
      *   <li>{@link PropertyAccessor} otherwise.</li>
      * </ul>
      */
-    private final transient Map<Class<?>, Object> accessors; // written by reflection on deserialization.
+    private final transient ConcurrentMap<Class<?>, Object> accessors; // written by reflection on deserialization.
 
     /**
      * Creates a new instance working on implementation of interfaces defined in the specified package.
      *
-     * <p><b>Example:</b>: For the ISO 19115 standard reflected by GeoAPI interfaces,
-     * {@code interfacePackage} shall be the {@link org.opengis.metadata} package.</p>
+     * <div class="note"><b>Example:</b>: For the ISO 19115 standard reflected by GeoAPI interfaces,
+     * {@code interfacePackage} shall be the {@link org.opengis.metadata} package.</div>
      *
      * @param citation         Bibliographical reference to the international standard.
      * @param interfacePackage The root package for metadata interfaces.
+     * @param dependencies     The dependencies to other metadata standards.
      */
-    public MetadataStandard(final Citation citation, final Package interfacePackage) {
-        ensureNonNull("citation", citation);
+    public MetadataStandard(final Citation citation, final Package interfacePackage, MetadataStandard... dependencies) {
+        ensureNonNull("citation",         citation);
         ensureNonNull("interfacePackage", interfacePackage);
+        ensureNonNull("dependencies",     dependencies);
         this.citation         = citation;
         this.interfacePackage = interfacePackage.getName() + '.';
-        this.accessors        = new IdentityHashMap<Class<?>,Object>(); // Also defined in readObject(…)
+        this.accessors        = new ConcurrentHashMap<Class<?>,Object>(); // Also defined in readObject(…)
+        if (dependencies.length == 0) {
+            this.dependencies = null;
+        } else {
+            this.dependencies = dependencies = dependencies.clone();
+            for (int i=0; i<dependencies.length; i++) {
+                ensureNonNullElement("dependencies", i, dependencies[i]);
+            }
+        }
     }
 
     /**
@@ -200,11 +223,25 @@ public class MetadataStandard implements
      *
      * @param citation         Bibliographical reference to the international standard.
      * @param interfacePackage The root package for metadata interfaces.
+     * @param dependencies     The dependencies to other metadata standards, or {@code null} if none.
      */
-    MetadataStandard(final String citation, final String interfacePackage) {
+    MetadataStandard(final String citation, final String interfacePackage, final MetadataStandard[] dependencies) {
         this.citation         = new SimpleCitation(citation);
         this.interfacePackage = interfacePackage;
-        this.accessors        = new IdentityHashMap<Class<?>,Object>();
+        this.accessors        = new ConcurrentHashMap<Class<?>,Object>();
+        this.dependencies     = dependencies; // No clone, since this constructor is for internal use only.
+    }
+
+    /**
+     * Returns {@code true} if class or interface of the given name is supported by this standard.
+     * This method verifies if the class is a member of the package given at construction time or
+     * a sub-package. This method does not verify if the type is supported by a dependency.
+     *
+     * @param  classname The name of the type to verify.
+     * @return {@code true} if the given type is supported by this standard.
+     */
+    final boolean isSupported(final String classname) {
+        return classname.startsWith(interfacePackage);
     }
 
     /**
@@ -220,16 +257,16 @@ public class MetadataStandard implements
      * @return The metadata standard for the given type, or {@code null} if not found.
      */
     public static MetadataStandard forClass(final Class<?> type) {
-        String name = type.getName();
+        String classname = type.getName();
         for (final MetadataStandard candidate : INSTANCES) {
-            if (name.startsWith(candidate.interfacePackage)) {
+            if (candidate.isSupported(classname)) {
                 return candidate;
             }
         }
         for (final Class<?> interf : Classes.getAllInterfaces(type)) {
-            name = interf.getName();
+            classname = interf.getName();
             for (final MetadataStandard candidate : INSTANCES) {
-                if (name.startsWith(candidate.interfacePackage)) {
+                if (candidate.isSupported(classname)) {
                     return candidate;
                 }
             }
@@ -243,9 +280,7 @@ public class MetadataStandard implements
      */
     static void clearCache() {
         for (final MetadataStandard standard : INSTANCES) {
-            synchronized (standard.accessors) {
-                standard.accessors.clear();
-            }
+            standard.accessors.clear();
         }
     }
 
@@ -279,48 +314,77 @@ public class MetadataStandard implements
      *         of the expected package and {@code mandatory} is {@code true}.
      */
     final PropertyAccessor getAccessor(final Class<?> implementation, final boolean mandatory) {
-        synchronized (accessors) {
-            // Check for previously created accessors.
-            final Object value = accessors.get(implementation);
-            if (value instanceof PropertyAccessor) {
-                return (PropertyAccessor) value;
-            }
-            // Check if we started some computation that we can finish.
-            final Class<?> type;
-            if (value != null) {
-                type = (Class<?>) value;
-            } else {
-                // Nothing were computed. Try to compute now.
-                type = findInterface(implementation);
-                if (type == null) {
-                    if (mandatory) {
-                        throw new ClassCastException(Errors.format(Errors.Keys.UnknownType_1, implementation));
+        /*
+         * Check for accessors created by previous call to this method.
+         * Values are added to this cache but never cleared.
+         */
+        final Object value = accessors.get(implementation);
+        if (value instanceof PropertyAccessor) {
+            return (PropertyAccessor) value;
+        }
+        /*
+         * Check if we started some computation that we can finish. A partial computation exists
+         * when we already found the Class<?> for the interface, but didn't created the accessor.
+         */
+        final Class<?> type;
+        if (value instanceof Class<?>) {
+            type = (Class<?>) value; // Stored result of previous call to findInterface(…).
+            assert type == findInterface(implementation) : implementation;
+        } else {
+            /*
+             * Nothing was computed, we need to start from scratch. The first step is to find
+             * the interface implemented by the given class. If we can not find an interface,
+             * we will delegate to the dependencies and store the result for avoiding redoing
+             * this search next time.
+             */
+            type = findInterface(implementation);
+            if (type == null) {
+                if (dependencies != null) {
+                    for (final MetadataStandard dependency : dependencies) {
+                        final PropertyAccessor accessor = dependency.getAccessor(implementation, false);
+                        if (accessor != null) {
+                            accessors.put(implementation, accessor); // Ok to overwrite existing instance here.
+                            return accessor;
+                        }
                     }
-                    return null;
                 }
+                if (mandatory) {
+                    throw new ClassCastException(Errors.format(Errors.Keys.UnknownType_1, implementation));
+                }
+                return null;
             }
-            final PropertyAccessor accessor;
-            if (SpecialCases.isSpecialCase(type)) {
-                accessor = new SpecialCases(citation, type, implementation);
-            } else {
-                /*
-                 * If "multi-value returns" was allowed in the Java language, the 'onlyUML' boolean would
-                 * be returned by 'findInterface(Class)' method when it falls in the special case for the
-                 * UML annotation on implementation class. But since we do not have multi-values, we have
-                 * to infer it from our knownledge of how 'findInterface(Class)' is implemented.
-                 */
-                final boolean onlyUML = (type == implementation && !type.isInterface());
-                accessor = new PropertyAccessor(citation, type, implementation, onlyUML);
-            }
-            accessors.put(implementation, accessor);
-            return accessor;
         }
+        /*
+         * Found the interface for which to create an accessor. Creates the accessor now, unless an accessor
+         * has been created concurrently in another thread in which case the later will be returned.
+         */
+        return (PropertyAccessor) JDK8.compute(accessors, implementation, new BiFunction<Class<?>, Object, Object>() {
+            @Override public Object apply(final Class<?> k, final Object v) {
+                if (v instanceof PropertyAccessor) {
+                    return v;
+                }
+                final PropertyAccessor accessor;
+                if (SpecialCases.isSpecialCase(type)) {
+                    accessor = new SpecialCases(citation, type, implementation);
+                } else {
+                    /*
+                     * If "multi-value returns" was allowed in the Java language, the 'onlyUML' boolean would
+                     * be returned by 'findInterface(Class)' method when it falls in the special case for the
+                     * UML annotation on implementation class. But since we do not have multi-values, we have
+                     * to infer it from our knownledge of how 'findInterface(Class)' is implemented.
+                     */
+                    final boolean onlyUML = (type == implementation && !type.isInterface());
+                    accessor = new PropertyAccessor(citation, type, implementation, onlyUML);
+                }
+                return accessor;
+            }
+        });
     }
 
     /**
-     * Returns {@code true} if the given type is assignable to a type from this standard.
-     * If this method returns {@code true}, then invoking {@link #getInterface(Class)} is
-     * guaranteed to succeed without throwing an exception.
+     * Returns {@code true} if the given type is assignable to a type from this standard or one of its dependencies.
+     * If this method returns {@code true}, then invoking {@link #getInterface(Class)} is guaranteed to succeed
+     * without throwing an exception.
      *
      * @param  type The implementation class (can be {@code null}).
      * @return {@code true} if the given class is an interface of this standard,
@@ -328,16 +392,27 @@ public class MetadataStandard implements
      */
     public boolean isMetadata(final Class<?> type) {
         if (type != null) {
-            synchronized (accessors) {
-                if (accessors.containsKey(type)) {
-                    return true;
-                }
-                final Class<?> standardType = findInterface(type);
-                if (standardType != null) {
-                    accessors.put(type, standardType);
-                    return true;
+            if (accessors.containsKey(type)) {
+                return true;
+            }
+            if (dependencies != null) {
+                for (final MetadataStandard dependency : dependencies) {
+                    if (dependency.isMetadata(type)) {
+                        accessors.putIfAbsent(type, dependency);
+                        return true;
+                    }
                 }
             }
+            /*
+             * At this point, all cached values (including those in dependencies) have been checked.
+             * Performs the 'findInterface' computation only in last resort. Current implementation
+             * does not store negative results in order to avoid filling the cache with unrelated classes.
+             */
+            final Class<?> standardType = findInterface(type);
+            if (standardType != null) {
+                accessors.putIfAbsent(type, standardType);
+                return true;
+            }
         }
         return false;
     }
@@ -359,13 +434,15 @@ public class MetadataStandard implements
      * Only one metadata interface can be implemented. If the given type is already
      * an interface from the standard, then it is returned directly.
      *
+     * <p>This method ignores dependencies. Fallback on metadata standard dependencies shall be done by the caller.</p>
+     *
      * @param  type The standard interface or the implementation class.
      * @return The single interface, or {@code null} if none where found.
      */
     private Class<?> findInterface(final Class<?> type) {
         if (type != null) {
             if (type.isInterface()) {
-                if (type.getName().startsWith(interfacePackage)) {
+                if (isSupported(type.getName())) {
                     return type;
                 }
             } else {
@@ -423,7 +500,7 @@ public class MetadataStandard implements
      */
     private void getInterfaces(final Class<?> type, final Collection<Class<?>> interfaces) {
         for (final Class<?> candidate : type.getInterfaces()) {
-            if (candidate.getName().startsWith(interfacePackage)) {
+            if (isSupported(candidate.getName())) {
                 interfaces.add(candidate);
             }
             getInterfaces(candidate, interfaces);
@@ -452,25 +529,32 @@ public class MetadataStandard implements
     @SuppressWarnings("unchecked")
     public <T> Class<? super T> getInterface(final Class<T> type) throws ClassCastException {
         ensureNonNull("type", type);
-        final Class<?> standard;
-        synchronized (accessors) {
-            final Object value = accessors.get(type);
-            if (value != null) {
-                if (value instanceof PropertyAccessor) {
-                    standard = ((PropertyAccessor) value).type;
-                } else {
-                    standard = (Class<?>) value;
-                }
+        final Class<?> interf;
+        final Object value = accessors.get(type);
+        if (value instanceof PropertyAccessor) {
+            interf = ((PropertyAccessor) value).type;
+        } else if (value instanceof Class<?>) {
+            interf = (Class<?>) value;
+        } else if (value instanceof MetadataStandard) {
+            interf = ((MetadataStandard) value).getInterface(type);
+        } else {
+            interf = findInterface(type);
+            if (interf != null) {
+                accessors.putIfAbsent(type, interf);
             } else {
-                standard = findInterface(type);
-                if (standard == null) {
-                    throw new ClassCastException(Errors.format(Errors.Keys.UnknownType_1, type));
+                if (dependencies != null) {
+                    for (final MetadataStandard dependency : dependencies) {
+                        if (dependency.isMetadata(type)) {
+                            accessors.putIfAbsent(type, dependency);
+                            return dependency.getInterface(type);
+                        }
+                    }
                 }
-                accessors.put(type, standard);
+                throw new ClassCastException(Errors.format(Errors.Keys.UnknownType_1, type));
             }
         }
-        assert standard.isAssignableFrom(type) : type;
-        return (Class<? super T>) standard;
+        assert interf.isAssignableFrom(type) : type;
+        return (Class<? super T>) interf;
     }
 
     /**
@@ -793,8 +877,17 @@ public class MetadataStandard implements
         if (metadata1 == null || metadata2 == null) {
             return false;
         }
-        final PropertyAccessor accessor = getAccessor(metadata1.getClass(), true);
-        if (accessor.type != findInterface(metadata2.getClass())) {
+        final Class<?> type1 = metadata1.getClass();
+        final Class<?> type2 = metadata2.getClass();
+        if (type1 != type2 && mode == ComparisonMode.STRICT) {
+            return false;
+        }
+        final PropertyAccessor accessor = getAccessor(type1, true);
+        if (type1 != type2 && (!accessor.type.isAssignableFrom(type2) || accessor.type != getAccessor(type2, false).type)) {
+            /*
+             * Note: the check for (accessor.type != getAccessor(…).type) would have been enough, but checking
+             * for isAssignableFrom(…) first can avoid the (relatively costly) creation of new PropertyAccessor.
+             */
             return false;
         }
         /*
@@ -863,11 +956,12 @@ public class MetadataStandard implements
      * Assigns an {@link IdentityHashMap} instance to the given field.
      * Used on deserialization only.
      */
+    @SuppressWarnings("rawtypes")
     final void setMapForField(final Class<?> classe, final String name) {
         try {
             final Field field = classe.getDeclaredField(name);
             field.setAccessible(true);
-            field.set(this, new IdentityHashMap());
+            field.set(this, new ConcurrentHashMap());
         } catch (Exception e) { // (ReflectiveOperationException) on JDK7 branch.
             throw new AssertionError(e); // Should never happen (tested by MetadataStandardTest).
         }

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/StandardImplementation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/StandardImplementation.java?rev=1627546&r1=1627545&r2=1627546&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/StandardImplementation.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/StandardImplementation.java [UTF-8] Thu Sep 25 13:59:56 2014
@@ -74,11 +74,12 @@ final class StandardImplementation exten
      * @param interfacePackage      The root package for metadata interfaces, with a trailing {@code '.'}.
      * @param implementationPackage The root package for metadata implementations. with a trailing {@code '.'}.
      * @param acronyms              An array of (full text, acronyms) pairs. This array is not cloned.
+     * @param dependencies          The dependencies to other metadata standards, or {@code null} if none.
      */
-    StandardImplementation(final String citation, final String interfacePackage,
-            final String implementationPackage, final String[] acronyms)
+    StandardImplementation(final String citation, final String interfacePackage, final String implementationPackage,
+            final String[] acronyms, final MetadataStandard[] dependencies)
     {
-        super(citation, interfacePackage);
+        super(citation, interfacePackage, dependencies);
         this.implementationPackage = implementationPackage;
         this.acronyms              = acronyms;
         this.implementations       = new IdentityHashMap<Class<?>,Class<?>>();
@@ -120,8 +121,8 @@ final class StandardImplementation exten
          * CodeLists, Enums and Exceptions.
          */
         if (type != null && type.isInterface()) {
-            String name = type.getName();
-            if (name.startsWith(interfacePackage)) {
+            String classname = type.getName();
+            if (isSupported(classname)) {
                 synchronized (implementations) {
                     Class<?> candidate = implementations.get(type);
                     if (candidate != null) {
@@ -133,7 +134,7 @@ final class StandardImplementation exten
                      * have been replaced by their acronym (if any).
                      */
                     final StringBuilder buffer = new StringBuilder(implementationPackage)
-                            .append(name, interfacePackage.length(), name.length());
+                            .append(classname, interfacePackage.length(), classname.length());
                     if (acronyms != null) {
                         for (int i=0; i<acronyms.length; i+=2) {
                             final String acronym = acronyms[i];
@@ -149,9 +150,9 @@ final class StandardImplementation exten
                      */
                     final int prefixPosition = buffer.lastIndexOf(".") + 1;
                     buffer.insert(prefixPosition, isAbstract(type) ? "Abstract" : "Default");
-                    name = buffer.toString();
+                    classname = buffer.toString();
                     try {
-                        candidate = Class.forName(name);
+                        candidate = Class.forName(classname);
                         implementations.put(type, candidate);
                         return candidate.asSubclass(type);
                     } catch (ClassNotFoundException e) {

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java?rev=1627546&r1=1627545&r2=1627546&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java [UTF-8] Thu Sep 25 13:59:56 2014
@@ -619,10 +619,10 @@ public class ImmutableIdentifier extends
      * The {@code CITATION[…]} element inside an {@code ID[…]}.
      */
     private static final class Cite extends FormattableObject {
-        /** The component of the citation to format. */
+        /** The value of the citation to format. */
         private final String identifier;
 
-        /** Creates a new citation with the given component. */
+        /** Creates a new citation with the given value. */
         Cite(final String identifier) {
             this.identifier = identifier;
         }

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java?rev=1627546&r1=1627545&r2=1627546&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultBand.java [UTF-8] Thu Sep 25 13:59:56 2014
@@ -86,6 +86,11 @@ public class DefaultBand extends Default
     private Unit<Length> boundUnits;
 
     /**
+     * Designation of criterion for defining maximum and minimum wavelengths for a spectral band.
+     */
+    private BandDefinition bandBoundaryDefinition;
+
+    /**
      * Wavelength at which the response is the highest.
      */
     private Double peakResponse;
@@ -96,11 +101,6 @@ public class DefaultBand extends Default
     private Integer toneGradation;
 
     /**
-     * Designation of criterion for defining maximum and minimum wavelengths for a spectral band.
-     */
-    private BandDefinition bandBoundaryDefinition;
-
-    /**
      * Smallest distance between which separate points can be distinguished, as specified in
      * instrument design.
      */
@@ -259,6 +259,27 @@ public class DefaultBand extends Default
     }
 
     /**
+     * Returns the designation of criterion for defining maximum and minimum wavelengths for a spectral band.
+     *
+     * @return Criterion for defining maximum and minimum wavelengths, or {@code null}.
+     */
+    @Override
+    @XmlElement(name = "bandBoundaryDefinition", namespace = Namespaces.GMI)
+    public BandDefinition getBandBoundaryDefinition() {
+        return bandBoundaryDefinition;
+    }
+
+    /**
+     * Sets designation of criterion for defining maximum and minimum wavelengths for a spectral band.
+     *
+     * @param newValue The new band definition.
+     */
+    public void setBandBoundaryDefinition(final BandDefinition newValue) {
+        checkWritePermission();
+        bandBoundaryDefinition = newValue;
+    }
+
+    /**
      * Returns the wavelength at which the response is the highest.
      * The units of measurement is given by {@link #getUnits()}.
      *
@@ -356,27 +377,6 @@ public class DefaultBand extends Default
     }
 
     /**
-     * Returns the designation of criterion for defining maximum and minimum wavelengths for a spectral band.
-     *
-     * @return Criterion for defining maximum and minimum wavelengths, or {@code null}.
-     */
-    @Override
-    @XmlElement(name = "bandBoundaryDefinition", namespace = Namespaces.GMI)
-    public BandDefinition getBandBoundaryDefinition() {
-        return bandBoundaryDefinition;
-    }
-
-    /**
-     * Sets designation of criterion for defining maximum and minimum wavelengths for a spectral band.
-     *
-     * @param newValue The new band definition.
-     */
-    public void setBandBoundaryDefinition(final BandDefinition newValue) {
-        checkWritePermission();
-        bandBoundaryDefinition = newValue;
-    }
-
-    /**
      * Returns the smallest distance between which separate points can be distinguished,
      * as specified in instrument design.
      *

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultSampleDimension.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultSampleDimension.java?rev=1627546&r1=1627545&r2=1627546&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultSampleDimension.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/content/DefaultSampleDimension.java [UTF-8] Thu Sep 25 13:59:56 2014
@@ -68,44 +68,50 @@ public class DefaultSampleDimension exte
     private static final long serialVersionUID = 4517148689016920767L;
 
     /**
+     * Minimum value of data values in each dimension included in the resource.
+     */
+    private Double minValue;
+
+    /**
      * Maximum value of data values in each dimension included in the resource.
      */
     private Double maxValue;
 
     /**
-     * Minimum value of data values in each dimension included in the resource.
+     * Mean value of data values in each dimension included in the resource.
      */
-    private Double minValue;
+    private Double meanValue;
 
     /**
-     * Units of data in each dimension included in the resource.
+     * Number of values used in a thematicClassification resource.
      */
-    private Unit<?> units;
+    private Integer numberOfValues;
 
     /**
-     * Scale factor which has been applied to the cell value.
+     * Standard deviation of data values in each dimension included in the resource.
      */
-    private Double scaleFactor;
+    private Double standardDeviation;
 
     /**
-     * Physical value corresponding to a cell value of zero.
+     * Units of data in each dimension included in the resource.
      */
-    private Double offset;
+    private Unit<?> units;
 
     /**
-     * Mean value of data values in each dimension included in the resource.
+     * Scale factor which has been applied to the cell value.
      */
-    private Double meanValue;
+    private Double scaleFactor;
 
     /**
-     * Number of values used in a thematicClassification resource.
+     * Physical value corresponding to a cell value of zero.
      */
-    private Integer numberOfValues;
+    private Double offset;
 
     /**
-     * Standard deviation of data values in each dimension included in the resource.
+     * Maximum number of significant bits in the uncompressed representation
+     * for the value in each band of each pixel.
      */
-    private Double standardDeviation;
+    private Integer bitsPerValue;
 
     /**
      * Type of other attribute description.
@@ -119,12 +125,6 @@ public class DefaultSampleDimension exte
     private Record otherProperty;
 
     /**
-     * Maximum number of significant bits in the uncompressed representation
-     * for the value in each band of each pixel.
-     */
-    private Integer bitsPerValue;
-
-    /**
      * Constructs an initially empty sample dimension.
      */
     public DefaultSampleDimension() {
@@ -142,17 +142,17 @@ public class DefaultSampleDimension exte
     public DefaultSampleDimension(final SampleDimension object) {
         super(object);
         if (object != null) {
-            maxValue          = object.getMaxValue();
             minValue          = object.getMinValue();
-            units             = object.getUnits();
-            scaleFactor       = object.getScaleFactor();
-            offset            = object.getOffset();
+            maxValue          = object.getMaxValue();
             meanValue         = object.getMeanValue();
             numberOfValues    = object.getNumberOfValues();
             standardDeviation = object.getStandardDeviation();
+            units             = object.getUnits();
+            scaleFactor       = object.getScaleFactor();
+            offset            = object.getOffset();
+            bitsPerValue      = object.getBitsPerValue();
             otherPropertyType = object.getOtherPropertyType();
             otherProperty     = object.getOtherProperty();
-            bitsPerValue      = object.getBitsPerValue();
         }
     }
 
@@ -230,129 +230,154 @@ public class DefaultSampleDimension exte
     }
 
     /**
-     * Returns the units of data in the dimension.
+     * Returns the mean value of data values in each dimension included in the resource.
      *
-     * @return The units of data in the dimension, or {@code null} if unspecified.
+     * @return The mean value of data values in each dimension included in the resource, or {@code null} if none.
      */
     @Override
-    @XmlElement(name = "units")
-    public Unit<?> getUnits() {
-        return units;
+/// @XmlElement(name = "meanValue")
+    public Double getMeanValue() {
+        return meanValue;
     }
 
     /**
-     * Sets the units of data in the dimension.
+     * Sets the mean value of data values in each dimension included in the resource.
      *
-     * @param newValue The new units of data in the dimension.
+     * @param newValue The new mean value of data values in each dimension included in the resource.
      */
-    public void setUnits(final Unit<?> newValue) {
+    public void setMeanValue(final Double newValue) {
         checkWritePermission();
-        units = newValue;
+        meanValue = newValue;
     }
 
     /**
-     * Returns the scale factor which has been applied to the cell value.
+     * Returns the number of values used in a thematic classification resource.
      *
-     * @return Scale factor which has been applied to the cell value, or {@code null} if none.
+     * @return The number of values used in a thematic classification resource, or {@code null} if none.
      */
     @Override
-/// @XmlElement(name = "scaleFactor")
-    public Double getScaleFactor() {
-        return scaleFactor;
+/// @XmlElement(name = "numberOfValues")
+    public Integer getNumberOfValues() {
+        return numberOfValues;
     }
 
     /**
-     * Sets the scale factor which has been applied to the cell value.
+     * Sets the number of values used in a thematic classification resource.
      *
-     * @param newValue The new scale factor which has been applied to the cell value.
+     * @param newValues The new number of values used in a thematic classification resource.
      */
-    public void setScaleFactor(final Double newValue) {
+    public void setNumberOfValues(final Integer newValues) {
         checkWritePermission();
-        scaleFactor = newValue;
+        numberOfValues = newValues;
     }
 
     /**
-     * Returns the physical value corresponding to a cell value of zero.
+     * Returns the standard deviation of data values in each dimension included in the resource.
      *
-     * @return The physical value corresponding to a cell value of zero, or {@code null} if none.
+     * @return Standard deviation of data values in each dimension included in the resource, or {@code null} if none.
      */
     @Override
-/// @XmlElement(name = "offset")
-    public Double getOffset() {
-        return offset;
+/// @XmlElement(name = "standardDeviation")
+    public Double getStandardDeviation() {
+        return standardDeviation;
     }
 
     /**
-     * Sets the physical value corresponding to a cell value of zero.
+     * Sets the standard deviation of data values in each dimension included in the resource.
      *
-     * @param newValue The new physical value corresponding to a cell value of zero, or {@code null} if none..
+     * @param newValue The new standard deviation of data values in each dimension included in the resource.
      */
-    public void setOffset(final Double newValue) {
+    public void setStandardDeviation(final Double newValue) {
         checkWritePermission();
-        offset = newValue;
+        standardDeviation = newValue;
     }
 
     /**
-     * Returns the mean value of data values in each dimension included in the resource.
+     * Returns the units of data in the dimension.
      *
-     * @return The mean value of data values in each dimension included in the resource, or {@code null} if none.
+     * @return The units of data in the dimension, or {@code null} if unspecified.
      */
     @Override
-/// @XmlElement(name = "meanValue")
-    public Double getMeanValue() {
-        return meanValue;
+    @XmlElement(name = "units")
+    public Unit<?> getUnits() {
+        return units;
     }
 
     /**
-     * Sets the mean value of data values in each dimension included in the resource.
+     * Sets the units of data in the dimension.
      *
-     * @param newValue The new mean value of data values in each dimension included in the resource.
+     * @param newValue The new units of data in the dimension.
      */
-    public void setMeanValue(final Double newValue) {
+    public void setUnits(final Unit<?> newValue) {
         checkWritePermission();
-        meanValue = newValue;
+        units = newValue;
     }
 
     /**
-     * Returns the number of values used in a thematic classification resource.
+     * Returns the scale factor which has been applied to the cell value.
      *
-     * @return The number of values used in a thematic classification resource, or {@code null} if none.
+     * @return Scale factor which has been applied to the cell value, or {@code null} if none.
      */
     @Override
-/// @XmlElement(name = "numberOfValues")
-    public Integer getNumberOfValues() {
-        return numberOfValues;
+/// @XmlElement(name = "scaleFactor")
+    public Double getScaleFactor() {
+        return scaleFactor;
     }
 
     /**
-     * Sets the number of values used in a thematic classification resource.
+     * Sets the scale factor which has been applied to the cell value.
      *
-     * @param newValues The new number of values used in a thematic classification resource.
+     * @param newValue The new scale factor which has been applied to the cell value.
      */
-    public void setNumberOfValues(final Integer newValues) {
+    public void setScaleFactor(final Double newValue) {
         checkWritePermission();
-        numberOfValues = newValues;
+        scaleFactor = newValue;
     }
 
     /**
-     * Returns the standard deviation of data values in each dimension included in the resource.
+     * Returns the maximum number of significant bits in the uncompressed representation
+     * for the value in each band of each pixel.
      *
-     * @return Standard deviation of data values in each dimension included in the resource, or {@code null} if none.
+     * @return Maximum number of significant bits in the uncompressed representation
+     *         for the value in each band of each pixel, or {@code null} if none.
      */
     @Override
-/// @XmlElement(name = "standardDeviation")
-    public Double getStandardDeviation() {
-        return standardDeviation;
+    @ValueRange(minimum = 1)
+/// @XmlElement(name = "bitsPerValues")
+    public Integer getBitsPerValue() {
+        return bitsPerValue;
     }
 
     /**
-     * Sets the standard deviation of data values in each dimension included in the resource.
+     * Sets the maximum number of significant bits in the uncompressed representation
+     * for the value in each band of each pixel.
      *
-     * @param newValue The new standard deviation of data values in each dimension included in the resource.
+     * @param newValue The new maximum number of significant bits.
      */
-    public void setStandardDeviation(final Double newValue) {
+    public void setBitsPerValue(final Integer newValue) {
         checkWritePermission();
-        standardDeviation = newValue;
+        bitsPerValue = newValue;
+    }
+
+    /**
+     * Returns the physical value corresponding to a cell value of zero.
+     *
+     * @return The physical value corresponding to a cell value of zero, or {@code null} if none.
+     */
+    @Override
+/// @XmlElement(name = "offset")
+    public Double getOffset() {
+        return offset;
+    }
+
+    /**
+     * Sets the physical value corresponding to a cell value of zero.
+     *
+     * @param newValue The new physical value corresponding to a cell value of zero, or {@code null} if none..
+     */
+    public void setOffset(final Double newValue) {
+        checkWritePermission();
+        offset = newValue;
     }
 
     /**
@@ -398,29 +423,4 @@ public class DefaultSampleDimension exte
         checkWritePermission();
         otherProperty = newValue;
     }
-
-    /**
-     * Returns the maximum number of significant bits in the uncompressed representation
-     * for the value in each band of each pixel.
-     *
-     * @return Maximum number of significant bits in the uncompressed representation
-     *         for the value in each band of each pixel, or {@code null} if none.
-     */
-    @Override
-    @ValueRange(minimum = 1)
-/// @XmlElement(name = "bitsPerValues")
-    public Integer getBitsPerValue() {
-        return bitsPerValue;
-    }
-
-    /**
-     * Sets the maximum number of significant bits in the uncompressed representation
-     * for the value in each band of each pixel.
-     *
-     * @param newValue The new maximum number of significant bits.
-     */
-    public void setBitsPerValue(final Integer newValue) {
-        checkWritePermission();
-        bitsPerValue = newValue;
-    }
 }

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultExtent.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultExtent.java?rev=1627546&r1=1627545&r2=1627546&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultExtent.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/DefaultExtent.java [UTF-8] Thu Sep 25 13:59:56 2014
@@ -87,19 +87,19 @@ public class DefaultExtent extends ISOMe
     private InternationalString description;
 
     /**
-     * Provides geographic component of the extent of the referring object
+     * Provides geographic component of the extent of the referring object.
      */
     private Collection<GeographicExtent> geographicElements;
 
     /**
-     * Provides temporal component of the extent of the referring object
+     * Provides vertical component of the extent of the referring object.
      */
-    private Collection<TemporalExtent> temporalElements;
+    private Collection<VerticalExtent> verticalElements;
 
     /**
-     * Provides vertical component of the extent of the referring object
+     * Provides temporal component of the extent of the referring object.
      */
-    private Collection<VerticalExtent> verticalElements;
+    private Collection<TemporalExtent> temporalElements;
 
     /**
      * Constructs an initially empty extent.
@@ -215,43 +215,43 @@ public class DefaultExtent extends ISOMe
     }
 
     /**
-     * Provides temporal component of the extent of the referring object.
+     * Provides vertical component of the extent of the referring object.
      *
-     * @return The temporal extent, or an empty set if none.
+     * @return The vertical extent, or an empty set if none.
      */
     @Override
-    @XmlElement(name = "temporalElement")
-    public Collection<TemporalExtent> getTemporalElements() {
-        return temporalElements = nonNullCollection(temporalElements, TemporalExtent.class);
+    @XmlElement(name = "verticalElement")
+    public Collection<VerticalExtent> getVerticalElements() {
+        return verticalElements = nonNullCollection(verticalElements, VerticalExtent.class);
     }
 
     /**
-     * Sets temporal component of the extent of the referring object.
+     * Sets vertical component of the extent of the referring object.
      *
-     * @param newValues The new temporal elements.
+     * @param newValues The new vertical elements.
      */
-    public void setTemporalElements(final Collection<? extends TemporalExtent> newValues) {
-        temporalElements = writeCollection(newValues, temporalElements, TemporalExtent.class);
+    public void setVerticalElements(final Collection<? extends VerticalExtent> newValues) {
+        verticalElements = writeCollection(newValues, verticalElements, VerticalExtent.class);
     }
 
     /**
-     * Provides vertical component of the extent of the referring object.
+     * Provides temporal component of the extent of the referring object.
      *
-     * @return The vertical extent, or an empty set if none.
+     * @return The temporal extent, or an empty set if none.
      */
     @Override
-    @XmlElement(name = "verticalElement")
-    public Collection<VerticalExtent> getVerticalElements() {
-        return verticalElements = nonNullCollection(verticalElements, VerticalExtent.class);
+    @XmlElement(name = "temporalElement")
+    public Collection<TemporalExtent> getTemporalElements() {
+        return temporalElements = nonNullCollection(temporalElements, TemporalExtent.class);
     }
 
     /**
-     * Sets vertical component of the extent of the referring object.
+     * Sets temporal component of the extent of the referring object.
      *
-     * @param newValues The new vertical elements.
+     * @param newValues The new temporal elements.
      */
-    public void setVerticalElements(final Collection<? extends VerticalExtent> newValues) {
-        verticalElements = writeCollection(newValues, verticalElements, VerticalExtent.class);
+    public void setTemporalElements(final Collection<? extends TemporalExtent> newValues) {
+        temporalElements = writeCollection(newValues, temporalElements, TemporalExtent.class);
     }
 
     /**

Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/FormatterTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/FormatterTest.java?rev=1627546&r1=1627545&r2=1627546&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/FormatterTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/FormatterTest.java [UTF-8] Thu Sep 25 13:59:56 2014
@@ -23,9 +23,11 @@ import org.opengis.referencing.operation
 import org.opengis.referencing.cs.AxisDirection;
 import org.opengis.metadata.extent.GeographicBoundingBox;
 import org.apache.sis.metadata.iso.extent.DefaultGeographicBoundingBox;
+import org.apache.sis.metadata.iso.extent.DefaultVerticalExtent;
 import org.apache.sis.measure.Units;
 import org.apache.sis.internal.util.X364;
 import org.apache.sis.test.mock.MatrixMock;
+import org.apache.sis.test.mock.VerticalCRSMock;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
@@ -38,7 +40,7 @@ import static org.apache.sis.test.Metada
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.4
+ * @version 0.5
  * @module
  */
 @DependsOn({ConventionTest.class, SymbolsTest.class, ColorsTest.class})
@@ -64,6 +66,19 @@ public final strictfp class FormatterTes
     }
 
     /**
+     * Tests (indirectly) formatting of a vertical extent.
+     */
+    @Test
+    public void testAppendVerticalExtent() {
+        final DefaultVerticalExtent extent = new DefaultVerticalExtent(102, 108, VerticalCRSMock.HEIGHT_ft);
+        assertWktEquals(Convention.WKT2, "VerticalExtent[102, 108, LengthUnit[“ft”, 0.3048]]", extent);
+
+        extent.setMinimumValue(100.2);
+        extent.setMaximumValue(100.8);
+        assertWktEquals(Convention.WKT2, "VerticalExtent[100.2, 100.8, LengthUnit[“ft”, 0.3048]]", extent);
+    }
+
+    /**
      * Tests (indirectly) {@link Formatter#append(Matrix)}.
      */
     @Test

Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataStandardTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataStandardTest.java?rev=1627546&r1=1627545&r2=1627546&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataStandardTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/MetadataStandardTest.java [UTF-8] Thu Sep 25 13:59:56 2014
@@ -23,12 +23,15 @@ import java.util.HashSet;
 import java.util.Collection;
 import org.opengis.metadata.citation.Citation;
 import org.opengis.metadata.quality.Completeness;
+import org.opengis.referencing.IdentifiedObject;
+import org.opengis.referencing.crs.GeographicCRS;
 import org.opengis.coverage.grid.RectifiedGrid;
 import org.apache.sis.metadata.iso.citation.DefaultCitation;
 import org.apache.sis.metadata.iso.citation.HardCodedCitations;
 import org.apache.sis.metadata.iso.acquisition.DefaultPlatform;
 import org.apache.sis.metadata.iso.acquisition.DefaultInstrument;
 import org.apache.sis.metadata.iso.quality.AbstractCompleteness;
+import org.apache.sis.internal.simple.SimpleIdentifiedObject;
 import org.apache.sis.util.iso.SimpleInternationalString;
 import org.apache.sis.util.ComparisonMode;
 import org.apache.sis.test.DependsOnMethod;
@@ -36,6 +39,7 @@ import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
+import static java.util.Collections.singleton;
 import static org.apache.sis.test.Assert.*;
 import static org.apache.sis.test.TestUtilities.getSingleton;
 
@@ -66,13 +70,79 @@ import static org.apache.sis.test.TestUt
     ValueMapTest.class})
 public final strictfp class MetadataStandardTest extends TestCase {
     /**
+     * Tests {@link MetadataStandard#isMetadata(Class)}.
+     */
+    @Test
+    public void testIsMetadata() {
+        MetadataStandard std = MetadataStandard.ISO_19115;
+        assertFalse("isMetadata(String)",                 std.isMetadata(String.class));
+        assertTrue ("isMetadata(Citation)",               std.isMetadata(Citation.class));
+        assertTrue ("isMetadata(DefaultCitation)",        std.isMetadata(DefaultCitation.class));
+        assertFalse("isMetadata(IdentifiedObject)",       std.isMetadata(IdentifiedObject.class));
+        assertFalse("isMetadata(SimpleIdentifiedObject)", std.isMetadata(SimpleIdentifiedObject.class));
+        assertFalse("isMetadata(GeographicCRS)",          std.isMetadata(GeographicCRS.class));
+        assertFalse("isMetadata(RectifiedGrid)",          std.isMetadata(RectifiedGrid.class));
+
+        std = MetadataStandard.ISO_19111;
+        assertFalse("isMetadata(String)",                 std.isMetadata(String.class));
+        assertTrue ("isMetadata(Citation)",               std.isMetadata(Citation.class));          // Dependency
+        assertTrue ("isMetadata(DefaultCitation)",        std.isMetadata(DefaultCitation.class));   // Dependency
+        assertTrue ("isMetadata(IdentifiedObject)",       std.isMetadata(IdentifiedObject.class));
+        assertTrue ("isMetadata(SimpleIdentifiedObject)", std.isMetadata(SimpleIdentifiedObject.class));
+        assertTrue ("isMetadata(GeographicCRS)",          std.isMetadata(GeographicCRS.class));
+        assertFalse("isMetadata(RectifiedGrid)",          std.isMetadata(RectifiedGrid.class));
+
+        std = MetadataStandard.ISO_19123;
+        assertFalse("isMetadata(String)",                 std.isMetadata(String.class));
+        assertTrue ("isMetadata(Citation)",               std.isMetadata(Citation.class));               // Transitive dependency
+        assertTrue ("isMetadata(DefaultCitation)",        std.isMetadata(DefaultCitation.class));        // Transivive dependency
+        assertTrue ("isMetadata(IdentifiedObject)",       std.isMetadata(IdentifiedObject.class));       // Dependency
+        assertTrue ("isMetadata(SimpleIdentifiedObject)", std.isMetadata(SimpleIdentifiedObject.class)); // Dependency
+        assertTrue ("isMetadata(GeographicCRS)",          std.isMetadata(GeographicCRS.class));          // Dependency
+        assertTrue ("isMetadata(RectifiedGrid)",          std.isMetadata(RectifiedGrid.class));
+    }
+
+    /**
      * Tests {@link MetadataStandard#getInterface(Class)}.
      */
     @Test
+    @DependsOnMethod("testIsMetadata")
     public void testGetInterface() {
-        final MetadataStandard std = MetadataStandard.ISO_19115;
-        assertEquals(Citation.class,     std.getInterface(DefaultCitation.class));
-        assertEquals(Completeness.class, std.getInterface(AbstractCompleteness.class));
+        MetadataStandard std = MetadataStandard.ISO_19115;
+        assertEquals("getInterface(Citation)",             Citation.class,     std.getInterface(Citation.class));
+        assertEquals("getInterface(DefaultCitation)",      Citation.class,     std.getInterface(DefaultCitation.class));
+        assertEquals("getInterface(AbstractCompleteness)", Completeness.class, std.getInterface(AbstractCompleteness.class));
+
+        std = MetadataStandard.ISO_19111;
+        assertEquals("getInterface(Citation)",               Citation.class,         std.getInterface(Citation.class));
+        assertEquals("getInterface(DefaultCitation)",        Citation.class,         std.getInterface(DefaultCitation.class));
+        assertEquals("getInterface(AbstractCompleteness)",   Completeness.class,     std.getInterface(AbstractCompleteness.class));
+        assertEquals("getInterface(IdentifiedObject)",       IdentifiedObject.class, std.getInterface(IdentifiedObject.class));
+        assertEquals("getInterface(SimpleIdentifiedObject)", IdentifiedObject.class, std.getInterface(SimpleIdentifiedObject.class));
+        assertEquals("getInterface(GeographicCRS)",          GeographicCRS.class,    std.getInterface(GeographicCRS.class));
+
+        // Verify that the cache has not been updated in inconsistent way.
+        testIsMetadata();
+    }
+
+    /**
+     * Tests {@link MetadataStandard#getAccessor(Class, boolean)}.
+     */
+    @Test
+    @DependsOnMethod("testGetInterface")
+    public void testGetAccessor() {
+        MetadataStandard std = MetadataStandard.ISO_19115;
+        assertEquals("getAccessor(DefaultCitation)",      Citation.class,     std.getAccessor(DefaultCitation.class, true).type);
+        assertEquals("getAccessor(AbstractCompleteness)", Completeness.class, std.getAccessor(AbstractCompleteness.class, true).type);
+        assertNull  ("getAccessor(SimpleIdentifiedObject)",                   std.getAccessor(SimpleIdentifiedObject.class, false));
+
+        std = MetadataStandard.ISO_19111;
+        assertEquals("getAccessor(DefaultCitation)",        Citation.class,         std.getAccessor(DefaultCitation.class, true).type);
+        assertEquals("getAccessor(AbstractCompleteness)",   Completeness.class,     std.getAccessor(AbstractCompleteness.class, true).type);
+        assertEquals("getAccessor(SimpleIdentifiedObject)", IdentifiedObject.class, std.getAccessor(SimpleIdentifiedObject.class, true).type);
+
+        // Verify that the cache has not been updated in inconsistent way.
+        testGetInterface();
     }
 
     /**
@@ -80,8 +150,9 @@ public final strictfp class MetadataStan
      * A {@link ClassCastException} is expected.
      */
     @Test
+    @DependsOnMethod("testGetInterface")
     public void testGetWrongInterface() {
-        final MetadataStandard std = new MetadataStandard("SIS", "org.apache.sis.dummy.");
+        final MetadataStandard std = new MetadataStandard("SIS", "org.apache.sis.dummy.", null);
         try {
             std.getInterface(DefaultCitation.class);
             fail("No dummy interface expected.");
@@ -95,6 +166,7 @@ public final strictfp class MetadataStan
      * Tests the {@link MetadataStandard#equals(Object, Object, ComparisonMode)} method.
      */
     @Test
+    @DependsOnMethod("testGetAccessor")
     public void testEquals() {
         final MetadataStandard std = MetadataStandard.ISO_19115;
 
@@ -123,7 +195,7 @@ public final strictfp class MetadataStan
         final DefaultPlatform platform = new DefaultPlatform();
         platform.setDescription(new SimpleInternationalString("A platform."));
         instrument.setMountedOn(platform);
-        platform.getInstruments().add(instrument);
+        platform.setInstruments(singleton(instrument));
         return platform;
     }
 
@@ -149,6 +221,7 @@ public final strictfp class MetadataStan
      * {@code MetadataStandard} methods depend on it ({@code equals}, {@code hashCode}, {@code prune}, <i>etc.</i>).
      */
     @Test
+    @DependsOnMethod("testGetAccessor")
     public void testValueMap() {
         final DefaultCitation instance = new DefaultCitation(HardCodedCitations.EPSG);
         final Map<String,Object> map = MetadataStandard.ISO_19115.asValueMap(instance,
@@ -223,10 +296,12 @@ public final strictfp class MetadataStan
      * be accessible even if there is no implementation on the classpath.
      */
     @Test
+    @DependsOnMethod("testGetAccessor")
     public void testWithoutImplementation() {
         final MetadataStandard std = MetadataStandard.ISO_19123;
-        assertFalse("isMetadata(Citation)",        std.isMetadata(Citation.class));
-        assertFalse("isMetadata(DefaultCitation)", std.isMetadata(DefaultCitation.class));
+        assertFalse("isMetadata(String)",          std.isMetadata(String.class));
+        assertTrue ("isMetadata(Citation)",        std.isMetadata(Citation.class));         // Transitive dependency
+        assertTrue ("isMetadata(DefaultCitation)", std.isMetadata(DefaultCitation.class));  // Transitive dependency
         assertTrue ("isMetadata(RectifiedGrid)",   std.isMetadata(RectifiedGrid.class));
         /*
          * Ensure that the getters have been found.

Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/PrunerTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/PrunerTest.java?rev=1627546&r1=1627545&r2=1627546&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/PrunerTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/PrunerTest.java [UTF-8] Thu Sep 25 13:59:56 2014
@@ -28,6 +28,7 @@ import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
 import static org.junit.Assert.*;
+import static java.util.Collections.singleton;
 import static org.apache.sis.metadata.ValueExistencePolicy.isNullOrEmpty;
 
 
@@ -69,9 +70,9 @@ public final strictfp class PrunerTest e
         identification = new DefaultDataIdentification();
         extent         = new DefaultExtent();
         bbox           = new DefaultGeographicBoundingBox();
-        extent.getGeographicElements().add(bbox);
-        identification.getExtents().add(extent);
-        metadata.getIdentificationInfo().add(identification);
+        extent.setGeographicElements(singleton(bbox));
+        identification.setExtents(singleton(extent));
+        metadata.setIdentificationInfo(singleton(identification));
     }
 
     /**
@@ -123,8 +124,8 @@ public final strictfp class PrunerTest e
      */
     private void createCyclicMetadata() {
         final DefaultAcquisitionInformation acquisition = new DefaultAcquisitionInformation();
-        acquisition.getPlatforms().add(MetadataStandardTest.createCyclicMetadata());
-        metadata.getAcquisitionInformation().add(acquisition);
+        acquisition.setPlatforms(singleton(MetadataStandardTest.createCyclicMetadata()));
+        metadata.setAcquisitionInformation(singleton(acquisition));
     }
 
     /**

Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java?rev=1627546&r1=1627545&r2=1627546&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeNodeTest.java [UTF-8] Thu Sep 25 13:59:56 2014
@@ -40,6 +40,7 @@ import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
 import static org.junit.Assert.*;
+import static java.util.Collections.singleton;
 
 
 /**
@@ -83,16 +84,16 @@ public final strictfp class TreeNodeTest
         final DefaultCitation citation = TreeNodeChildrenTest.metadataWithMultiOccurrences();
         AbstractParty party = new DefaultOrganisation("Some organisation", null, null, null);
         DefaultResponsibility responsibility = new DefaultResponsibility(Role.DISTRIBUTOR, null, party);
-        citation.getCitedResponsibleParties().add(responsibility);
+        assertTrue(citation.getCitedResponsibleParties().add(responsibility));
 
         // Add a second responsible party with deeper hierarchy.
         final DefaultContact contact = new DefaultContact();
         final DefaultAddress address = new DefaultAddress();
-        address.getElectronicMailAddresses().add("Some email");
-        contact.getAddresses().add(address);
+        address.setElectronicMailAddresses(singleton("Some email"));
+        contact.setAddresses(singleton(address));
         party = new DefaultIndividual("Some person of contact", null, contact);
         responsibility = new DefaultResponsibility(Role.POINT_OF_CONTACT, null, party);
-        citation.getCitedResponsibleParties().add(responsibility);
+        assertTrue(citation.getCitedResponsibleParties().add(responsibility));
         return citation;
     }
 

Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableFormatTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableFormatTest.java?rev=1627546&r1=1627545&r2=1627546&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableFormatTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/TreeTableFormatTest.java [UTF-8] Thu Sep 25 13:59:56 2014
@@ -39,6 +39,8 @@ import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
+import static java.util.Arrays.asList;
+import static java.util.Collections.singleton;
 import static org.apache.sis.test.Assert.*;
 
 
@@ -84,16 +86,15 @@ public final strictfp class TreeTableFor
         final InternationalString title = new SimpleInternationalString("Undercurrent");
         citation.setTitle(title);
         citation.setISBN("9782505004509");
-        citation.getPresentationForms().add(PresentationForm.DOCUMENT_HARDCOPY);
-        citation.getPresentationForms().add(PresentationForm.IMAGE_HARDCOPY);
-        citation.getAlternateTitles().add(new SimpleInternationalString("Alt A"));
-        citation.getAlternateTitles().add(new SimpleInternationalString("Alt B"));
-
-        citation.getCitedResponsibleParties().add(new DefaultResponsibility(Role.AUTHOR, null,
-                new DefaultIndividual("Testsuya Toyoda", null, null)));
-        citation.getCitedResponsibleParties().add(new DefaultResponsibility(null, null,
-                new DefaultIndividual("A japanese author", null, null)));
-
+        citation.setPresentationForms(asList(
+                PresentationForm.DOCUMENT_HARDCOPY,
+                PresentationForm.IMAGE_HARDCOPY));
+        citation.setAlternateTitles(asList(
+                new SimpleInternationalString("Alt A"),
+                new SimpleInternationalString("Alt B")));
+        citation.setCitedResponsibleParties(asList(
+                new DefaultResponsibility(Role.AUTHOR, null, new DefaultIndividual("Testsuya Toyoda", null, null)),
+                new DefaultResponsibility(null, null, new DefaultIndividual("A japanese author", null, null))));
         return citation;
     }
 
@@ -133,13 +134,11 @@ public final strictfp class TreeTableFor
         final DefaultCitation   titled = new DefaultCitation("Some specification");
         final DefaultCitation    coded = new DefaultCitation();
         final DefaultCitation untitled = new DefaultCitation();
-        titled  .getPresentationForms().add(PresentationForm.DOCUMENT_HARDCOPY);
-        coded   .getPresentationForms().add(PresentationForm.IMAGE_HARDCOPY);
-        untitled.getCitedResponsibleParties().add(new DefaultResponsibility(Role.AUTHOR, null, null));
+        titled  .setPresentationForms(singleton(PresentationForm.DOCUMENT_HARDCOPY));
+        coded   .setPresentationForms(singleton(PresentationForm.IMAGE_HARDCOPY));
+        untitled.setCitedResponsibleParties(singleton(new DefaultResponsibility(Role.AUTHOR, null, null)));
         final DefaultProcessing processing = new DefaultProcessing();
-        processing.getDocumentations().add(titled);
-        processing.getDocumentations().add(coded);
-        processing.getDocumentations().add(untitled);
+        processing.setDocumentations(asList(titled, coded, untitled));
         final String text = format.format(processing.asTreeTable());
         assertMultilinesEquals(
             "Processing\n" +

Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/ValueMapTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/ValueMapTest.java?rev=1627546&r1=1627545&r2=1627546&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/ValueMapTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/ValueMapTest.java [UTF-8] Thu Sep 25 13:59:56 2014
@@ -93,7 +93,7 @@ public final strictfp class ValueMapTest
         author   = new DefaultResponsibility();
         citation = new DefaultCitation(title);
         author.setParties(singleton(new DefaultIndividual("Testsuya Toyoda", null, null)));
-        citation.getCitedResponsibleParties().add(author);
+        citation.setCitedResponsibleParties(singleton(author));
         citation.setISBN("9782505004509");
         citation.setEdition(NilReason.UNKNOWN.createNilObject(InternationalString.class));
         return MetadataStandard.ISO_19115.asValueMap(citation, KeyNamePolicy.JAVABEANS_PROPERTY, ValueExistencePolicy.NON_EMPTY);

Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/CustomMetadataTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/CustomMetadataTest.java?rev=1627546&r1=1627545&r2=1627546&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/CustomMetadataTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/CustomMetadataTest.java [UTF-8] Thu Sep 25 13:59:56 2014
@@ -42,6 +42,7 @@ import org.apache.sis.test.XMLTestCase;
 import org.apache.sis.xml.XML;
 import org.junit.Test;
 
+import static java.util.Collections.singleton;
 import static org.junit.Assert.*;
 
 
@@ -138,7 +139,7 @@ public final strictfp class CustomMetada
             @Override public Collection<Citation>                  getAdditionalDocumentations()   {return null;}
         };
         final DefaultMetadata data = new DefaultMetadata();
-        assertTrue(data.getIdentificationInfo().add(identification));
+        data.setIdentificationInfo(singleton(identification));
         final String xml = XML.marshal(data);
         /*
          * A few simple checks.

Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/HardCodedCitations.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/HardCodedCitations.java?rev=1627546&r1=1627545&r2=1627546&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/HardCodedCitations.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/HardCodedCitations.java [UTF-8] Thu Sep 25 13:59:56 2014
@@ -55,7 +55,7 @@ public final strictfp class HardCodedCit
         final DefaultCitation c = new DefaultCitation("Open Geospatial consortium");
         c.setAlternateTitles(singleton(new SimpleInternationalString("OGC")));
         c.setPresentationForms(singleton(PresentationForm.DOCUMENT_DIGITAL));
-        c.getIdentifiers().add(new DefaultIdentifier("OGC"));
+        c.setIdentifiers(singleton(new DefaultIdentifier("OGC")));
         c.freeze();
         OGC = c;
     }
@@ -70,7 +70,7 @@ public final strictfp class HardCodedCit
         final DefaultCitation c = new DefaultCitation("International Organization for Standardization");
         c.setAlternateTitles(singleton(new SimpleInternationalString("ISO")));
         c.setPresentationForms(singleton(PresentationForm.DOCUMENT_DIGITAL));
-        c.getIdentifiers().add(new DefaultIdentifier("ISO"));
+        c.setIdentifiers(singleton(new DefaultIdentifier("ISO")));
         c.freeze();
         ISO = c;
     }
@@ -96,32 +96,49 @@ public final strictfp class HardCodedCit
     static {
         final DefaultCitation c = new DefaultCitation("International Association of Oil & Gas Producers");
         c.setAlternateTitles(singleton(new SimpleInternationalString("OGP")));
-        c.getIdentifiers().add(new DefaultIdentifier("OGP"));
+        c.setIdentifiers(singleton(new DefaultIdentifier("OGP")));
         c.freeze();
         OGP = c;
     }
 
     /**
      * The <a href="http://www.epsg.org">European Petroleum Survey Group</a> authority.
-     * An {@linkplain Citation#getAlternateTitles() alternate title} for this citation is
-     * "EPSG" (according ISO 19115, alternate titles often contain abbreviations). In
-     * addition, this citation contains the "EPSG" {@linkplain Citation#getIdentifiers identifier}.
+     * An {@linkplain Citation#getAlternateTitles() alternate title} for this citation is "EPSG"
+     * (according ISO 19115, alternate titles often contain abbreviations). In addition,
+     * this citation contains the "EPSG" {@linkplain Citation#getIdentifiers() identifier}.
+     *
+     * <p>String representation:</p>
+     *
+     * {@preformat text
+     *   Citation
+     *     ├─Title………………………………………………………… European Petroleum Survey Group
+     *     ├─Alternate title……………………………… EPSG
+     *     ├─Identifier
+     *     │   └─Code………………………………………………… EPSG
+     *     ├─Cited responsible party
+     *     │   ├─Party
+     *     │   │   ├─Name……………………………………… International Association of Oil & Gas Producers
+     *     │   │   └─Contact info
+     *     │   │       └─Online resource
+     *     │   │           ├─Linkage………… http://www.epsg.org
+     *     │   │           └─Function……… Information
+     *     │   └─Role………………………………………………… Principal investigator
+     *     └─Presentation form………………………… Table digital
+     * }
      */
     public static final DefaultCitation EPSG;
     static {
-        final SimpleInternationalString title = new SimpleInternationalString("European Petroleum Survey Group");
         final DefaultOnlineResource r = new DefaultOnlineResource(URI.create("http://www.epsg.org"));
         r.setFunction(OnLineFunction.INFORMATION);
 
-        final DefaultResponsibleParty p = new DefaultResponsibleParty(Role.PRINCIPAL_INVESTIGATOR);
-        p.setOrganisationName(title);
-        p.setContactInfo(new DefaultContact(r));
+        final DefaultResponsibility p = new DefaultResponsibility(Role.PRINCIPAL_INVESTIGATOR, null,
+                new DefaultOrganisation(OGP.getTitle(), null, null, new DefaultContact(r)));
 
-        final DefaultCitation c = new DefaultCitation(title);
+        final DefaultCitation c = new DefaultCitation("European Petroleum Survey Group");
         c.setAlternateTitles(singleton(new SimpleInternationalString("EPSG")));
         c.setPresentationForms(singleton(PresentationForm.TABLE_DIGITAL));
-        c.getIdentifiers().add(new DefaultIdentifier("EPSG"));
-        c.getCitedResponsibleParties().add(p);
+        c.setIdentifiers(singleton(new DefaultIdentifier("EPSG")));
+        c.setCitedResponsibleParties(singleton(p));
         c.freeze();
         EPSG = c;
     }

Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/constraint/DefaultLegalConstraintsTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/constraint/DefaultLegalConstraintsTest.java?rev=1627546&r1=1627545&r2=1627546&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/constraint/DefaultLegalConstraintsTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/constraint/DefaultLegalConstraintsTest.java [UTF-8] Thu Sep 25 13:59:56 2014
@@ -27,6 +27,7 @@ import org.apache.sis.util.logging.Warni
 import org.apache.sis.test.XMLTestCase;
 import org.junit.Test;
 
+import static java.util.Collections.singleton;
 import static org.apache.sis.test.Assert.*;
 import static org.apache.sis.test.TestUtilities.getSingleton;
 
@@ -140,7 +141,7 @@ public final strictfp class DefaultLegal
                 "</gmd:MD_LegalConstraints>\n";
 
         final DefaultLegalConstraints c = new DefaultLegalConstraints();
-        c.getUseConstraints().add(Restriction.LICENCE);
+        c.setUseConstraints(singleton(Restriction.LICENCE));
         assertXmlEquals(xml, marshal(c), "xmlns:*");
         /*
          * Unmarshall and ensure that we got back the original LICENCE code, not a new "LICENSE" code.

Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultDataIdentificationTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultDataIdentificationTest.java?rev=1627546&r1=1627545&r2=1627546&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultDataIdentificationTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultDataIdentificationTest.java [UTF-8] Thu Sep 25 13:59:56 2014
@@ -29,6 +29,7 @@ import org.apache.sis.test.TestCase;
 import org.apache.sis.test.TestUtilities;
 import org.junit.Test;
 
+import static java.util.Collections.singleton;
 import static org.apache.sis.test.Assert.*;
 
 
@@ -62,8 +63,8 @@ public final strictfp class DefaultDataI
          *       └─Code……………………………………………………………………… NCEP/SST/Global_5x2p5deg/SST_Global_5x2p5deg_20050922_0000.nc
          */
         final DefaultCitation citation = new DefaultCitation("Sea Surface Temperature Analysis Model");
-        citation.getDates().add(new DefaultCitationDate(TestUtilities.date("2005-09-22 00:00:00"), DateType.CREATION));
-        citation.getIdentifiers().add(new DefaultIdentifier("SST_Global.nc"));
+        citation.setDates(singleton(new DefaultCitationDate(TestUtilities.date("2005-09-22 00:00:00"), DateType.CREATION)));
+        citation.setIdentifiers(singleton(new DefaultIdentifier("SST_Global.nc")));
         /*
          * Descriptive keywords
          *   ├─Keyword………………………………………………………………………… EARTH SCIENCE > Oceans > Ocean Temperature > Sea Surface Temperature
@@ -97,10 +98,10 @@ public final strictfp class DefaultDataI
          */
         final DefaultDataIdentification info = new DefaultDataIdentification(citation,
                 "NCEP SST Global 5.0 x 2.5 degree model data", null, null);
-        info.getSpatialRepresentationTypes().add(SpatialRepresentationType.GRID);
-        info.getDescriptiveKeywords().add(keywords);
-        info.getResourceConstraints().add(new DefaultConstraints("Freely available"));
-        info.getExtents().add(Extents.WORLD);
+        info.setSpatialRepresentationTypes(singleton(SpatialRepresentationType.GRID));
+        info.setDescriptiveKeywords(singleton(keywords));
+        info.setResourceConstraints(singleton(new DefaultConstraints("Freely available")));
+        info.setExtents(singleton(Extents.WORLD));
         return info;
     }
 

Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java?rev=1627546&r1=1627545&r2=1627546&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java [UTF-8] Thu Sep 25 13:59:56 2014
@@ -89,7 +89,8 @@ import org.junit.BeforeClass;
     org.apache.sis.io.wkt.ConventionTest.class,
     org.apache.sis.io.wkt.SymbolsTest.class,
     org.apache.sis.io.wkt.ColorsTest.class,
-    org.apache.sis.io.wkt.FormatterTest.class
+    org.apache.sis.io.wkt.FormatterTest.class,
+    org.apache.sis.io.wkt.WKTFormatTest.class
 })
 public final strictfp class MetadataTestSuite extends TestSuite {
     /**

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/CS_AxisDirection.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/CS_AxisDirection.java?rev=1627546&r1=1627545&r2=1627546&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/CS_AxisDirection.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/CS_AxisDirection.java [UTF-8] Thu Sep 25 13:59:56 2014
@@ -19,6 +19,8 @@ package org.apache.sis.internal.jaxb.ref
 import org.opengis.referencing.cs.AxisDirection;
 import org.apache.sis.internal.jaxb.gml.CodeListAdapter;
 
+import static org.apache.sis.internal.referencing.HardCoded.EPSG;
+
 
 /**
  * JAXB adapter for (un)marshalling of GeoAPI code list.
@@ -52,6 +54,6 @@ public final class CS_AxisDirection exte
      */
     @Override
     protected String getCodeSpace() {
-        return "EPSG";
+        return EPSG;
     }
 }

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/CS_RangeMeaning.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/CS_RangeMeaning.java?rev=1627546&r1=1627545&r2=1627546&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/CS_RangeMeaning.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/CS_RangeMeaning.java [UTF-8] Thu Sep 25 13:59:56 2014
@@ -19,6 +19,8 @@ package org.apache.sis.internal.jaxb.ref
 import org.opengis.referencing.cs.RangeMeaning;
 import org.apache.sis.internal.jaxb.gml.CodeListAdapter;
 
+import static org.apache.sis.internal.referencing.HardCoded.EPSG;
+
 
 /**
  * JAXB adapter for (un)marshalling of GeoAPI code list.
@@ -52,6 +54,6 @@ public final class CS_RangeMeaning exten
      */
     @Override
     protected String getCodeSpace() {
-        return "EPSG";
+        return EPSG;
     }
 }

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java?rev=1627546&r1=1627545&r2=1627546&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptor.java [UTF-8] Thu Sep 25 13:59:56 2014
@@ -331,18 +331,6 @@ public class DefaultParameterDescriptor<
     }
 
     /**
-     * Creates a new parameter value instance initialized with the {@linkplain #getDefaultValue() default value}.
-     * The {@linkplain DefaultParameterDescriptor parameter descriptor} for the created parameter value will be
-     * {@code this} object.
-     *
-     * @return A parameter initialized to the default value.
-     */
-    @Override
-    public ParameterValue<T> createValue() {
-        return new DefaultParameterValue<T>(this);
-    }
-
-    /**
      * Returns the class that describe the type of the parameter.
      *
      * @return The parameter value class.
@@ -455,6 +443,18 @@ public class DefaultParameterDescriptor<
     }
 
     /**
+     * Creates a new parameter value instance initialized with the {@linkplain #getDefaultValue() default value}.
+     * The {@linkplain DefaultParameterDescriptor parameter descriptor} for the created parameter value will be
+     * {@code this} object.
+     *
+     * @return A parameter initialized to the default value.
+     */
+    @Override
+    public ParameterValue<T> createValue() {
+        return new DefaultParameterValue<T>(this);
+    }
+
+    /**
      * Compares the specified object with this parameter for equality.
      * The strictness level is controlled by the second argument.
      * This method compares the following properties in every cases:

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java?rev=1627546&r1=1627545&r2=1627546&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/DefaultParameterDescriptorGroup.java [UTF-8] Thu Sep 25 13:59:56 2014
@@ -21,6 +21,7 @@ import java.util.Set;
 import java.util.List;
 import java.util.HashSet;
 import java.util.Collections;
+import org.opengis.parameter.ParameterDirection;
 import org.opengis.parameter.ParameterValueGroup;
 import org.opengis.parameter.ParameterDescriptorGroup;
 import org.opengis.parameter.GeneralParameterDescriptor;
@@ -263,16 +264,28 @@ public class DefaultParameterDescriptorG
     }
 
     /**
-     * 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.
+     * Returns an indication if all parameters in this group are inputs to the service, outputs or both.
+     * If this group contains parameters with different direction, then this method returns {@code null}.
      *
-     * @return A new parameter instance initialized to the default value.
+     * @return Indication if all parameters are inputs or outputs to the service, or {@code null} if undetermined.
      */
     @Override
-    public ParameterValueGroup createValue() {
-        return new DefaultParameterValueGroup(this);
+    public ParameterDirection getDirection() {
+        ParameterDirection dir = null;
+        for (final GeneralParameterDescriptor param : descriptors) {
+            final ParameterDirection c = param.getDirection();
+            if (c == null) {
+                return null;
+            }
+            if (c != dir) {
+                if (dir == null) {
+                    dir = c;
+                } else {
+                    return null;
+                }
+            }
+        }
+        return dir;
     }
 
     /**
@@ -323,6 +336,19 @@ public class DefaultParameterDescriptorG
     }
 
     /**
+     * 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);
+    }
+
+    /**
      * Compares the specified object with this parameter group for equality.
      *
      * @return {@inheritDoc}



Mime
View raw message