sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1727561 [1/5] - in /sis/branches/JDK6: ./ core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/ core/sis-metadata/src/main/java/org/apache/sis/io/wkt/ core/s...
Date Fri, 29 Jan 2016 12:23:11 GMT
Author: desruisseaux
Date: Fri Jan 29 12:23:09 2016
New Revision: 1727561

URL: http://svn.apache.org/viewvc?rev=1727561&view=rev
Log:
Merge MultiAuthoritiesFactory from the JDK7 branch.

Added:
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/RecordSchemaSIS.java
      - copied unchanged from r1727537, sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/RecordSchemaSIS.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/AuthorityFactories.java
      - copied, changed from r1727537, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/AuthorityFactories.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/EPSGFactoryFallback.java
      - copied, changed from r1727537, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/EPSGFactoryFallback.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/AuthorityFactoryIdentifier.java
      - copied, changed from r1727537, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/AuthorityFactoryIdentifier.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactory.java
      - copied, changed from r1727537, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactory.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/NoSuchAuthorityFactoryException.java
      - copied unchanged from r1727537, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/NoSuchAuthorityFactoryException.java
    sis/branches/JDK6/core/sis-referencing/src/main/resources/META-INF/services/org.opengis.referencing.crs.CRSAuthorityFactory
      - copied unchanged from r1727537, sis/branches/JDK7/core/sis-referencing/src/main/resources/META-INF/services/org.opengis.referencing.crs.CRSAuthorityFactory
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/AuthorityFactoriesTest.java
      - copied unchanged from r1727537, sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/AuthorityFactoriesTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/EPSGFactoryFallbackTest.java
      - copied, changed from r1727537, sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/EPSGFactoryFallbackTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/GeodeticDatumMock.java
      - copied unchanged from r1727537, sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/GeodeticDatumMock.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/PrimeMeridianMock.java
      - copied unchanged from r1727537, sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/PrimeMeridianMock.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/AuthorityFactoryMock.java
      - copied, changed from r1727537, sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/AuthorityFactoryMock.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/ConcurrentAuthorityFactoryTest.java
      - copied, changed from r1727537, sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/ConcurrentAuthorityFactoryTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactoryTest.java
      - copied unchanged from r1727537, sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/MultiAuthoritiesFactoryTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformFactoryMock.java
      - copied unchanged from r1727537, sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformFactoryMock.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/AbstractIterator.java
      - copied unchanged from r1727537, sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/AbstractIterator.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/LazySynchronizedIterator.java
      - copied unchanged from r1727537, sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/LazySynchronizedIterator.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/SetOfUnknownSize.java
      - copied unchanged from r1727537, sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/SetOfUnknownSize.java
    sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/xml/ReferenceResolverMock.java
      - copied unchanged from r1727537, sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/xml/ReferenceResolverMock.java
Removed:
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/mock/
    sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/mock/PrimeMeridianMock.java
    sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/mock/ReferenceResolverMock.java
Modified:
    sis/branches/JDK6/   (props changed)
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/LegacyPropertyAdapter.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/NameMeaning.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ServicesForUtility.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/TransformationAccuracy.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/package-info.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Element.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Transliterator.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ImmutableIdentifier.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/Extents.java
    sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/internal/metadata/NameMeaningTest.java
    sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/FormatterTest.java
    sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/TransliteratorTest.java
    sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/CitationsTest.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/Code.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/FranceGeocentricInterpolation.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/CRS.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/CommonCRS.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/IdentifiedObjects.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/StandardDefinitions.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultGeographicCRS.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DatumShiftGrid.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/AuthorityFactoryProxy.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/CommonAuthorityFactory.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/ConcurrentAuthorityFactory.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/FilteredCodes.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/GeodeticAuthorityFactory.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/IdentifiedObjectFinder.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGFactory.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MolodenskyFormula.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/OperationMethodSet.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/TransformSeparator.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/GeodeticObjectParserTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/CRSTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/CommonCRSTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/IdentifiedObjectsTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/StandardDefinitionsTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/BursaWolfParametersTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultEllipsoidTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultGeodeticDatumTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultPrimeMeridianTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/HardCodedDatum.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/TimeDependentBWPTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/AuthorityFactoryProxyTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/CommonAuthorityFactoryTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/sql/EPSGFactoryTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/EquirectangularTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MapProjectionTestCase.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/NoOp.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/PolarStereographicTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CoordinateDomain.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/InterpolatedGeocentricTransformTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/InterpolatedMolodenskyTransformTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MolodenskyTransformTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapAdapter.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/simple/CitationConstant.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/simple/SimpleIdentifier.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/AbstractMap.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/Citations.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/DefinitionURI.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/LazySet.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/util/MetadataServices.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/collection/DerivedSet.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties
    sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/jaxb/gco/PropertyTypeTest.java
    sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/util/CitationsTest.java
    sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/internal/util/DefinitionURITest.java
    sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/mock/CoordinateSystemAxisMock.java
    sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/mock/IdentifiedObjectMock.java
    sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/mock/VerticalCRSMock.java
    sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/test/mock/package-info.java
    sis/branches/JDK6/ide-project/NetBeans/build.xml
    sis/branches/JDK6/src/main/javadoc/stylesheet.css

Propchange: sis/branches/JDK6/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jan 29 12:23:09 2016
@@ -1,4 +1,4 @@
 /sis/branches/Android:1430670-1480699
-/sis/branches/JDK7:1394913-1724592
-/sis/branches/JDK8:1584960-1724583
+/sis/branches/JDK7:1394913-1727537
+/sis/branches/JDK8:1584960-1727534
 /sis/trunk:1394364-1508466,1519089-1519674

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/LegacyPropertyAdapter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/LegacyPropertyAdapter.java?rev=1727561&r1=1727560&r2=1727561&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/LegacyPropertyAdapter.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/LegacyPropertyAdapter.java [UTF-8] Fri Jan 29 12:23:09 2016
@@ -20,9 +20,9 @@ import java.util.AbstractCollection;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Iterator;
-import java.util.NoSuchElementException;
 import org.apache.sis.metadata.AbstractMetadata;
 import org.apache.sis.internal.jaxb.Context;
+import org.apache.sis.internal.util.AbstractIterator;
 import org.apache.sis.util.resources.Messages;
 import org.apache.sis.util.ArgumentChecks;
 
@@ -257,18 +257,13 @@ public abstract class LegacyPropertyAdap
     @Override
     public final Iterator<L> iterator() {
         final Iterator<N> it = elements.iterator();
-        return new Iterator<L>() {
+        return new AbstractIterator<L>() {
             /**
              * The container of the next value to return.
              */
             private N container;
 
             /**
-             * The next value to return, or {@code null} if not yet verified.
-             */
-            private L next;
-
-            /**
              * Returns {@code true} if there is more elements to iterate.
              * This method prefetches and stores the next value.
              */
@@ -289,22 +284,6 @@ public abstract class LegacyPropertyAdap
             }
 
             /**
-             * Returns the next element.
-             */
-            @Override
-            public final L next() {
-                L value = next;
-                if (value == null) {
-                    if (!hasNext()) {
-                        throw new NoSuchElementException();
-                    }
-                    value = next;
-                }
-                next = null;
-                return value;
-            }
-
-            /**
              * Removes the last element returned by {@link #next()}.
              */
             @Override

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/NameMeaning.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/NameMeaning.java?rev=1727561&r1=1727560&r2=1727561&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/NameMeaning.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/NameMeaning.java [UTF-8] Fri Jan 29 12:23:09 2016
@@ -19,14 +19,19 @@ package org.apache.sis.internal.metadata
 import java.util.Map;
 import java.util.HashMap;
 import java.util.Locale;
+import javax.measure.unit.Unit;
 import org.opengis.parameter.*;
 import org.opengis.referencing.*;
 import org.opengis.referencing.cs.*;
 import org.opengis.referencing.crs.*;
 import org.opengis.referencing.datum.*;
 import org.opengis.referencing.operation.*;
+import org.opengis.util.InternationalString;
+import org.opengis.metadata.citation.Citation;
 import org.apache.sis.util.Static;
 import org.apache.sis.internal.util.Constants;
+import org.apache.sis.internal.util.DefinitionURI;
+import org.apache.sis.metadata.iso.citation.Citations;
 
 
 /**
@@ -59,12 +64,21 @@ public final class NameMeaning extends S
         CoordinateOperation.class,
         OperationMethod.class,
         ParameterDescriptor.class,
-        ReferenceSystem.class
+        ReferenceSystem.class,
+        Unit.class
     };
 
     /**
      * The object types for instances of {@link #CLASSES}.
      * See {@link org.apache.sis.internal.util.DefinitionURI} javadoc for a list of object types in URN.
+     *
+     * <p>Types not yet listed (waiting to see if there is a use for them):</p>
+     *
+     * "group"              for  ParameterValueGroup.class;
+     * "verticalDatumType"  for  VerticalDatumType.class;
+     * "pixelInCell"        for  PixelInCell.class;
+     * "rangeMeaning"       for  RangeMeaning.class;
+     * "axisDirection"      for  AxisDirection.class;
      */
     private static final String[] TYPES = {
         "crs",
@@ -76,16 +90,26 @@ public final class NameMeaning extends S
         "coordinateOperation",
         "method",
         "parameter",
-        "referenceSystem"
+        "referenceSystem",
+        "uom"
     };
 
     /**
      * Naming authorities allowed to appear in {@code "urn:ogc:def:"}.
+     * This map serves two purposes:
      *
-     * <p><b>Note on the case:</b> The <cite>"Name type specification — definitions"</cite> document (OGC 09-048) writes
-     * authorities in upper cases, while <a href="http://www.opengis.net/def/auth/">http://www.opengis.net/def/auth/</a>
-     * use lower cases. Apache SIS uses upper cases for now.</p>
+     * <ul>
+     *   <li>Tell if a given authority is one of the authorities allowed by the OGC namespace.</li>
+     *   <li>Opportunistically fix the letter case.</li>
+     * </ul>
+     *
+     * <b>Note on the case:</b>
+     * <cite>"Name type specification — definitions"</cite> (OGC 09-048) writes authorities in upper cases,
+     * while <a href="http://www.opengis.net/def/auth/">http://www.opengis.net/def/auth/</a> uses lower cases.
+     * Apache SIS uses upper cases for now. The lower/upper case policy should be kept consistent with the policy
+     * used by {@link org.apache.sis.referencing.factory.MultiAuthoritiesFactory} for its keys.
      *
+     * @see org.apache.sis.referencing.factory.MultiAuthoritiesFactory
      * @see <a href="http://www.opengis.net/def/auth/">http://www.opengis.net/def/auth/</a>
      *
      * @since 0.7
@@ -116,20 +140,54 @@ public final class NameMeaning extends S
     }
 
     /**
-     * Returns the authority to format for the given code space, or {@code null} if there is no known authority
-     * in URN syntax for the given code space. The return value is used for fixing the Apache SIS policy regarding
-     * lower or upper cases (both conventions are used in different OGC resources).
-     *
-     * @param  codeSpace The code space (can be {@code null}).
-     * @return The authority to format in the URN, or {@code null} if none.
+     * Formats the given identifier using the {@code "ogc:urn:def:"} syntax with possible heuristic changes to
+     * the given values. This method delegates to {@link DefinitionURI#format(String, String, String, String)}
+     * after "fixing" the given values using some heuristic knowledge about the meaning of URN.
+     *
+     * @param  type      The object type.
+     * @param  authority The authority as one of the values documented in {@link DefinitionURI} javadoc.
+     * @param  version   The code version, or {@code null}. This is the only optional information.
+     * @param  code      The code.
+     * @return An identifier using the URN syntax, or {@code null} if a mandatory information is missing.
      *
      * @since 0.7
+     *
+     * @see DefinitionURI#format(String, String, String, String)
      */
-    public static String authority(String codeSpace) {
-        if (codeSpace != null) {
-            codeSpace = AUTHORITIES.get(codeSpace.toUpperCase(Locale.US));
+    public static String toURN(final Class<?> type, final String authority, String version, String code) {
+        if (type != null && authority != null && code != null) {
+            final String key = authority.toUpperCase(Locale.US);
+            String codeSpace = AUTHORITIES.get(key);
+            if (codeSpace == null) {
+                /*
+                 * If the given authority is not one of the authorities that we expected for the OGC namespace,
+                 * verify if we can related it to one of the specifications enumerated in the Citations class.
+                 * For example if the user gave us "OGP" as the authority, we will replace that by "IOGP" (the
+                 * new name for that organization).
+                 */
+                final Citation c = Citations.fromName(key);
+                codeSpace = org.apache.sis.internal.util.Citations.getCodeSpace(c);
+                if (AUTHORITIES.get(codeSpace) == null) {
+                    return null;            // Not an authority that we recognize for the OGC namespace.
+                }
+                version = getVersion(c);    // Unconditionally overwrite the user-specified version.
+                /*
+                 * If the above lines resulted in a chance of codespace, we may need to concatenate the authority
+                 * with the code for preserving information. The main use case is WMS codes like "CRS:84":
+                 *
+                 *   1) Citations.fromName("CRS") gave us Citations.WMS (version 1.3) as the authority.
+                 *   2) getCodeSpace(Citations.WMS) gave us "OGC", which is indeed the codespace used in URN.
+                 *   3) OGC Naming Authority – Procedures (OGC-09-046r2) said that "CRS:84" should be formatted
+                 *      as "urn:ogc:def:crs:OGC:1.3:CRS84". We already got the "OGC" and "1.3" parts with above
+                 *      steps, the last part is to replace "84" by "CRS84".
+                 */
+                if (!authority.equals(codeSpace) && !code.startsWith(authority)) {
+                    code = authority + code;    // Intentionally no ':' separator.
+                }
+            }
+            return DefinitionURI.format(toObjectType(type), codeSpace, version, code);
         }
-        return codeSpace;
+        return null;
     }
 
     /**
@@ -146,5 +204,26 @@ public final class NameMeaning extends S
             }
         }
         return null;
+    }
+
+    /**
+     * Returns the version of the namespace managed by the given authority.
+     * Current Apache SIS implementation searches this information in the {@link Citation#getEdition()} property.
+     * This approach is based on the assumption that the authority is some specification document or reference to
+     * a database, not an organization. However this policy may be revisited in any future SIS version.
+     *
+     * @param authority The authority from which to get a version, or {@code null}.
+     * @return The version, or {@code null} if none.
+     *
+     * @since 0.7
+     */
+    public static String getVersion(final Citation authority) {
+        if (authority != null) {
+            final InternationalString i18n = authority.getEdition();
+            if (i18n != null) {
+                return i18n.toString(Locale.US);
+            }
+        }
+        return null;
     }
 }

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ServicesForUtility.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ServicesForUtility.java?rev=1727561&r1=1727560&r2=1727561&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ServicesForUtility.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ServicesForUtility.java [UTF-8] Fri Jan 29 12:23:09 2016
@@ -16,12 +16,14 @@
  */
 package org.apache.sis.internal.metadata;
 
+import java.util.Arrays;
 import java.util.Collection;
+import org.opengis.metadata.Identifier;
 import org.opengis.metadata.citation.Role;
 import org.opengis.metadata.citation.Citation;
 import org.opengis.metadata.citation.PresentationForm;
 import org.opengis.metadata.citation.Responsibility;
-import org.apache.sis.internal.simple.SimpleCitation;
+import org.apache.sis.internal.simple.CitationConstant;
 import org.apache.sis.internal.util.Constants;
 import org.apache.sis.internal.util.MetadataServices;
 import org.apache.sis.metadata.iso.ImmutableIdentifier;
@@ -39,7 +41,7 @@ import static java.util.Collections.sing
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.6
- * @version 0.6
+ * @version 0.7
  * @module
  */
 public final class ServicesForUtility extends MetadataServices {
@@ -56,15 +58,9 @@ public final class ServicesForUtility ex
      * @return The requested citation, or {@code null} if there is no constant for the given name.
      */
     @Override
-    public Citation getCitationConstant(final String name) {
+    public CitationConstant getCitationConstant(final String name) {
         final Citation c = Citations.fromName(name);
-        /*
-         * The fact that the following line uses the citation class as a non-public criterion for identifying
-         * when the Citations.fromName(String) method found no match is documented in that Citations.fromName
-         * method body. If we do not rely anymore on this criterion, please update the Citations.fromName(…)
-         * comment accordingly.
-         */
-        return (c.getClass() != SimpleCitation.class) ? c : null;
+        return (c instanceof CitationConstant) ? (CitationConstant) c : null;
     }
 
     /**
@@ -86,9 +82,10 @@ public final class ServicesForUtility ex
         String           code                  = null;
         String           codeSpace             = null;
         String           version               = null;
+        Identifier[]     alternateIdentifiers  = null;
         CharSequence     citedResponsibleParty = null;
         PresentationForm presentationForm      = null;
-        Citation         copyFrom              = null;  // Copy citedResponsibleParty from that citation.
+        Citation[]       copyFrom              = null;      // Copy citedResponsibleParty from those citations.
         { // This is a switch(String) on the JDK7 branch
             if (key.equals("ISO 19115-1")) {
                 title     = "Geographic Information — Metadata Part 1: Fundamentals";
@@ -104,13 +101,30 @@ public final class ServicesForUtility ex
                 code      = "19115-2";
                 codeSpace = "ISO";
                 version   = "2009(E)";
-                copyFrom  = Citations.ISO_19115.get(0);
+                copyFrom  = new Citation[] {Citations.ISO_19115.get(0)};
+                presentationForm = PresentationForm.DOCUMENT_DIGITAL;
+            } else if (key.equals("WMS")) {
+                title                = "Web Map Server";                                      // OGC title
+                alternateTitle       = "Geographic Information — Web map server interface";   // ISO title
+                alternateIdentifiers = new Identifier[] {
+                    new ImmutableIdentifier(null, "OGC", "06-042",  null, null),
+                    new ImmutableIdentifier(null, "ISO", "19128", "2005", null)
+                };
+                edition          = "1.3";
+                code             = "WMS";
+                codeSpace        = "OGC";
+                copyFrom         = new Citation[] {Citations.OGC, Citations.ISO_19115.get(0)};
                 presentationForm = PresentationForm.DOCUMENT_DIGITAL;
             } else if (key.equals(Constants.OGC)) {
-                title     = "Identifier in OGC namespace";
-                code      = "OGC";
+                title = "Identifiers in OGC namespace";
+                code = Constants.OGC;
                 citedResponsibleParty = "Open Geospatial Consortium";
                 presentationForm = PresentationForm.DOCUMENT_DIGITAL;
+            } else if (key.equals(Constants.IOGP)) {                    // Not in public API (see Citations.IOGP javadoc)
+                title = "Using the EPSG Geodetic Parameter Dataset";    // Geomatics Guidance Note number 7, part 1
+                code = Constants.IOGP;
+                copyFrom = new Citation[] {Citations.EPSG};
+                presentationForm = PresentationForm.DOCUMENT_DIGITAL;
             } else if (key.equals(Constants.EPSG)) {
                 title     = "EPSG Geodetic Parameter Dataset";
                 code      = Constants.EPSG;
@@ -120,6 +134,9 @@ public final class ServicesForUtility ex
                 /*
                  * More complete information is provided as an ISO 19115 structure
                  * in EPSG Surveying and Positioning Guidance Note Number 7, part 1.
+                 * EPSGDataAccess.getAuthority() also add more information.
+                 * After we moved the content of this citation in a database,
+                 * EPSGDataAccess.getAuthority() should use this citation as a template.
                  */
             } else if (key.equals(Constants.SIS)) {
                 title = "Apache Spatial Information System";
@@ -147,19 +164,26 @@ public final class ServicesForUtility ex
         if (alternateTitle        != null) c.setAlternateTitles(singleton(Types.toInternationalString(alternateTitle)));
         if (edition               != null) c.setEdition(Types.toInternationalString(edition));
         if (code                  != null) c.setIdentifiers(singleton(new ImmutableIdentifier(null, codeSpace, code, version, null)));
-        if (copyFrom              != null) c.setCitedResponsibleParties(copyFrom.getCitedResponsibleParties());
         if (presentationForm      != null) c.setPresentationForms(singleton(presentationForm));
         if (citedResponsibleParty != null) {
-            final DefaultOrganisation organisation = new DefaultOrganisation();
-            organisation.setName(Types.toInternationalString(citedResponsibleParty));
-            final DefaultResponsibility r = new DefaultResponsibility(Role.PRINCIPAL_INVESTIGATOR, null, organisation);
-            final Collection<Responsibility> parties = c.getCitedResponsibleParties();
-            if (parties != null) {
-                parties.add(r);
-            } else {
-                c.setCitedResponsibleParties(singleton(r));
+            c.setCitedResponsibleParties(singleton(new DefaultResponsibility(Role.PRINCIPAL_INVESTIGATOR, null,
+                    new DefaultOrganisation(citedResponsibleParty, null, null, null))));
+        }
+        if (copyFrom != null) {
+            for (final Citation other : copyFrom) {
+                final Collection<? extends Responsibility> parties = other.getCitedResponsibleParties();
+                final Collection<Responsibility> current = c.getCitedResponsibleParties();
+                if (current != null) {
+                    current.addAll(parties);
+                } else {
+                    c.setCitedResponsibleParties(parties);
+                }
             }
         }
+        if (alternateIdentifiers != null) {
+            // getIdentifiers() should not return null at this point.
+            c.getIdentifiers().addAll(Arrays.asList(alternateIdentifiers));
+        }
         c.freeze();
         return c;
     }

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/TransformationAccuracy.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/TransformationAccuracy.java?rev=1727561&r1=1727560&r2=1727561&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/TransformationAccuracy.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/TransformationAccuracy.java [UTF-8] Fri Jan 29 12:23:09 2016
@@ -22,11 +22,9 @@ import org.opengis.util.RecordType;
 import org.opengis.util.InternationalString;
 import org.opengis.metadata.quality.PositionalAccuracy;
 import org.opengis.metadata.quality.EvaluationMethodType;
-import org.apache.sis.internal.util.Constants;
 import org.apache.sis.metadata.iso.quality.DefaultQuantitativeResult;
 import org.apache.sis.metadata.iso.quality.DefaultAbsoluteExternalPositionalAccuracy;
 import org.apache.sis.util.collection.WeakValueHashMap;
-import org.apache.sis.util.iso.DefaultRecordSchema;
 import org.apache.sis.util.iso.DefaultRecord;
 import org.apache.sis.util.resources.Vocabulary;
 import org.apache.sis.util.Static;
@@ -50,12 +48,9 @@ public final class TransformationAccurac
     /**
      * The type of record instances which will hold coordinate transformation accuracy values.
      */
-    private static final RecordType TYPE;
-    static {
-        final DefaultRecordSchema schema = new DefaultRecordSchema(null, null, Constants.SIS);
-        TYPE = schema.createRecordType("Real", Collections.<CharSequence,Class<?>>singletonMap(
-                Vocabulary.formatInternational(Vocabulary.Keys.Value), Double.class));
-    }
+    private static final RecordType TYPE = RecordSchemaSIS.INSTANCE.createRecordType("Real",
+            Collections.<CharSequence,Class<?>>singletonMap(
+                    Vocabulary.formatInternational(Vocabulary.Keys.Value), Double.class));
 
     /**
      * Cache the positional accuracies. Most coordinate operation use a small set of accuracy values.

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java?rev=1727561&r1=1727560&r2=1727561&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java [UTF-8] Fri Jan 29 12:23:09 2016
@@ -118,11 +118,14 @@ public abstract class Initializer {
      */
     public static synchronized DataSource getDataSource() throws Exception {
         if (source == null) {
-            if (NamingManager.hasInitialContextFactoryBuilder()) try {
+            if (hasJNDI()) try {
                 final Context env = (Context) InitialContext.doLookup("java:comp/env");
                 return source = (DataSource) env.lookup("jdbc/" + DATABASE);
             } catch (NameNotFoundException e) {
-                Logging.unexpectedException(Logging.getLogger(Loggers.SQL), Initializer.class, "getDataSource", e);
+                final LogRecord record = Messages.getResources(null).getLogRecord(
+                        Level.CONFIG, Messages.Keys.JNDINotSpecified_1, "jdbc/" + DATABASE);
+                record.setLoggerName(Loggers.SQL);
+                Logging.log(Initializer.class, "getDataSource", record);
             }
             final Path dir = DataDirectory.DATABASES.getDirectory();
             if (dir != null) {
@@ -135,6 +138,16 @@ public abstract class Initializer {
     }
 
     /**
+     * Returns {@code true} if SIS will try to fetch the {@link DataSource} from JNDI.
+     *
+     * @return {@code true} if a JNDI environment seems to be present.
+     */
+    public static boolean hasJNDI() {
+        return NamingManager.hasInitialContextFactoryBuilder() ||
+               System.getProperty(Context.INITIAL_CONTEXT_FACTORY) != null;
+    }
+
+    /**
      * Returns a message for unspecified data source. The message will depend on whether a JNDI context exists or not.
      * This message can be used for constructing an exception when {@link #getDataSource()} returned {@code null}.
      *
@@ -144,7 +157,7 @@ public abstract class Initializer {
     public static String unspecified(final Locale locale) {
         final short key;
         final String value;
-        if (NamingManager.hasInitialContextFactoryBuilder()) {
+        if (hasJNDI()) {
             key = Messages.Keys.JNDINotSpecified_1;
             value = "jdbc/" + DATABASE;
         } else {

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/package-info.java?rev=1727561&r1=1727560&r2=1727561&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/package-info.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/package-info.java [UTF-8] Fri Jan 29 12:23:09 2016
@@ -29,7 +29,7 @@
  * The method Javadoc describes the steps for fetching that data source.
  * When used in a JavaEE container, the data source can be configured as below:
  *
- * <ol>
+ * <ol class="verbose">
  *   <li><p>Make the JDBC driver available to the web container and its applications. On Tomcat, this
  *     is accomplished by installing the driver's JAR files into the {@code $CATALINA_HOME/lib} directory
  *     (<a href="https://tomcat.apache.org/tomcat-9.0-doc/jndi-resources-howto.html">source</a>).</p></li>

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Element.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Element.java?rev=1727561&r1=1727560&r2=1727561&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Element.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Element.java [UTF-8] Fri Jan 29 12:23:09 2016
@@ -151,14 +151,15 @@ final class Element implements Serializa
     /**
      * Constructs a new {@code Element}.
      * The {@code sharedValues} argument have two meanings:
-     * <ul>
-     *   <li><p>If {@code null}, then the caller is parsing a WKT string. The {@code Element}
-     *     must be mutable because its content will be emptied as the parsing progress.</p></li>
      *
-     *   <li><p>If non-null, then the caller is storing a WKT fragment. We create the elements but the caller will
+     * <ul class="verbose">
+     *   <li>If {@code null}, then the caller is parsing a WKT string. The {@code Element}
+     *     must be mutable because its content will be emptied as the parsing progress.</li>
+     *
+     *   <li>If non-null, then the caller is storing a WKT fragment. We create the elements but the caller will
      *     not parse them immediately. The {@code Element} should be immutable because the fragment will potentially
      *     be reused many time. Since the fragment may be stored for a long time, the {@code sharedValues} map will
-     *     be used for sharing unique instance of each value if possible.</p></li>
+     *     be used for sharing unique instance of each value if possible.</li>
      * </ul>
      *
      * @param text         The text to parse.

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java?rev=1727561&r1=1727560&r2=1727561&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java [UTF-8] Fri Jan 29 12:23:09 2016
@@ -1471,6 +1471,7 @@ public class Formatter implements Locali
                     throw new IllegalStateException();
                 }
             }
+            hasContextualUnit &= ~1;
         } else if (units.put(previous.toSI(), previous) != unit) {
             /*
              * The unit that we replaced was not the expected one. Probably the user has invoked

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Transliterator.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Transliterator.java?rev=1727561&r1=1727560&r2=1727561&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Transliterator.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Transliterator.java [UTF-8] Fri Jan 29 12:23:09 2016
@@ -325,41 +325,46 @@ public abstract class Transliterator imp
      * @see org.apache.sis.referencing.cs.DefaultCoordinateSystemAxis#formatTo(Formatter)
      */
     public String toLatinAbbreviation(final CoordinateSystem cs, final AxisDirection direction, String abbreviation) {
-        if (abbreviation != null && !abbreviation.isEmpty() && abbreviation.length() <= 2) {
-            switch (abbreviation.charAt(0)) {
-                /*
-                 * ISO 19162:2015 §7.5.3 recommendations:
-                 *
-                 *   a) For PolarCS using Greek letter θ for direction, the letter ‘U’ should be used in WKT.
-                 *   b) For SphericalCS using φ and θ, the letter ‘U’ and ‘V’ respectively should be used in WKT.
-                 */
-                case 'θ': {
-                    if  (cs instanceof SphericalCS) abbreviation ="V";
-                    else if (cs instanceof PolarCS) abbreviation ="U";
-                    break;
-                }
-                /*
-                 * ISO 19162:2015 §7.5.3 requirement (ii) and recommendation (b):
-                 *
-                 *  ii) Greek letters φ and λ for geodetic latitude and longitude must be replaced by Latin char.
-                 *   b) For SphericalCS using φ and θ, the letter ‘U’ and ‘V’ respectively should be used in WKT.
-                 *
-                 * Note that some SphericalCS may use φ′ or φc for distinguishing from geodetic latitude φ.
-                 */
-                case 'φ': {
-                    if (cs instanceof SphericalCS) {
-                        abbreviation = "U";
-                    } else if (cs instanceof EllipsoidalCS) {
-                        abbreviation = "B";    // From German "Breite", used in academic texts worldwide.
+        if (abbreviation != null && !abbreviation.isEmpty()) {
+            if (abbreviation.length() <= 2) {
+                switch (abbreviation.charAt(0)) {
+                    /*
+                     * ISO 19162:2015 §7.5.3 recommendations:
+                     *
+                     *   a) For PolarCS using Greek letter θ for direction, the letter ‘U’ should be used in WKT.
+                     *   b) For SphericalCS using φ and θ, the letter ‘U’ and ‘V’ respectively should be used in WKT.
+                     */
+                    case 'θ': {
+                        if  (cs instanceof SphericalCS) abbreviation ="V";
+                        else if (cs instanceof PolarCS) abbreviation ="U";
+                        break;
                     }
-                    break;
-                }
-                case 'λ': {
-                    if (cs instanceof EllipsoidalCS) {
-                        abbreviation = "L";    // From German "Länge", used in academic texts worldwide.
+                    /*
+                     * ISO 19162:2015 §7.5.3 requirement (ii) and recommendation (b):
+                     *
+                     *  ii) Greek letters φ and λ for geodetic latitude and longitude must be replaced by Latin char.
+                     *   b) For SphericalCS using φ and θ, the letter ‘U’ and ‘V’ respectively should be used in WKT.
+                     *
+                     * Note that some SphericalCS may use φ′ or φc for distinguishing from geodetic latitude φ.
+                     */
+                    case 'φ': {
+                        if (cs instanceof SphericalCS) {
+                            abbreviation = "U";
+                        } else if (cs instanceof EllipsoidalCS) {
+                            abbreviation = "B";    // From German "Breite", used in academic texts worldwide.
+                        }
+                        break;
+                    }
+                    case 'λ': {
+                        if (cs instanceof EllipsoidalCS) {
+                            abbreviation = "L";    // From German "Länge", used in academic texts worldwide.
+                        }
+                        break;
                     }
-                    break;
                 }
+            } else {
+                if      (abbreviation.equalsIgnoreCase("Lat" )) abbreviation = "B";
+                else if (abbreviation.equalsIgnoreCase("Long")) abbreviation = "L";
             }
         }
         return abbreviation;

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java?rev=1727561&r1=1727560&r2=1727561&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultIdentifier.java [UTF-8] Fri Jan 29 12:23:09 2016
@@ -50,7 +50,10 @@ import org.apache.sis.internal.util.Cita
  * one except for the {@code "MD_"} prefix. Example:
  *
  * {@preformat xml
- *   <gmd:MD_Identifier>
+ *   <gmd:MD_Identifier
+ *     <gmd:code>
+ *       <gco:CharacterString>4326</gco:CharacterString>
+ *     </gmd:code>
  *     <gmd:authority>
  *       <gmd:CI_Citation>
  *         <gmd:title>
@@ -58,9 +61,6 @@ import org.apache.sis.internal.util.Cita
  *         </gmd:title>
  *       </gmd:CI_Citation>
  *     </gmd:authority>
- *     <gmd:code>
- *       <gco:CharacterString>4326</gco:CharacterString>
- *     </gmd:code>
  *   </gmd:MD_Identifier>
  * }
  *
@@ -81,6 +81,7 @@ import org.apache.sis.internal.util.Cita
  * @module
  *
  * @see ImmutableIdentifier
+ * @see org.apache.sis.referencing.IdentifiedObjects#toURN(Class, Identifier)
  */
 @XmlType(name = "MD_Identifier_Type", propOrder = {
     "authority",
@@ -94,35 +95,43 @@ public class DefaultIdentifier extends I
     private static final long serialVersionUID = -23375776954553866L;
 
     /**
+     * Person or party responsible for maintenance of the namespace.
+     *
+     * @see #getAuthority()
+     */
+    private Citation authority;
+
+    /**
      * Alphanumeric value identifying an instance in the namespace.
+     *
+     * @see #getCode()
      */
     private String code;
 
     /**
      * Identifier or namespace in which the code is valid.
+     *
+     * @see #getCodeSpace()
      */
     private String codeSpace;
 
     /**
-     * Identifier of the version of the associated code space or code, as specified
-     * by the code space or code authority. This version is included only when the
-     * {@linkplain #getCode code} uses versions. When appropriate, the edition is
-     * identified by the effective date, coded using ISO 8601 date format.
+     * Version identifier for the namespace, as specified by the code authority.
+     * This version is included only when the {@linkplain #getCode code} uses versions.
+     * When appropriate, the edition is identified by the effective date, coded using ISO 8601 date format.
+     *
+     * @see #getVersion()
      */
     private String version;
 
     /**
      * Natural language description of the meaning of the code value.
+     *
+     * @see #getDescription()
      */
     private InternationalString description;
 
     /**
-     * Organization or party responsible for definition and maintenance of the
-     * {@linkplain #getCode code}.
-     */
-    private Citation authority;
-
-    /**
      * Construct an initially empty identifier.
      */
     public DefaultIdentifier() {
@@ -155,10 +164,8 @@ public class DefaultIdentifier extends I
      *       {@linkplain org.apache.sis.util.CharSequences#isUnicodeIdentifier(CharSequence) unicode identifier}.</li>
      * </ol>
      *
-     * @param authority The organization or party responsible for definition and maintenance
-     *                  of the code, or {@code null} if none.
-     * @param code      The alphanumeric value identifying an instance in the namespace,
-     *                  or {@code null} if none.
+     * @param authority The the person or party responsible for maintenance of the namespace, or {@code null} if none.
+     * @param code      The alphanumeric value identifying an instance in the namespace, or {@code null} if none.
      *
      * @see org.apache.sis.metadata.iso.citation.Citations#getUnicodeIdentifier(Citation)
      */
@@ -214,6 +221,29 @@ public class DefaultIdentifier extends I
     }
 
     /**
+     * Returns the person or party responsible for maintenance of the namespace.
+     * The organization's abbreviation is often the same than this identifier
+     * {@linkplain #getCodeSpace() code space}, but not necessarily.
+     *
+     * @return Person or party responsible for maintenance of the namespace, or {@code null} if not available.
+     */
+    @Override
+    @XmlElement(name = "authority")
+    public Citation getAuthority() {
+        return authority;
+    }
+
+    /**
+     * Sets the person or party responsible for maintenance of the namespace.
+     *
+     * @param newValue The new authority.
+     */
+    public void setAuthority(final Citation newValue) {
+        checkWritePermission();
+        authority = newValue;
+    }
+
+    /**
      * Returns the alphanumeric value identifying an instance in the namespace.
      * The code is optionally from a controlled list or pattern.
      *
@@ -232,6 +262,7 @@ public class DefaultIdentifier extends I
 
     /**
      * Sets the alphanumeric value identifying an instance in the namespace.
+     * Should avoid characters that are not legal in URLs.
      *
      * @param newValue The new code, or {@code null}.
      */
@@ -246,7 +277,7 @@ public class DefaultIdentifier extends I
      *
      * <div class="note"><b>Example:</b> {@code "EPSG"}.</div>
      *
-     * @return The identifier code space, or {@code null} if none.
+     * @return The identifier or namespace in which the code is valid, or {@code null} if none.
      *
      * @since 0.5
      */
@@ -268,14 +299,13 @@ public class DefaultIdentifier extends I
     }
 
     /**
-     * Identifier of the version of the associated code, as specified by the code space or
-     * code authority. This version is included only when the {@linkplain #getCode() code}
-     * uses versions. When appropriate, the edition is identified by the effective date,
-     * coded using ISO 8601 date format.
+     * Returns the version identifier for the namespace, as specified by the code authority.
+     * This version is included only when the {@linkplain #getCode() code} uses versions.
+     * When appropriate, the edition is identified by the effective date, coded using ISO 8601 date format.
      *
      * <div class="note"><b>Example:</b> the version of the underlying EPSG database.</div>
      *
-     * @return The version, or {@code null} if not available.
+     * @return The version identifier for the namespace, or {@code null} if none.
      */
     @Override
     public String getVersion() {
@@ -283,9 +313,9 @@ public class DefaultIdentifier extends I
     }
 
     /**
-     * Sets an identifier of the version of the associated code.
+     * Sets the version identifier for the namespace.
      *
-     * @param newValue The new version.
+     * @param newValue The new version, or {@code null} if none.
      */
     public void setVersion(final String newValue) {
         checkWritePermission();
@@ -317,27 +347,4 @@ public class DefaultIdentifier extends I
         checkWritePermission();
         description = newValue;
     }
-
-    /**
-     * Organization or party responsible for definition and maintenance of the {@linkplain #getCode() code}.
-     * The organization's abbreviation is often the same than this identifier {@linkplain #getCodeSpace() code space},
-     * but not necessarily.
-     *
-     * @return The authority, or {@code null} if not available.
-     */
-    @Override
-    @XmlElement(name = "authority")
-    public Citation getAuthority() {
-        return authority;
-    }
-
-    /**
-     * Sets the organization or party responsible for definition and maintenance of the {@linkplain #getCode() code}.
-     *
-     * @param newValue The new authority.
-     */
-    public void setAuthority(final Citation newValue) {
-        checkWritePermission();
-        authority = newValue;
-    }
 }

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=1727561&r1=1727560&r2=1727561&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] Fri Jan 29 12:23:09 2016
@@ -29,7 +29,6 @@ import org.opengis.util.InternationalStr
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.util.iso.Types;
 import org.apache.sis.metadata.iso.citation.Citations;
-import org.apache.sis.internal.util.DefinitionURI;
 import org.apache.sis.internal.metadata.NameMeaning;
 import org.apache.sis.internal.metadata.WKTKeywords;
 import org.apache.sis.io.wkt.FormattableObject;
@@ -107,9 +106,6 @@ import org.apache.sis.internal.jdk7.Obje
  *
  * {@preformat xml
  *   <gmd:RS_Identifier>
- *     <gmd:code>
- *       <gco:CharacterString>4326</gco:CharacterString>
- *     </gmd:code>
  *     <gmd:authority>
  *       <gmd:CI_Citation>
  *         <gmd:title>
@@ -117,6 +113,9 @@ import org.apache.sis.internal.jdk7.Obje
  *         </gmd:title>
  *       </gmd:CI_Citation>
  *     </gmd:authority>
+ *     <gmd:code>
+ *       <gco:CharacterString>4326</gco:CharacterString>
+ *     </gmd:code>
  *   </gmd:RS_Identifier>
  * }
  * </li></ul>
@@ -127,6 +126,7 @@ import org.apache.sis.internal.jdk7.Obje
  * @module
  *
  * @see DefaultIdentifier
+ * @see org.apache.sis.referencing.IdentifiedObjects#toURN(Class, Identifier)
  */
 @XmlType(name = "RS_Identifier_Type", propOrder = {
     "authority",
@@ -142,37 +142,34 @@ public class ImmutableIdentifier extends
     private static final long serialVersionUID = -7681717592582493409L;
 
     /**
-     * Identifier code or name, optionally from a controlled list or pattern defined by a code space.
+     * The person or party responsible for maintenance of the namespace, or {@code null} if not available.
      *
-     * @see #getCode()
+     * @see #getAuthority()
      */
     @XmlElement(required = true)
-    private final String code;
+    private final Citation authority;
 
     /**
-     * Name or identifier of the person or organization responsible for namespace, or
-     * {@code null} if not available. This is often an abbreviation of the authority name.
+     * Alphanumeric value identifying an instance in the namespace.
      *
-     * @see #getCodeSpace()
+     * @see #getCode()
      */
     @XmlElement(required = true)
-    private final String codeSpace;
+    private final String code;
 
     /**
-     * Organization or party responsible for definition and maintenance of the code space or code,
-     * or {@code null} if not available.
+     * Identifier or namespace in which the code is valid, or {@code null} if not available.
+     * This is often an abbreviation of the authority name.
      *
-     * @see #getAuthority()
+     * @see #getCodeSpace()
      */
     @XmlElement(required = true)
-    private final Citation authority;
+    private final String codeSpace;
 
     /**
-     * Identifier of the version of the associated code space or code as specified
-     * by the code space or code authority, or {@code null} if not available. This
-     * version is included only when the {@linkplain #getCode() code} uses versions.
-     * When appropriate, the edition is identified by the effective date, coded using
-     * ISO 8601 date format.
+     * Version identifier for the namespace, as specified by the code authority.
+     * This version is included only when the {@linkplain #getCode code} uses versions.
+     * When appropriate, the edition is identified by the effective date, coded using ISO 8601 date format.
      *
      * @see #getVersion()
      */
@@ -204,14 +201,12 @@ public class ImmutableIdentifier extends
      * Creates a new identifier from the specified code and authority.
      *
      * @param authority
-     *          Organization or party responsible for definition and maintenance of the code
-     *          space or code, or {@code null} if not available.
+     *          The person or party responsible for maintenance of the namespace, or {@code null} if not available.
      * @param codeSpace
-     *          Name or identifier of the person or organization responsible for namespace, or
-     *          {@code null} if not available. This is often an abbreviation of the authority name.
+     *          Identifier or namespace in which the code is valid, or {@code null} if not available.
+     *          This is often an abbreviation of the authority name.
      * @param code
-     *          Identifier code or name, optionally from a controlled list or pattern defined by
-     *          a code space. The code can not be null.
+     *          Alphanumeric value identifying an instance in the namespace. The code can not be null.
      */
     public ImmutableIdentifier(final Citation authority, final String codeSpace, final String code) {
         this(authority, codeSpace, code, null, null);
@@ -222,17 +217,14 @@ public class ImmutableIdentifier extends
      * with an optional version number and description.
      *
      * @param authority
-     *          Organization or party responsible for definition and maintenance of the code
-     *          space or code, or {@code null} if not available.
+     *          The person or party responsible for maintenance of the namespace, or {@code null} if not available.
      * @param codeSpace
-     *          Name or identifier of the person or organization responsible for namespace, or
-     *          {@code null} if not available. This is often an abbreviation of the authority name.
+     *          Identifier or namespace in which the code is valid, or {@code null} if not available.
+     *          This is often an abbreviation of the authority name.
      * @param code
-     *          Identifier code or name, optionally from a controlled list or pattern defined by
-     *          a code space. The code can not be null.
+     *          Alphanumeric value identifying an instance in the namespace. The code can not be null.
      * @param version
-     *          The version of the associated code space or code as specified by the code authority,
-     *          or {@code null} if none.
+     *          The version identifier for the namespace as specified by the code authority, or {@code null} if none.
      * @param description
      *          Natural language description of the meaning of the code value, or {@code null} if none.
      */
@@ -330,8 +322,8 @@ public class ImmutableIdentifier extends
         value = properties.get(CODESPACE_KEY);
         if (value == null) {
             codeSpace = org.apache.sis.internal.util.Citations.getCodeSpace(authority);
-        } else if (value instanceof CharSequence) {
-            codeSpace = trimWhitespaces((CharSequence) value).toString();
+        } else if (value instanceof String) {
+            codeSpace = trimWhitespaces((String) value);
         } else {
             throw illegalPropertyType(properties, CODESPACE_KEY, value);
         }
@@ -385,11 +377,23 @@ public class ImmutableIdentifier extends
     }
 
     /**
-     * Identifier code or name, optionally from a controlled list or pattern.
+     * The person or party responsible for maintenance of the namespace.
+     * The organization's abbreviation is often the same than this identifier {@linkplain #getCodeSpace() code space},
+     * but not necessarily.
+     *
+     * @return The authority, or {@code null} if not available.
+     */
+    @Override
+    public Citation getAuthority() {
+        return authority;
+    }
+
+    /**
+     * Alphanumeric value identifying an instance in the namespace.
      *
      * <div class="note"><b>Example:</b> {@code "4326"}.</div>
      *
-     * @return The code, never {@code null}.
+     * @return Value identifying an instance in the namespace (never {@code null}).
      *
      * @see org.apache.sis.referencing.NamedIdentifier#tip()
      */
@@ -399,12 +403,12 @@ public class ImmutableIdentifier extends
     }
 
     /**
-     * Name or identifier of the person or organization responsible for namespace.
+     * Identifier or namespace in which the code is valid.
      * This is often the {@linkplain #getAuthority() authority}'s abbreviation, but not necessarily.
      *
      * <div class="note"><b>Example:</b> {@code "EPSG"}.</div>
      *
-     * @return The code space, or {@code null} if not available.
+     * @return Identifier or namespace in which the code is valid, or {@code null} if not available.
      *
      * @see org.apache.sis.referencing.NamedIdentifier#head()
      * @see org.apache.sis.referencing.NamedIdentifier#scope()
@@ -415,25 +419,13 @@ public class ImmutableIdentifier extends
     }
 
     /**
-     * Organization or party responsible for definition and maintenance of the {@linkplain #getCode() code}.
-     * The organization's abbreviation is often the same than this identifier {@linkplain #getCodeSpace() code space},
-     * but not necessarily.
-     *
-     * @return The authority, or {@code null} if not available.
-     */
-    @Override
-    public Citation getAuthority() {
-        return authority;
-    }
-
-    /**
-     * Identifier of the version of the associated code space or code, as specified by the code authority.
-     * This version is included only when the {@linkplain #getCode() code} uses versions. When appropriate,
-     * the edition is identified by the effective date, coded using ISO 8601 date format.
+     * The version identifier for the namespace, as specified by the code authority.
+     * This version is included only when the {@linkplain #getCode() code} uses versions.
+     * When appropriate, the edition is identified by the effective date, coded using ISO 8601 date format.
      *
      * <div class="note"><b>Example:</b> the version of the underlying EPSG database.</div>
      *
-     * @return The version, or {@code null} if not available.
+     * @return The version identifier for the namespace, or {@code null} if none.
      */
     @Override
     public String getVersion() {
@@ -557,12 +549,14 @@ public class ImmutableIdentifier extends
                      * Other conventions format only for the ID[…] of root element.
                      */
                     if (isRoot && enclosing != null && convention != Convention.INTERNAL) {
-                        final String auth = NameMeaning.authority(cs);
-                        if (auth != null) {
-                            final String type = NameMeaning.toObjectType(enclosing.getClass());
-                            if (type != null) {
-                                formatter.append(new URI(type, auth, version, code));
-                            }
+                        final String urn = NameMeaning.toURN(enclosing.getClass(), cs, version, code);
+                        if (urn != null) {
+                            formatter.append(new FormattableObject() {
+                                @Override protected String formatTo(final Formatter formatter) {
+                                    formatter.append(urn, null);
+                                    return WKTKeywords.URI;
+                                }
+                            });
                         }
                     }
                 }
@@ -611,37 +605,6 @@ public class ImmutableIdentifier extends
         }
     }
 
-    /**
-     * The {@code URI[…]} element inside an {@code ID[…]}.
-     */
-    private static final class URI extends FormattableObject {
-        /** The components of the URI to format. */
-        private final String type, codeSpace, version, code;
-
-        /** Creates a new URI with the given components. */
-        URI(final String type, final String codeSpace, final String version, final String code) {
-            this.type      = type;
-            this.codeSpace = codeSpace;
-            this.version   = version;
-            this.code      = code;
-        }
-
-        /** Formats the URI. */
-        @Override
-        protected String formatTo(final Formatter formatter) {
-            final StringBuilder buffer = new StringBuilder(DefinitionURI.PREFIX)
-                    .append(DefinitionURI.SEPARATOR).append(type)
-                    .append(DefinitionURI.SEPARATOR).append(codeSpace)
-                    .append(DefinitionURI.SEPARATOR);
-            if (version != null) {
-                buffer.append(version);
-            }
-            buffer.append(DefinitionURI.SEPARATOR).append(code);
-            formatter.append(buffer.toString(), null);
-            return WKTKeywords.URI;
-        }
-    }
-
 
 
 

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java?rev=1727561&r1=1727560&r2=1727561&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java [UTF-8] Fri Jan 29 12:23:09 2016
@@ -70,7 +70,7 @@ import static org.apache.sis.internal.ut
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.3
- * @version 0.6
+ * @version 0.7
  * @module
  */
 public final class Citations extends Static {
@@ -115,11 +115,19 @@ public final class Citations extends Sta
      * This organization is responsible for maintainance of {@link #EPSG} database.
      *
      * <p>We do not expose this citation in public API because it is an organization rather than a reference
-     * to a document or a database (see SIS-200). However we need it as the authority of {@link #EPSG}.</p>
+     * to a document or a database (see SIS-200). For now we keep this citation mostly for resolving the legacy
+     * "OGP" identifier as "IOGP" (see the special case in fromName(String) method). This is also a way to share
+     * the same citation instance in GML like below:</p>
      *
+     * {@preformat xml
+     *   <gml:identifier codeSpace="IOGP">urn:ogc:def:crs:EPSG::4326</gml:identifier>
+     * }
+     *
+     * @see #fromName(String)
+     * @see org.apache.sis.internal.jaxb.referencing.Code#getIdentifier()
      * @see <a href="http://issues.apache.org/jira/browse/SIS-200">SIS-200</a>
      */
-    static final Citation IOGP = new SimpleCitation("IOGP");
+    static final Citation IOGP = new CitationConstant(Constants.IOGP);
 
     /**
      * The authority for identifiers of objects defined by the
@@ -168,6 +176,8 @@ public final class Citations extends Sta
      * This value can be returned by:
      * <ul>
      *   <li>{@link org.apache.sis.metadata.iso.ImmutableIdentifier#getAuthority()}</li>
+     *   <li>{@link org.apache.sis.referencing.factory.sql.EPSGFactory#getAuthority()}
+     *       with the addition of version information.</li>
      * </ul>
      *
      * @since 0.4
@@ -175,6 +185,43 @@ public final class Citations extends Sta
     public static final IdentifierSpace<Integer> EPSG = new CitationConstant.Authority<Integer>(Constants.EPSG);
 
     /**
+     * The authority for identifiers of objects defined by the
+     * <a href="http://www.opengeospatial.org/standards/wms">Web Map Service</a> (WMS) specification.
+     * The WMS 1.3 specifications is also known as ISO 19128
+     * <cite>Geographic Information — Web map server interface</cite> standard.
+     *
+     * <p>The citation {@linkplain DefaultCitation#getCitedResponsibleParties() responsible parties}
+     * are the OGC and ISO organizations.
+     * The {@linkplain IdentifierSpace#getName() namespace} declared by this constant is {@code "OGC"},
+     * but the {@code "CRS"}, {@code "AUTO"} and {@code "AUTO2"} namespaces are also commonly found in practice.</p>
+     *
+     * <div class="section">Main usage</div>
+     * This value can be returned by:
+     * <ul>
+     *   <li>{@link org.apache.sis.referencing.factory.CommonAuthorityFactory#getAuthority()}</li>
+     * </ul>
+     *
+     * @since 0.7
+     */
+    public static final IdentifierSpace<Integer> WMS = new WMS();
+
+    /**
+     * Special case for the {@link Citations#WMS} constant
+     * since it uses the same codespace than {@link Citations#OGC}.
+     */
+    private static final class WMS extends CitationConstant.Authority<Integer> {
+        private static final long serialVersionUID = -8490156477724003085L;
+
+        WMS() {
+            super("WMS");
+        }
+
+        @Override public String getName() {
+            return Constants.OGC;
+        }
+    }
+
+    /**
      * The authority for identifiers found in specifications from the
      * <a href="http://www.opengeospatial.org">Open Geospatial Consortium</a>.
      * The {@linkplain IdentifierSpace#getName() name} of this identifier space is fixed to {@code "OGC"}.
@@ -390,21 +437,22 @@ public final class Citations extends Sta
      * List of citations declared in this class.
      * Most frequently used citations (at least in SIS) should be first.
      */
-    private static final SimpleCitation[] CITATIONS = {
-        (SimpleCitation) EPSG,
-        (SimpleCitation) OGC,
-        (SimpleCitation) ESRI,
-        (SimpleCitation) NETCDF,
-        (SimpleCitation) GEOTIFF,
-        (SimpleCitation) PROJ4,
-        (SimpleCitation) MAP_INFO,
-        (SimpleCitation) S57,
-        (SimpleCitation) ISBN,
-        (SimpleCitation) ISSN,
-        (SimpleCitation) SIS,
-        (SimpleCitation) ISO_19115.get(0),
-        (SimpleCitation) ISO_19115.get(1),
-        (SimpleCitation) IOGP
+    private static final CitationConstant[] CITATIONS = {
+        (CitationConstant) EPSG,
+        (CitationConstant) WMS,
+        (CitationConstant) OGC,
+        (CitationConstant) ESRI,
+        (CitationConstant) NETCDF,
+        (CitationConstant) GEOTIFF,
+        (CitationConstant) PROJ4,
+        (CitationConstant) MAP_INFO,
+        (CitationConstant) S57,
+        (CitationConstant) ISBN,
+        (CitationConstant) ISSN,
+        (CitationConstant) SIS,
+        (CitationConstant) ISO_19115.get(0),
+        (CitationConstant) ISO_19115.get(1),
+        (CitationConstant) IOGP
     };
 
     static {  // Must be after CITATIONS array construction.
@@ -425,10 +473,8 @@ public final class Citations extends Sta
      * may have changed. This method notifies all citations that they will need to refresh their content.
      */
     static void refresh() {
-        for (final SimpleCitation citation : CITATIONS) {
-            if (citation instanceof CitationConstant) {
-                ((CitationConstant) citation).refresh();
-            }
+        for (final CitationConstant citation : CITATIONS) {
+            citation.refresh();
         }
     }
 
@@ -449,7 +495,7 @@ public final class Citations extends Sta
         if (identifier == null || ((identifier = CharSequences.trimWhitespaces(identifier)).isEmpty())) {
             return null;
         }
-        for (final SimpleCitation citation : CITATIONS) {
+        for (final CitationConstant citation : CITATIONS) {
             if (equalsFiltered(identifier, citation.title)) {
                 return citation;
             }
@@ -457,10 +503,12 @@ public final class Citations extends Sta
         if (equalsFiltered(identifier, "OGP")) {    // Old name of "IOGP" organization.
             return IOGP;
         }
+        if (equalsFiltered(identifier, Constants.CRS)) {
+            return WMS;
+        }
         /*
-         * If we found no match, org.apache.sis.internal.metadata.ServicesForUtility expects the default citation
-         * to be of this exact class: SimpleCitation (not a subclass). If the type of citation created below is
-         * modified, then we need to review ServicesForUtility.getCitationConstant(String) method body.
+         * If we found no match, org.apache.sis.internal.metadata.ServicesForUtility expects
+         * that we return anything that is not an instance of CitationConstant.
          */
         return new SimpleCitation(identifier);
     }
@@ -542,17 +590,26 @@ public final class Citations extends Sta
      * This method is useful for extracting a short designation of an authority (e.g. {@code "EPSG"})
      * for display purpose. This method performs the following choices:
      *
-     * <ul>
+     * <ul class="verbose">
      *   <li>If the given citation is {@code null}, then this method returns {@code null}.</li>
      *   <li>Otherwise if the collection of {@linkplain DefaultCitation#getIdentifiers() citation identifiers}
      *       contains at least one non-{@linkplain org.apache.sis.util.Deprecable#isDeprecated() deprecated}
      *       identifier, then:
      *     <ul>
-     *       <li>If the code and codespace of at least one non-deprecated identifier are
-     *           {@linkplain org.apache.sis.util.CharSequences#isUnicodeIdentifier unicode identifiers}, then
-     *           the <strong>first</strong> of those identifiers is returned in a {@code "[codespace:]code"} format.
-     *           Only the first character of the resulting string needs to be an
-     *           {@linkplain Character#isUnicodeIdentifierStart(int) identifier start character}.</li>
+     *       <li>If the <var>codespace</var> (if any) and the <var>code</var> of at least one non-deprecated identifier
+     *           are {@linkplain org.apache.sis.util.CharSequences#isUnicodeIdentifier valid Unicode identifiers}
+     *           (with relaxed rules regarding the code), then the <strong>first</strong> of those identifiers
+     *           is returned in a {@code "[codespace:]code"} format. If a <var>codespace</var> exists,
+     *           then the above restriction about the <var>code</var> is relaxed in two ways:
+     *         <ul>
+     *           <li>The code is allowed to start with a
+     *               Unicode identifier {@linkplain Character#isUnicodeIdentifierPart(int) part}
+     *               (not necessarily {@linkplain Character#isUnicodeIdentifierStart(int) start})
+     *               since the <var>codespace</var> already provides the start character.</li>
+     *           <li>The code is allowed to contain some other characters (currently {@code '.'} and {@code '-'})
+     *               commonly found in identifiers in the codespace managed by various authorities.</li>
+     *         </ul>
+     *       </li>
      *       <li>Otherwise the first non-empty and non-deprecated identifier is returned in a
      *           {@code "[codespace:]code"} format, despite not being a valid Unicode identifier.</li>
      *     </ul>
@@ -594,7 +651,7 @@ public final class Citations extends Sta
      * This method is useful for extracting a short designation of an authority (e.g. {@code "EPSG"})
      * for processing purpose. This method performs the following actions:
      *
-     * <ul>
+     * <ul class="verbose">
      *   <li>First, performs the same work than {@link #getIdentifier(Citation)} except that {@code '_'}
      *       is used instead of {@link org.apache.sis.util.iso.DefaultNameSpace#DEFAULT_SEPARATOR ':'}
      *       as the separator between the codespace and the code.</li>

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/Extents.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/Extents.java?rev=1727561&r1=1727560&r2=1727561&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/Extents.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/extent/Extents.java [UTF-8] Fri Jan 29 12:23:09 2016
@@ -144,7 +144,7 @@ public final class Extents extends Stati
      * If the given {@code Extent} object contains more than one vertical extent, then this method
      * performs a choice based on the vertical datum and the unit of measurement:
      *
-     * <ul>
+     * <ul class="verbose">
      *   <li><p><b>Choice based on vertical datum</b><br>
      *   Only the extents associated (indirectly, through their CRS) to the same non-null {@link VerticalDatumType}
      *   will be taken in account. If all datum types are null, then this method conservatively uses only the first

Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/internal/metadata/NameMeaningTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/internal/metadata/NameMeaningTest.java?rev=1727561&r1=1727560&r2=1727561&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/internal/metadata/NameMeaningTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/internal/metadata/NameMeaningTest.java [UTF-8] Fri Jan 29 12:23:09 2016
@@ -20,6 +20,7 @@ import org.opengis.referencing.cs.*;
 import org.opengis.referencing.crs.*;
 import org.opengis.referencing.datum.*;
 import org.opengis.referencing.ReferenceSystem;
+import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
@@ -31,7 +32,7 @@ import static org.junit.Assert.*;
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.5 (derived from 0.4)
- * @version 0.5
+ * @version 0.7
  * @module
  */
 public final strictfp class NameMeaningTest extends TestCase {
@@ -54,4 +55,16 @@ public final strictfp class NameMeaningT
         assertEquals("axis",            NameMeaning.toObjectType(CoordinateSystemAxis.class));
         assertEquals("referenceSystem", NameMeaning.toObjectType(ReferenceSystem     .class));
     }
+
+    /**
+     * Tests {@link NameMeaning#toURN(Class, String, String, String)}.
+     *
+     * @since 0.7
+     */
+    @Test
+    @DependsOnMethod("testToObjectType")
+    public void testToURN() {
+        assertEquals("urn:ogc:def:crs:OGC:1.3:CRS84", NameMeaning.toURN(GeographicCRS.class, "CRS",  null,   "84"));
+        assertEquals("urn:ogc:def:datum:EPSG::6326",  NameMeaning.toURN(GeodeticDatum.class, "EPSG", null, "6326"));
+    }
 }

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=1727561&r1=1727560&r2=1727561&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] Fri Jan 29 12:23:09 2016
@@ -25,6 +25,8 @@ import org.apache.sis.metadata.iso.exten
 import org.apache.sis.metadata.iso.extent.DefaultVerticalExtent;
 import org.apache.sis.measure.Units;
 import org.apache.sis.internal.util.X364;
+
+// Test imports
 import org.apache.sis.test.mock.VerticalCRSMock;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;

Modified: sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/TransliteratorTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/TransliteratorTest.java?rev=1727561&r1=1727560&r2=1727561&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/TransliteratorTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/test/java/org/apache/sis/io/wkt/TransliteratorTest.java [UTF-8] Fri Jan 29 12:23:09 2016
@@ -21,6 +21,8 @@ import org.opengis.referencing.cs.Spheri
 import org.opengis.referencing.cs.EllipsoidalCS;
 import org.opengis.referencing.cs.CoordinateSystem;
 import org.apache.sis.internal.metadata.AxisNames;
+
+// Test imports
 import org.apache.sis.test.mock.CoordinateSystemAxisMock;
 import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.TestCase;



Mime
View raw message