sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1791992 [1/2] - in /sis/branches/JDK7: ./ core/sis-feature/src/main/java/org/apache/sis/feature/ core/sis-feature/src/main/java/org/apache/sis/feature/builder/ core/sis-feature/src/main/java/org/apache/sis/internal/feature/ core/sis-featur...
Date Wed, 19 Apr 2017 21:51:32 GMT
Author: desruisseaux
Date: Wed Apr 19 21:51:31 2017
New Revision: 1791992

URL: http://svn.apache.org/viewvc?rev=1791992&view=rev
Log:
Merge from JDK8 branch.

Modified:
    sis/branches/JDK7/   (props changed)
    sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/EnvelopeOperation.java
    sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/AssociationRoleBuilder.java
    sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/AttributeRole.java
    sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/AttributeTypeBuilder.java
    sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/CharacteristicTypeBuilder.java
    sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/FeatureTypeBuilder.java
    sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/PropertyTypeBuilder.java
    sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/TypeBuilder.java
    sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/internal/feature/AttributeConvention.java
    sis/branches/JDK7/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultFeatureTypeTest.java
    sis/branches/JDK7/core/sis-feature/src/test/java/org/apache/sis/feature/EnvelopeOperationTest.java
    sis/branches/JDK7/core/sis-feature/src/test/java/org/apache/sis/feature/builder/FeatureTypeBuilderTest.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/SQLTranslator.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/UnitFormat.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractName.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultLocalName.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameSpace.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultScopedName.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/Names.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/package-info.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/ScalarTest.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/measure/UnitFormatTest.java
    sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/iso/NamesTest.java
    sis/branches/JDK7/pom.xml
    sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/storage/FeatureNaming.java
    sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/storage/FeatureNamingTest.java
    sis/branches/JDK7/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/GroupAsPolylineOperation.java
    sis/branches/JDK7/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Reader.java
    sis/branches/JDK7/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Tags.java
    sis/branches/JDK7/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Types.java
    sis/branches/JDK7/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Writer.java
    sis/branches/JDK7/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/storage/gpx/ReaderTest.java
    sis/branches/JDK7/storage/sis-xmlstore/src/test/java/org/apache/sis/internal/storage/gpx/WriterTest.java

Propchange: sis/branches/JDK7/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Apr 19 21:51:31 2017
@@ -1,5 +1,5 @@
 /sis/branches/Android:1430670-1480699
 /sis/branches/JDK6:1394913-1508480
-/sis/branches/JDK8:1584960-1790797
+/sis/branches/JDK8:1584960-1791988
 /sis/branches/JDK9:1773327-1789983
 /sis/trunk:1394364-1508466,1519089-1519674

Modified: sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/EnvelopeOperation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/EnvelopeOperation.java?rev=1791992&r1=1791991&r2=1791992&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/EnvelopeOperation.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/EnvelopeOperation.java [UTF-8] Wed Apr 19 21:51:31 2017
@@ -144,7 +144,7 @@ final class EnvelopeOperation extends Ab
                 final GenericName name = property.getName();
                 final String attributeName = (property instanceof LinkOperation)
                                              ? ((LinkOperation) property).referentName : name.toString();
-                final boolean isDefault = AttributeConvention.GEOMETRY_PROPERTY.equals(name.tip());
+                final boolean isDefault = AttributeConvention.GEOMETRY_PROPERTY.equals(name);
                 if (isDefault) {
                     defaultGeometry = attributeName;
                 }

Modified: sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/AssociationRoleBuilder.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/AssociationRoleBuilder.java?rev=1791992&r1=1791991&r2=1791992&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/AssociationRoleBuilder.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/AssociationRoleBuilder.java [UTF-8] Wed Apr 19 21:51:31 2017
@@ -130,32 +130,52 @@ public final class AssociationRoleBuilde
     }
 
     /**
-     * Sets the {@code FeatureAssociationRole} name as a simple string with the default scope.
-     * The default scope is the value specified by the last call to
-     * {@link FeatureTypeBuilder#setDefaultScope(String)}.
-     * The name will be a {@linkplain org.apache.sis.util.iso.DefaultLocalName local name} if no default scope
-     * has been specified, or a {@linkplain org.apache.sis.util.iso.DefaultScopedName scoped name} otherwise.
+     * Sets the {@code FeatureAssociationRole} name as a simple string (local name).
+     * The namespace will be the value specified by the last call to {@link FeatureTypeBuilder#setNameSpace(CharSequence)},
+     * but that namespace will not be visible in the {@linkplain org.apache.sis.util.iso.DefaultLocalName#toString()
+     * string representation} unless the {@linkplain org.apache.sis.util.iso.DefaultLocalName#toFullyQualifiedName()
+     * fully qualified name} is requested.
+     *
+     * <p>This convenience method creates a {@link org.opengis.util.LocalName} instance from
+     * the given {@code CharSequence}, then delegates to {@link #setName(GenericName)}.</p>
      *
      * @return {@code this} for allowing method calls chaining.
      */
     @Override
-    public AssociationRoleBuilder setName(final String localPart) {
+    public AssociationRoleBuilder setName(final CharSequence localPart) {
         super.setName(localPart);
         return this;
     }
 
     /**
      * Sets the {@code FeatureAssociationRole} name as a string in the given scope.
-     * The name will be a {@linkplain org.apache.sis.util.iso.DefaultLocalName local name} if the given scope is
-     * {@code null} or empty, or a {@linkplain org.apache.sis.util.iso.DefaultScopedName scoped name} otherwise.
-     * If a {@linkplain FeatureTypeBuilder#setDefaultScope(String) default scope} has been specified, then the
-     * {@code scope} argument overrides it.
+     * The {@code components} array must contain at least one element.
+     * The last component (the {@linkplain org.apache.sis.util.iso.DefaultScopedName#tip() tip}) will be sufficient
+     * in many cases for calls to the {@link org.apache.sis.feature.AbstractFeature#getProperty(String)} method.
+     * The other elements before the last one are optional and can be used for resolving ambiguity.
+     * They will be visible as the name {@linkplain org.apache.sis.util.iso.DefaultScopedName#path() path}.
+     *
+     * <div class="note"><b>Example:</b>
+     * a call to {@code setName("A", "B", "C")} will create a "A:B:C" name.
+     * An association built with this name can be obtained from a feature by a call to {@code feature.getProperty("C")}
+     * if there is no ambiguity, or otherwise by a call to {@code feature.getProperty("B:C")} (if non-ambiguous) or
+     * {@code feature.getProperty("A:B:C")}.</div>
+     *
+     * In addition to the path specified by the {@code components} array, the name may also contain
+     * a namespace specified by the last call to {@link FeatureTypeBuilder#setNameSpace(CharSequence)}.
+     * But contrarily to the specified components, the namespace will not be visible in the name
+     * {@linkplain org.apache.sis.util.iso.DefaultScopedName#toString() string representation} unless the
+     * {@linkplain org.apache.sis.util.iso.DefaultScopedName#toFullyQualifiedName() fully qualified name} is requested.
+     *
+     * <p>This convenience method creates a {@link org.opengis.util.LocalName} or {@link org.opengis.util.ScopedName}
+     * instance depending on whether the {@code names} array contains exactly 1 element or more than 1 element, then
+     * delegates to {@link #setName(GenericName)}.</p>
      *
      * @return {@code this} for allowing method calls chaining.
      */
     @Override
-    public AssociationRoleBuilder setName(final String scope, final String localPart) {
-        super.setName(scope, localPart);
+    public AssociationRoleBuilder setName(final CharSequence... components) {
+        super.setName(components);
         return this;
     }
 

Modified: sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/AttributeRole.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/AttributeRole.java?rev=1791992&r1=1791991&r2=1791992&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/AttributeRole.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/AttributeRole.java [UTF-8] Wed Apr 19 21:51:31 2017
@@ -53,9 +53,9 @@ public enum AttributeRole {
      *
      * <ul>
      *   <li>If no attribute has this role, then no attribute is marked as feature identifier.</li>
-     *   <li>If exactly one attribute has this role, then a synthetic attribute named {@code "@identifier"}
+     *   <li>If exactly one attribute has this role, then a synthetic attribute named {@code "sis:identifier"}
      *       will be created as a {@linkplain FeatureOperations#link link} to the flagged attribute.</li>
-     *   <li>If more than one attribute have this role, then a synthetic attribute named {@code "@identifier"}
+     *   <li>If more than one attribute have this role, then a synthetic attribute named {@code "sis:identifier"}
      *       will be created as a {@linkplain FeatureOperations#compound compound key} made of all flagged
      *       attributes. The separator character can be modified by a call to
      *       {@link FeatureTypeBuilder#setIdentifierDelimiters(String, String, String)}</li>

Modified: sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/AttributeTypeBuilder.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/AttributeTypeBuilder.java?rev=1791992&r1=1791991&r2=1791992&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/AttributeTypeBuilder.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/AttributeTypeBuilder.java [UTF-8] Wed Apr 19 21:51:31 2017
@@ -87,8 +87,8 @@ public final class AttributeTypeBuilder<
 
     /**
      * Whether this attribute will be used in a {@linkplain FeatureOperations#compound compound key} named
-     * {@code "@identifier"}. If only one attribute has this flag and {@link FeatureTypeBuilder#idPrefix} and
-     * {@code isSuffix} are null, then {@code "@identifier"} will be a {@linkplain FeatureOperations#link link}
+     * {@code "sis:identifier"}. If only one attribute has this flag and {@link FeatureTypeBuilder#idPrefix} and
+     * {@code isSuffix} are null, then {@code "sis:identifier"} will be a {@linkplain FeatureOperations#link link}
      * to {@code idAttributes[0]}.
      *
      * @see #addRole(AttributeRole)
@@ -185,32 +185,52 @@ public final class AttributeTypeBuilder<
     }
 
     /**
-     * Sets the {@code AttributeType} name as a simple string with the default scope.
-     * The default scope is the value specified by the last call to
-     * {@link FeatureTypeBuilder#setDefaultScope(String)}.
-     * The name will be a {@linkplain org.apache.sis.util.iso.DefaultLocalName local name} if no default scope
-     * has been specified, or a {@linkplain org.apache.sis.util.iso.DefaultScopedName scoped name} otherwise.
+     * Sets the {@code AttributeType} name as a simple string (local name).
+     * The namespace will be the value specified by the last call to {@link FeatureTypeBuilder#setNameSpace(CharSequence)},
+     * but that namespace will not be visible in the {@linkplain org.apache.sis.util.iso.DefaultLocalName#toString()
+     * string representation} unless the {@linkplain org.apache.sis.util.iso.DefaultLocalName#toFullyQualifiedName()
+     * fully qualified name} is requested.
+     *
+     * <p>This convenience method creates a {@link org.opengis.util.LocalName} instance from
+     * the given {@code CharSequence}, then delegates to {@link #setName(GenericName)}.</p>
      *
      * @return {@code this} for allowing method calls chaining.
      */
     @Override
-    public AttributeTypeBuilder<V> setName(final String localPart) {
+    public AttributeTypeBuilder<V> setName(final CharSequence localPart) {
         super.setName(localPart);
         return this;
     }
 
     /**
      * Sets the {@code AttributeType} name as a string in the given scope.
-     * The name will be a {@linkplain org.apache.sis.util.iso.DefaultLocalName local name} if the given scope is
-     * {@code null} or empty, or a {@linkplain org.apache.sis.util.iso.DefaultScopedName scoped name} otherwise.
-     * If a {@linkplain FeatureTypeBuilder#setDefaultScope(String) default scope} has been specified, then the
-     * {@code scope} argument overrides it.
+     * The {@code components} array must contain at least one element.
+     * The last component (the {@linkplain org.apache.sis.util.iso.DefaultScopedName#tip() tip}) will be sufficient
+     * in many cases for calls to the {@link org.apache.sis.feature.AbstractFeature#getProperty(String)} method.
+     * The other elements before the last one are optional and can be used for resolving ambiguity.
+     * They will be visible as the name {@linkplain org.apache.sis.util.iso.DefaultScopedName#path() path}.
+     *
+     * <div class="note"><b>Example:</b>
+     * a call to {@code setName("A", "B", "C")} will create a "A:B:C" name.
+     * An attribute built with this name can be obtained from a feature by a call to {@code feature.getProperty("C")}
+     * if there is no ambiguity, or otherwise by a call to {@code feature.getProperty("B:C")} (if non-ambiguous) or
+     * {@code feature.getProperty("A:B:C")}.</div>
+     *
+     * In addition to the path specified by the {@code components} array, the name may also contain
+     * a namespace specified by the last call to {@link FeatureTypeBuilder#setNameSpace(CharSequence)}.
+     * But contrarily to the specified components, the namespace will not be visible in the name
+     * {@linkplain org.apache.sis.util.iso.DefaultScopedName#toString() string representation} unless the
+     * {@linkplain org.apache.sis.util.iso.DefaultScopedName#toFullyQualifiedName() fully qualified name} is requested.
+     *
+     * <p>This convenience method creates a {@link org.opengis.util.LocalName} or {@link org.opengis.util.ScopedName}
+     * instance depending on whether the {@code names} array contains exactly 1 element or more than 1 element, then
+     * delegates to {@link #setName(GenericName)}.</p>
      *
      * @return {@code this} for allowing method calls chaining.
      */
     @Override
-    public AttributeTypeBuilder<V> setName(final String scope, final String localPart) {
-        super.setName(scope, localPart);
+    public AttributeTypeBuilder<V> setName(final CharSequence... components) {
+        super.setName(components);
         return this;
     }
 

Modified: sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/CharacteristicTypeBuilder.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/CharacteristicTypeBuilder.java?rev=1791992&r1=1791991&r2=1791992&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/CharacteristicTypeBuilder.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/CharacteristicTypeBuilder.java [UTF-8] Wed Apr 19 21:51:31 2017
@@ -146,42 +146,66 @@ public final class CharacteristicTypeBui
     }
 
     /**
-     * Sets the characteristic name as a simple string with the default scope.
-     * The default scope is the value specified by the last call to
-     * {@link FeatureTypeBuilder#setDefaultScope(String)}.
-     * The name will be a {@linkplain org.apache.sis.util.iso.DefaultLocalName local name} if no default scope
-     * has been specified, or a {@linkplain org.apache.sis.util.iso.DefaultScopedName scoped name} otherwise.
+     * Sets the characteristic name as a simple string (local name).
+     * The namespace will be the value specified by the last call to {@link FeatureTypeBuilder#setNameSpace(CharSequence)},
+     * but that namespace will not be visible in the {@linkplain org.apache.sis.util.iso.DefaultLocalName#toString()
+     * string representation} unless the {@linkplain org.apache.sis.util.iso.DefaultLocalName#toFullyQualifiedName()
+     * fully qualified name} is requested.
+     *
+     * <p>This convenience method creates a {@link org.opengis.util.LocalName} instance from
+     * the given {@code CharSequence}, then delegates to {@link #setName(GenericName)}.</p>
      *
      * @return {@code this} for allowing method calls chaining.
      */
     @Override
-    public CharacteristicTypeBuilder<V> setName(final String localPart) {
+    public CharacteristicTypeBuilder<V> setName(final CharSequence localPart) {
         super.setName(localPart);
         return this;
     }
 
     /**
      * Sets the characteristic name as a string in the given scope.
-     * The name will be a {@linkplain org.apache.sis.util.iso.DefaultLocalName local name} if the given scope is
-     * {@code null} or empty, or a {@linkplain org.apache.sis.util.iso.DefaultScopedName scoped name} otherwise.
-     * If a {@linkplain FeatureTypeBuilder#setDefaultScope(String) default scope} has been specified, then the
-     * {@code scope} argument overrides it.
+     * The {@code components} array must contain at least one element.
+     * The last component (the {@linkplain org.apache.sis.util.iso.DefaultScopedName#tip() tip}) will be sufficient
+     * in many cases for getting values from the {@linkplain org.apache.sis.feature.AbstractAttribute#characteristics()
+     * characteristics} map. The other elements before the last one are optional and can be used for resolving ambiguity.
+     * They will be visible as the name {@linkplain org.apache.sis.util.iso.DefaultScopedName#path() path}.
+     *
+     * <p>In addition to the path specified by the {@code components} array, the name may also contain
+     * a namespace specified by the last call to {@link FeatureTypeBuilder#setNameSpace(CharSequence)}.
+     * But contrarily to the specified components, the namespace will not be visible in the name
+     * {@linkplain org.apache.sis.util.iso.DefaultScopedName#toString() string representation} unless the
+     * {@linkplain org.apache.sis.util.iso.DefaultScopedName#toFullyQualifiedName() fully qualified name}
+     * is requested.</p>
+     *
+     * <p>This convenience method creates a {@link org.opengis.util.LocalName} or {@link org.opengis.util.ScopedName}
+     * instance depending on whether the {@code names} array contains exactly 1 element or more than 1 element, then
+     * delegates to {@link #setName(GenericName)}.</p>
      *
      * @return {@code this} for allowing method calls chaining.
      */
     @Override
-    public CharacteristicTypeBuilder<V> setName(final String scope, final String localPart) {
-        super.setName(scope, localPart);
+    public CharacteristicTypeBuilder<V> setName(final CharSequence... components) {
+        super.setName(components);
         return this;
     }
 
     /**
-     * Delegates the creation of a new name to the enclosing builder.
+     * Creates a local name in the {@linkplain FeatureTypeBuilder#setNameSpace feature namespace}.
+     */
+    @Override
+    final GenericName createLocalName(final CharSequence name) {
+        ensureAlive(owner);
+        return owner.createLocalName(name);
+    }
+
+    /**
+     * Creates a generic name in the {@linkplain FeatureTypeBuilder#setNameSpace feature namespace}.
      */
     @Override
-    final GenericName name(final String scope, final String localPart) {
+    final GenericName createGenericName(final CharSequence... names) {
         ensureAlive(owner);
-        return owner.name(scope, localPart);
+        return owner.createGenericName(names);
     }
 
     /**

Modified: sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/FeatureTypeBuilder.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/FeatureTypeBuilder.java?rev=1791992&r1=1791991&r2=1791992&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/FeatureTypeBuilder.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/FeatureTypeBuilder.java [UTF-8] Wed Apr 19 21:51:31 2017
@@ -25,6 +25,7 @@ import java.util.Map;
 import java.util.Locale;
 import java.util.Set;
 import java.util.Objects;
+import org.opengis.util.NameSpace;
 import org.opengis.util.GenericName;
 import org.opengis.util.NameFactory;
 import org.opengis.util.FactoryException;
@@ -91,12 +92,12 @@ public class FeatureTypeBuilder extends
     private boolean isAbstract;
 
     /**
-     * The default scope to use when {@link #name(String, String)} is invoked with a null scope.
+     * The namespace to use when a {@link #setName(CharSequence)} method is invoked.
      *
-     * @see #getDefaultScope()
-     * @see #setDefaultScope(String)
+     * @see #getNameSpace()
+     * @see #setNameSpace(CharSequence)
      */
-    private String defaultScope;
+    private NameSpace namespace;
 
     /**
      * The default minimum number of property values.
@@ -114,13 +115,13 @@ public class FeatureTypeBuilder extends
 
     /**
      * An optional prefix or suffix to insert before or after the {@linkplain FeatureOperations#compound compound key}
-     * named {@code "@identifier"}.
+     * named {@code "sis:identifier"}.
      */
     private String idPrefix, idSuffix;
 
     /**
      * The separator to insert between each single component in a {@linkplain FeatureOperations#compound compound key}
-     * named {@code "@identifier"}. This is ignored if {@link #identifierCount} is zero.
+     * named {@code "sis:identifier"}. This is ignored if {@link #identifierCount} is zero.
      */
     private String idDelimiter;
 
@@ -197,7 +198,7 @@ public class FeatureTypeBuilder extends
                 } else if (property instanceof FeatureAssociationRole) {
                     builder = new AssociationRoleBuilder(this, (FeatureAssociationRole) property);
                 } else {
-                    builder = null;     // Do not create OperationWrapper now - see below.
+                    builder = null;                             // Do not create OperationWrapper now - see below.
                 }
                 /*
                  * If the property name is one of our (Apache SIS specific) conventional names, try to reconstitute
@@ -212,7 +213,7 @@ public class FeatureTypeBuilder extends
                 } else if (AttributeConvention.GEOMETRY_PROPERTY.equals(name)) {
                     role = AttributeRole.DEFAULT_GEOMETRY;
                 } else if (AttributeConvention.ENVELOPE_PROPERTY.equals(name)) {
-                    // If "@envelope" is an operation, skip it completely.
+                    // If "sis:envelope" is an operation, skip it completely.
                     // It will be recreated if a default geometry exists.
                     role = null;
                 } else {
@@ -319,6 +320,42 @@ public class FeatureTypeBuilder extends
     }
 
     /**
+     * Returns the namespace of the names created by {@code setName(CharSequence...)} method calls.
+     * A {@code null} value means that the names are in the
+     * {@linkplain org.apache.sis.util.iso.DefaultNameSpace#isGlobal() global namespace}.
+     *
+     * @return the namespace to use when {@link #setName(CharSequence)} is invoked, or {@code null} if none.
+     */
+    public CharSequence getNameSpace() {
+        return (namespace != null) ? namespace.name().toString() : null;
+    }
+
+    /**
+     * Sets the namespace of the next names to be created by {@code setName(CharSequence...)} method calls.
+     * This method applies only to the next calls to {@link #setName(CharSequence)} or
+     * {@link #setName(CharSequence...)} methods; the result of all previous calls stay unmodified.
+     *
+     * <p>There is different conventions about the use of name spaces. ISO 19109 suggests that the namespace of all
+     * {@code AttributeType} names is the name of the enclosing {@code FeatureType}, but this is not mandatory.
+     * Users who want to apply this convention can invoke {@code setNameSpace(featureName)} after
+     * <code>{@linkplain #setName(CharSequence) FeatureTypeBuilder.setName}(featureName)</code> but before
+     * <code>{@linkplain AttributeTypeBuilder#setName(CharSequence) AttributeTypeBuilder.setName}(attributeName)</code>.</p>
+     *
+     * @param  ns  the new namespace, or {@code null} if none.
+     * @return {@code this} for allowing method calls chaining.
+     */
+    public FeatureTypeBuilder setNameSpace(final CharSequence ns) {
+        if (ns != null && ns.length() != 0) {
+            namespace = nameFactory.createNameSpace(nameFactory.createLocalName(null, ns), null);
+        } else {
+            namespace = null;
+        }
+        // No need to clear the cache because this change affects
+        // only the next names to be created, not the existing ones.
+        return this;
+    }
+
+    /**
      * Sets the {@code FeatureType} name as a generic name.
      * If another name was defined before this method call, that previous value will be discarded.
      *
@@ -335,83 +372,58 @@ public class FeatureTypeBuilder extends
     }
 
     /**
-     * Sets the {@code FeatureType} name as a simple string with the default scope.
-     * The default scope is the value specified by the last call to {@link #setDefaultScope(String)}.
-     * The name will be a {@linkplain org.apache.sis.util.iso.DefaultLocalName local name} if no default scope
-     * has been specified, or a {@linkplain org.apache.sis.util.iso.DefaultScopedName scoped name} otherwise.
+     * Sets the {@code FeatureType} name as a simple string.
+     * The namespace will be the value specified by the last call to {@link #setNameSpace(CharSequence)},
+     * but that namespace will not be visible in the {@linkplain org.apache.sis.util.iso.DefaultLocalName#toString()
+     * string representation} unless the {@linkplain org.apache.sis.util.iso.DefaultLocalName#toFullyQualifiedName()
+     * fully qualified name} is requested.
      *
-     * <p>This convenience method creates a {@link GenericName} instance,
-     * then delegates to {@link #setName(GenericName)}.</p>
+     * <p>This convenience method creates a {@link org.opengis.util.LocalName} instance from
+     * the given {@code CharSequence}, then delegates to {@link #setName(GenericName)}.</p>
      *
      * @return {@code this} for allowing method calls chaining.
      */
     @Override
-    public FeatureTypeBuilder setName(final String localPart) {
+    public FeatureTypeBuilder setName(final CharSequence localPart) {
         super.setName(localPart);
         return this;
     }
 
     /**
      * Sets the {@code FeatureType} name as a string in the given scope.
-     * The name will be a {@linkplain org.apache.sis.util.iso.DefaultLocalName local name} if the given scope is
-     * {@code null} or empty, or a {@linkplain org.apache.sis.util.iso.DefaultScopedName scoped name} otherwise.
-     * If a {@linkplain #setDefaultScope(String) default scope} has been specified, then the
-     * {@code scope} argument overrides it.
-     *
-     * <p>This convenience method creates a {@link GenericName} instance,
-     * then delegates to {@link #setName(GenericName)}.</p>
+     * The {@code components} array must contain at least one element.
+     * In addition to the path specified by the {@code components} array, the name may also contain
+     * a namespace specified by the last call to {@link #setNameSpace(CharSequence)}.
+     * But contrarily to the specified components, the namespace will not be visible in the name
+     * {@linkplain org.apache.sis.util.iso.DefaultScopedName#toString() string representation} unless the
+     * {@linkplain org.apache.sis.util.iso.DefaultScopedName#toFullyQualifiedName() fully qualified name} is requested.
+     *
+     * <p>This convenience method creates a {@link org.opengis.util.LocalName} or {@link org.opengis.util.ScopedName}
+     * instance depending on whether the {@code names} array contains exactly 1 element or more than 1 element, then
+     * delegates to {@link #setName(GenericName)}.</p>
      *
      * @return {@code this} for allowing method calls chaining.
      */
     @Override
-    public FeatureTypeBuilder setName(final String scope, final String localPart) {
-        super.setName(scope, localPart);
+    public FeatureTypeBuilder setName(final CharSequence... components) {
+        super.setName(components);
         return this;
     }
 
     /**
-     * Invoked by {@link TypeBuilder} for creating new {@code LocalName} or {@code GenericName} instances.
+     * Creates a local name in the {@linkplain #setNameSpace feature namespace}.
      */
     @Override
-    final GenericName name(String scope, final String localPart) {
-        if (scope == null) {
-            scope = getDefaultScope();
-        }
-        if (scope == null || scope.isEmpty()) {
-            return nameFactory.createLocalName(null, localPart);
-        } else {
-            return nameFactory.createGenericName(null, scope, localPart);
-        }
+    final GenericName createLocalName(final CharSequence name) {
+        return nameFactory.createLocalName(namespace, name);
     }
 
     /**
-     * Returns the scope of the names created by {@code setName(String)} method calls.
-     *
-     * @return the scope to use by default when {@link #setName(String)} is invoked.
+     * Creates a generic name in the {@linkplain #setNameSpace feature namespace}.
      */
-    public String getDefaultScope() {
-        return defaultScope;
-    }
-
-    /**
-     * Sets the scope of the next names created by {@code setName(String)} method calls.
-     * This method applies only to the next calls to {@code setName(String)};
-     * the result of all previous calls stay unmodified.
-     *
-     * <p>There is different conventions about the use of name scopes. ISO 19109 suggests that the scope of all
-     * {@code AttributeType} names is the name of the enclosing {@code FeatureType}, but this is not mandatory.
-     * Users who want to apply this convention can invoke {@code setDefaultScope(featureName)} after
-     * <code>{@linkplain #setName(String) FeatureTypeBuilder.setName}(featureName)</code> but before
-     * <code>{@linkplain AttributeTypeBuilder#setName(String) AttributeTypeBuilder.setName}(attributeName)</code>.</p>
-     *
-     * @param  scope  the new default scope, or {@code null} if none.
-     * @return {@code this} for allowing method calls chaining.
-     */
-    public FeatureTypeBuilder setDefaultScope(final String scope) {
-        defaultScope = scope;
-        // No need to clear the cache because this change affects
-        // only the next names to be created, not the existing ones.
-        return this;
+    @Override
+    final GenericName createGenericName(final CharSequence... names) {
+        return nameFactory.createGenericName(namespace, names);
     }
 
     /**
@@ -686,9 +698,9 @@ public class FeatureTypeBuilder extends
     public FeatureType build() throws IllegalStateException {
         if (feature == null) {
             /*
-             * Creates an initial array of property types with up to 3 slots reserved for @identifier, @geometry
-             * and @envelope operations. At first we presume that there is always an identifier.  The identifier
-             * slot will be removed later if there is none.
+             * Creates an initial array of property types with up to 3 slots reserved for sis:identifier, sis:geometry
+             * and sis:envelope operations. At first we presume that there is always an identifier. The identifier slot
+             * will be removed later if there is none.
              */
             final int numSpecified = properties.size();     // Number of explicitely specified properties.
             int numSynthetic;                               // Number of synthetic properties that may be generated.
@@ -724,8 +736,8 @@ public class FeatureTypeBuilder extends
                     identifierTypes[identifierCursor++] = instance;
                 }
                 /*
-                 * If there is a default geometry, add a link named "@geometry" to that geometry.
-                 * It may happen that the property created by the user is already named "@geometry",
+                 * If there is a default geometry, add a link named "sis:geometry" to that geometry.
+                 * It may happen that the property created by the user is already named "sis:geometry",
                  * in which case we will avoid to duplicate the property.
                  */
                 if (builder == defaultGeometry && geometryIndex >= 0) {
@@ -743,7 +755,7 @@ public class FeatureTypeBuilder extends
             /*
              * Create the "envelope" operation only after we created all other properties.
              * Actually it is okay if the 'propertyTypes' array still contains null elements not needed for envelope calculation
-             * like "@identifier", since FeatureOperations.envelope(…) constructor ignores any property which is not for a value.
+             * like "sis:identifier", since FeatureOperations.envelope(…) constructor ignores any property which is not for a value.
              */
             if (envelopeIndex >= 0) try {
                 propertyTypes[envelopeIndex] = FeatureOperations.envelope(name(AttributeConvention.ENVELOPE_PROPERTY), null, propertyTypes);
@@ -753,7 +765,7 @@ public class FeatureTypeBuilder extends
             /*
              * If a synthetic identifier need to be created, create it now as the first property.
              * It may happen that the user provided a single identifier component already named
-             * "@identifier", in which case we avoid to duplicate the property.
+             * "sis:identifier", in which case we avoid to duplicate the property.
              */
             if (identifierTypes != null) {
                 if (identifierCursor != identifierTypes.length) {

Modified: sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/PropertyTypeBuilder.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/PropertyTypeBuilder.java?rev=1791992&r1=1791991&r2=1791992&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/PropertyTypeBuilder.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/PropertyTypeBuilder.java [UTF-8] Wed Apr 19 21:51:31 2017
@@ -186,12 +186,21 @@ public abstract class PropertyTypeBuilde
     }
 
     /**
-     * Delegates the creation of a new name to the enclosing builder.
+     * Creates a local name in the {@linkplain FeatureTypeBuilder#setNameSpace feature namespace}.
      */
     @Override
-    final GenericName name(final String scope, final String localPart) {
+    final GenericName createLocalName(final CharSequence name) {
         ensureAlive(owner);
-        return owner.name(scope, localPart);
+        return owner.createLocalName(name);
+    }
+
+    /**
+     * Creates a generic name in the {@linkplain FeatureTypeBuilder#setNameSpace feature namespace}.
+     */
+    @Override
+    final GenericName createGenericName(final CharSequence... names) {
+        ensureAlive(owner);
+        return owner.createGenericName(names);
     }
 
     /**

Modified: sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/TypeBuilder.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/TypeBuilder.java?rev=1791992&r1=1791991&r2=1791992&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/TypeBuilder.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/feature/builder/TypeBuilder.java [UTF-8] Wed Apr 19 21:51:31 2017
@@ -23,6 +23,7 @@ import java.util.Locale;
 import java.util.Objects;
 import org.opengis.util.ScopedName;
 import org.opengis.util.GenericName;
+import org.opengis.util.InternationalString;
 import org.apache.sis.internal.feature.Resources;
 import org.apache.sis.feature.AbstractIdentifiedType;
 import org.apache.sis.util.resources.Vocabulary;
@@ -52,9 +53,12 @@ import org.opengis.feature.PropertyNotFo
  * <div class="section">Default namespace</div>
  * In many cases, the names of all {@code AttributeType}s and {@code AssociationRole}s to create
  * within a {@code FeatureType} share the same namespace.
- * For making name creations more convenient, a default namespace can be
- * {@linkplain FeatureTypeBuilder#setDefaultScope specified once} and applied automatically
- * to all names created by the {@link #setName(String)} method.
+ * For making name creations more convenient, the namespace can be
+ * {@linkplain FeatureTypeBuilder#setNameSpace specified once} and applied automatically
+ * to all names created by the {@link #setName(CharSequence)} method.
+ * Note that namespaces will not be visible in the name {@linkplain org.apache.sis.util.iso.DefaultLocalName#toString()
+ * string representation} unless the {@linkplain org.apache.sis.util.iso.DefaultLocalName#toFullyQualifiedName() fully
+ * qualified name} is requested.
  *
  * @author  Johann Sorel (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
@@ -126,7 +130,7 @@ public abstract class TypeBuilder implem
                             name = buffer.appendCodePoint(lc).append(name, n, length).toString();
                         }
                     }
-                    identification.put(AbstractIdentifiedType.NAME_KEY, name(null, name));
+                    identification.put(AbstractIdentifiedType.NAME_KEY, createLocalName(name));
                 }
             }
         }
@@ -139,14 +143,14 @@ public abstract class TypeBuilder implem
     abstract void clearCache();
 
     /**
-     * Creates a generic name from the given scope and local part.
-     * An empty scope means no scope. A {@code null} scope means the
-     * {@linkplain FeatureTypeBuilder#setDefaultScope(String) default scope}.
-     *
-     * @param scope      the scope of the name to create, or {@code null} if the name is local.
-     * @param localPart  the local part of the generic name (can not be {@code null}).
+     * Creates a local name in the {@linkplain FeatureTypeBuilder#setNameSpace feature namespace}.
+     */
+    abstract GenericName createLocalName(final CharSequence name);
+
+    /**
+     * Creates a generic name in the {@linkplain FeatureTypeBuilder#setNameSpace feature namespace}.
      */
-    abstract GenericName name(String scope, String localPart);
+    abstract GenericName createGenericName(final CharSequence... names);
 
     /**
      * Returns the name of the {@code IdentifiedType} to create, or {@code null} if undefined.
@@ -155,8 +159,9 @@ public abstract class TypeBuilder implem
      *
      * @return the name of the {@code IdentifiedType} to create (may be a default name or {@code null}).
      *
-     * @see AbstractIdentifiedType#getName()
      * @see #setName(GenericName)
+     * @see AbstractIdentifiedType#getName()
+     * @see FeatureTypeBuilder#getNameSpace()
      */
     public GenericName getName() {
         return (GenericName) identification().get(AbstractIdentifiedType.NAME_KEY);
@@ -190,7 +195,7 @@ public abstract class TypeBuilder implem
      * @return {@code this} for allowing method calls chaining.
      *
      * @see #getName()
-     * @see #setName(String)
+     * @see #setName(CharSequence)
      * @see AbstractIdentifiedType#NAME_KEY
      */
     public TypeBuilder setName(final GenericName name) {
@@ -202,48 +207,64 @@ public abstract class TypeBuilder implem
     }
 
     /**
-     * Sets the {@code IdentifiedType} name as a simple string with the default scope.
-     * The default scope is the value specified by the last call to {@link FeatureTypeBuilder#setDefaultScope(String)}.
-     * The name will be a {@linkplain org.apache.sis.util.iso.DefaultLocalName local name} if no default scope
-     * has been specified, or a {@linkplain org.apache.sis.util.iso.DefaultScopedName scoped name} otherwise.
+     * Sets the {@code IdentifiedType} name as a simple string (local name).
+     * The namespace will be the value specified by the last call to {@link FeatureTypeBuilder#setNameSpace(CharSequence)},
+     * but that namespace will not be visible in the {@linkplain org.apache.sis.util.iso.DefaultLocalName#toString()
+     * string representation} unless the {@linkplain org.apache.sis.util.iso.DefaultLocalName#toFullyQualifiedName()
+     * fully qualified name} is requested.
      *
-     * <p>This convenience method creates a {@link GenericName} instance,
-     * then delegates to {@link #setName(GenericName)}.</p>
+     * <p>This convenience method creates a {@link org.opengis.util.LocalName} instance from
+     * the given {@code CharSequence}, then delegates to {@link #setName(GenericName)}.</p>
      *
-     * @param  localPart  the local part of the generic name (can not be {@code null}).
+     * @param  localPart  the local part of the generic name as a {@link String} or {@link InternationalString}.
      * @return {@code this} for allowing method calls chaining.
      *
      * @see #getName()
-     * @see #setName(String, String)
+     * @see #setName(CharSequence...)
+     * @see FeatureTypeBuilder#getNameSpace()
      */
-    public TypeBuilder setName(final String localPart) {
+    public TypeBuilder setName(final CharSequence localPart) {
         ensureNonEmpty("localPart", localPart);
-        return setName(name(null, localPart));
+        return setName(createLocalName(localPart));
     }
 
     /**
      * Sets the {@code IdentifiedType} name as a string in the given scope.
-     * The name will be a {@linkplain org.apache.sis.util.iso.DefaultLocalName local name} if the given scope is
-     * {@code null} or empty, or a {@linkplain org.apache.sis.util.iso.DefaultScopedName scoped name} otherwise.
-     * If a {@linkplain FeatureTypeBuilder#setDefaultScope(String) default scope} has been specified, then the
-     * {@code scope} argument overrides it.
+     * The {@code components} array must contain at least one element.
+     * The last component (the {@linkplain org.apache.sis.util.iso.DefaultScopedName#tip() tip}) will be sufficient
+     * in many cases for calls to the {@link org.apache.sis.feature.AbstractFeature#getProperty(String)} method.
+     * The other elements before the last one are optional and can be used for resolving ambiguity.
+     * They will be visible as the name {@linkplain org.apache.sis.util.iso.DefaultScopedName#path() path}.
+     *
+     * <div class="note"><b>Example:</b>
+     * a call to {@code setName("A", "B", "C")} will create a "A:B:C" name.
+     * A property built with this name can be obtained from a feature by a call to {@code feature.getProperty("C")}
+     * if there is no ambiguity, or otherwise by a call to {@code feature.getProperty("B:C")} (if non-ambiguous) or
+     * {@code feature.getProperty("A:B:C")}.</div>
+     *
+     * In addition to the path specified by the {@code components} array, the name may also contain
+     * a namespace specified by the last call to {@link FeatureTypeBuilder#setNameSpace(CharSequence)}.
+     * But contrarily to the specified components, the namespace will not be visible in the name
+     * {@linkplain org.apache.sis.util.iso.DefaultScopedName#toString() string representation} unless the
+     * {@linkplain org.apache.sis.util.iso.DefaultScopedName#toFullyQualifiedName() fully qualified name} is requested.
+     *
+     * <p>This convenience method creates a {@link org.opengis.util.LocalName} or {@link org.opengis.util.ScopedName}
+     * instance depending on whether the {@code names} array contains exactly 1 element or more than 1 element, then
+     * delegates to {@link #setName(GenericName)}.</p>
      *
-     * <p>This convenience method creates a {@link GenericName} instance,
-     * then delegates to {@link #setName(GenericName)}.</p>
-     *
-     * @param  scope      the scope of the name to create, or {@code null} if the name is local.
-     * @param  localPart  the local part of the generic name (can not be {@code null}).
+     * @param  components  the name components as an array of {@link String} or {@link InternationalString} instances.
      * @return {@code this} for allowing method calls chaining.
      *
      * @see #getName()
-     * @see #setName(String)
+     * @see #setName(CharSequence)
+     * @see FeatureTypeBuilder#getNameSpace()
      */
-    public TypeBuilder setName(String scope, final String localPart) {
-        ensureNonEmpty("localPart", localPart);
-        if (scope == null) {
-            scope = "";                                 // For preventing the use of default scope.
+    public TypeBuilder setName(final CharSequence... components) {
+        ensureNonNull("components", components);
+        if (components.length == 0) {
+            throw new IllegalArgumentException(errors().getString(Errors.Keys.EmptyArgument_1, "components"));
         }
-        return setName(name(scope, localPart));
+        return setName(createGenericName(components));
     }
 
     /**
@@ -469,7 +490,7 @@ public abstract class TypeBuilder implem
      * @throws NullArgumentException if {@code text} is null.
      * @throws IllegalArgumentException if {@code text} is empty.
      */
-    final void ensureNonEmpty(final String name, final String text) {
+    final void ensureNonEmpty(final String name, final CharSequence text) {
         if (text == null) {
             throw new NullArgumentException(errors().getString(Errors.Keys.NullArgument_1, name));
         }

Modified: sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/internal/feature/AttributeConvention.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/internal/feature/AttributeConvention.java?rev=1791992&r1=1791991&r2=1791992&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/internal/feature/AttributeConvention.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-feature/src/main/java/org/apache/sis/internal/feature/AttributeConvention.java [UTF-8] Wed Apr 19 21:51:31 2017
@@ -19,11 +19,8 @@ package org.apache.sis.internal.feature;
 import org.opengis.util.LocalName;
 import org.opengis.util.ScopedName;
 import org.opengis.util.GenericName;
-import org.opengis.util.NameFactory;
-import org.opengis.util.NameSpace;
 import org.opengis.referencing.crs.CoordinateReferenceSystem;
-import org.apache.sis.internal.system.DefaultFactories;
-import org.apache.sis.internal.util.Constants;
+import org.apache.sis.util.iso.Names;
 import org.apache.sis.util.Static;
 
 // Branch-dependent imports
@@ -41,10 +38,10 @@ import org.opengis.feature.Property;
  * appropriate "real" property in the feature.
  *
  * <div class="note"><b>Example:</b>
- * one of the most frequently used synthetic property is {@code "@identifier"}, which contains a unique
+ * one of the most frequently used synthetic property is {@code "sis:identifier"}, which contains a unique
  * identifier (or primary key) for the feature. This property is usually (but not necessarily)
  * a {@linkplain org.apache.sis.feature.FeatureOperations#link link to an existing attribute}.
- * By using the {@code "@identifier"} alias, users do not need to know the name of the "real" attribute.
+ * By using the {@code "sis:identifier"} alias, users do not need to know the name of the "real" attribute.
  * </div>
  *
  * This class defines names for two kinds of usage:
@@ -66,15 +63,15 @@ import org.opengis.feature.Property;
  *
  * @author  Johann Sorel (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.7
+ * @version 0.8
  * @since   0.7
  * @module
  */
 public final class AttributeConvention extends Static {
     /**
-     * Namespace of all names defined by SIS convention.
+     * Scope of all names defined by SIS convention.
      */
-    private static final GenericName NAMESPACE;
+    private static final LocalName SCOPE;
 
     /**
      * Conventional name for a property used as a unique identifier.
@@ -90,7 +87,7 @@ public final class AttributeConvention e
      * <p>The {@linkplain org.apache.sis.feature.DefaultAttributeType#getValueClass() value class} is usually
      * {@link String}, {@link Integer}, {@link java.util.UUID} or other types commonly used as identifiers.</p>
      */
-    public static final LocalName IDENTIFIER_PROPERTY;
+    public static final ScopedName IDENTIFIER_PROPERTY;
 
     /**
      * Conventional name for a property containing the geometric object to use by default.
@@ -107,7 +104,7 @@ public final class AttributeConvention e
      *
      * @see #isGeometryAttribute(IdentifiedType)
      */
-    public static final LocalName GEOMETRY_PROPERTY;
+    public static final ScopedName GEOMETRY_PROPERTY;
 
     /**
      * Conventional name for fetching the envelope encompassing all geometries in a feature. Most {@code FeatureType}s
@@ -120,7 +117,7 @@ public final class AttributeConvention e
      * <p>The {@linkplain org.apache.sis.feature.DefaultAttributeType#getValueClass() value class} should be
      * {@link org.opengis.geometry.Envelope}.</p>
      */
-    public static final LocalName ENVELOPE_PROPERTY;
+    public static final ScopedName ENVELOPE_PROPERTY;
 
     /**
      * Conventional name for fetching the Coordinate Reference System (CRS) of a geometry or a coverage.
@@ -139,7 +136,7 @@ public final class AttributeConvention e
      *
      * @see #getCRSCharacteristic(Property)
      */
-    public static final LocalName CRS_CHARACTERISTIC;
+    public static final ScopedName CRS_CHARACTERISTIC;
 
     /**
      * Conventional name for fetching the maximal length of string values.
@@ -153,7 +150,7 @@ public final class AttributeConvention e
      *
      * @see #getMaximalLengthCharacteristic(Property)
      */
-    public static final LocalName MAXIMAL_LENGTH_CHARACTERISTIC;
+    public static final ScopedName MAXIMAL_LENGTH_CHARACTERISTIC;
 
     /**
      * Conventional name for fetching the enumeration of valid values.
@@ -162,18 +159,15 @@ public final class AttributeConvention e
      * {@linkplain org.apache.sis.feature.DefaultAttributeType#characteristics() characteristic} associated
      * to the attribute on which the restriction applies.
      */
-    public static final LocalName VALID_VALUES_CHARACTERISTIC;
-
+    public static final GenericName VALID_VALUES_CHARACTERISTIC;
     static {
-        final NameFactory factory = DefaultFactories.forBuildin(NameFactory.class);
-        NAMESPACE                     = factory.createGenericName(null, "Apache", Constants.SIS);
-        final NameSpace ns            = factory.createNameSpace(NAMESPACE, null);
-        IDENTIFIER_PROPERTY           = factory.createLocalName(ns, "@identifier");
-        GEOMETRY_PROPERTY             = factory.createLocalName(ns, "@geometry");
-        ENVELOPE_PROPERTY             = factory.createLocalName(ns, "@envelope");
-        CRS_CHARACTERISTIC            = factory.createLocalName(ns, "@crs");
-        MAXIMAL_LENGTH_CHARACTERISTIC = factory.createLocalName(ns, "@maximalLength");
-        VALID_VALUES_CHARACTERISTIC   = factory.createLocalName(ns, "@validValues");
+        SCOPE                         = Names.createLocalName("Apache", null, "sis");
+        IDENTIFIER_PROPERTY           = Names.createScopedName(SCOPE, null, "identifier");
+        GEOMETRY_PROPERTY             = Names.createScopedName(SCOPE, null, "geometry");
+        ENVELOPE_PROPERTY             = Names.createScopedName(SCOPE, null, "envelope");
+        CRS_CHARACTERISTIC            = Names.createScopedName(SCOPE, null, "crs");
+        MAXIMAL_LENGTH_CHARACTERISTIC = Names.createScopedName(SCOPE, null, "maximalLength");
+        VALID_VALUES_CHARACTERISTIC   = Names.createScopedName(SCOPE, null, "validValues");
     }
 
     /**
@@ -195,17 +189,14 @@ public final class AttributeConvention e
      * @param  name  the name of the property or characteristic to test, or {@code null}.
      * @return {@code true} if the given name is non-null and in the SIS namespace.
      */
-    public static boolean contains(final GenericName name) {
-        if (name == null) {
-            return false;
-        }
-        final GenericName scope;
-        if (name instanceof ScopedName) {
-            scope = ((ScopedName) name).path().toFullyQualifiedName();
-        } else {
-            scope = name.scope().name();
+    public static boolean contains(GenericName name) {
+        while (name instanceof ScopedName) {
+            if (SCOPE.equals(((ScopedName) name).path())) {
+                return true;
+            }
+            name = ((ScopedName) name).tail();
         }
-        return NAMESPACE.equals(scope);
+        return false;
     }
 
     /**

Modified: sis/branches/JDK7/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultFeatureTypeTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultFeatureTypeTest.java?rev=1791992&r1=1791991&r2=1791992&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultFeatureTypeTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultFeatureTypeTest.java [UTF-8] Wed Apr 19 21:51:31 2017
@@ -48,6 +48,14 @@ import org.opengis.feature.AttributeType
 @DependsOn(DefaultAttributeTypeTest.class)
 public final strictfp class DefaultFeatureTypeTest extends TestCase {
     /**
+     * Convenience method returning the given name in a a property map
+     * to be given to {@link AbstractIdentifiedType} constructor.
+     */
+    private static Map<String,?> name(final Object name) {
+        return singletonMap(AbstractIdentifiedType.NAME_KEY, name);
+    }
+
+    /**
      * Creates a simple feature type without super-types.
      * The feature contains the following attributes:
      *
@@ -62,10 +70,7 @@ public final strictfp class DefaultFeatu
         final Map<String,Object> identification = new HashMap<>();
         final DefaultAttributeType<String>  city       = DefaultAttributeTypeTest.city(identification);
         final DefaultAttributeType<Integer> population = DefaultAttributeTypeTest.population(identification);
-
-        identification.clear();
-        assertNull(identification.put(DefaultFeatureType.NAME_KEY, "City"));
-        return new DefaultFeatureType(identification, false, null, city, population);
+        return new DefaultFeatureType(name("City"), false, null, city, population);
     }
 
     /**
@@ -81,7 +86,7 @@ public final strictfp class DefaultFeatu
      * @return the feature for an university city.
      */
     public static DefaultFeatureType universityCity() {
-        return new DefaultFeatureType(singletonMap(DefaultFeatureType.NAME_KEY, "University city"), false,
+        return new DefaultFeatureType(name("University city"), false,
                 new DefaultFeatureType[] {city()}, DefaultAttributeTypeTest.universities());
     }
 
@@ -98,7 +103,7 @@ public final strictfp class DefaultFeatu
      * @return the feature for a capital.
      */
     public static DefaultFeatureType capital() {
-        return new DefaultFeatureType(singletonMap(DefaultFeatureType.NAME_KEY, "Capital"), false,
+        return new DefaultFeatureType(name("Capital"), false,
                 new DefaultFeatureType[] {city()}, DefaultAttributeTypeTest.parliament());
     }
 
@@ -121,10 +126,8 @@ public final strictfp class DefaultFeatu
         assertNull(identification.put(DefaultFeatureType.NAME_KEY + "_fr", "Métropole"));
         return new DefaultFeatureType(identification, false,
                 new DefaultFeatureType[] {city()},
-                new DefaultAttributeType<>(singletonMap(DefaultAttributeType.NAME_KEY, "region"),
-                        CharSequence.class, 1, 1, null),
-                new DefaultAttributeType<>(singletonMap(DefaultAttributeType.NAME_KEY, "isGlobal"),
-                        Boolean.class, 1, 1, null));
+                new DefaultAttributeType<>(name("region"), CharSequence.class, 1, 1, null),
+                new DefaultAttributeType<>(name("isGlobal"),    Boolean.class, 1, 1, null));
     }
 
     /**
@@ -142,13 +145,13 @@ public final strictfp class DefaultFeatu
     private static DefaultFeatureType worldMetropolis(final DefaultFeatureType metropolis,
             final DefaultFeatureType universityCity, final DefaultAttributeType<?> temperature, final Class<?> regionType)
     {
-        return new DefaultFeatureType(singletonMap(DefaultFeatureType.NAME_KEY, "World metropolis"), false,
-                new DefaultFeatureType[] {          // Super types
+        return new DefaultFeatureType(name("World metropolis"), false,
+                new DefaultFeatureType[] {                                                  // Super types
                     metropolis,
                     universityCity
                 },
-                new DefaultAttributeType<?>[] {     // Properties
-                    new DefaultAttributeType<>(singletonMap(DefaultAttributeType.NAME_KEY, "region"), regionType, 1, 1, null),
+                new DefaultAttributeType<?>[] {                                             // Properties
+                    new DefaultAttributeType<>(name("region"), regionType, 1, 1, null),
                     temperature
                 });
     }
@@ -267,12 +270,10 @@ public final strictfp class DefaultFeatu
             final int minimumOccurs, final int maximumOccurs)
     {
         final DefaultAttributeType<String> festival = new DefaultAttributeType<>(
-                singletonMap(DefaultAttributeType.NAME_KEY, "festival"),
-                String.class, minimumOccurs, maximumOccurs, null);
+                name("festival"), String.class, minimumOccurs, maximumOccurs, null);
 
         final DefaultFeatureType complex = new DefaultFeatureType(
-                singletonMap(DefaultAttributeType.NAME_KEY, "Festival"),
-                false, null, city, population, festival);
+                name("Festival"), false, null, city, population, festival);
 
         assertUnmodifiable(complex);
         final Collection<PropertyType> properties = complex.getProperties(false);
@@ -300,16 +301,12 @@ public final strictfp class DefaultFeatu
     @Test
     @DependsOnMethod("testSimple")
     public void testNameCollision() {
-        final DefaultAttributeType<String> city = new DefaultAttributeType<>(
-                singletonMap(DefaultAttributeType.NAME_KEY, "name"), String.class, 1, 1, null);
-        final DefaultAttributeType<Integer> cityId = new DefaultAttributeType<>(
-                singletonMap(DefaultAttributeType.NAME_KEY, "name"), Integer.class, 1, 1, null);
-        final DefaultAttributeType<Integer> population = new DefaultAttributeType<>(
-                singletonMap(DefaultAttributeType.NAME_KEY, "population"), Integer.class, 1, 1, null);
+        final DefaultAttributeType<String>  city       = new DefaultAttributeType<>(name("name"),       String.class,  1, 1, null);
+        final DefaultAttributeType<Integer> cityId     = new DefaultAttributeType<>(name("name"),       Integer.class, 1, 1, null);
+        final DefaultAttributeType<Integer> population = new DefaultAttributeType<>(name("population"), Integer.class, 1, 1, null);
 
-        final Map<String,String> identification = singletonMap(DefaultAttributeType.NAME_KEY, "City");
         try {
-            final Object t = new DefaultFeatureType(identification, false, null, city, population, cityId);
+            final Object t = new DefaultFeatureType(name("City"), false, null, city, population, cityId);
             fail("Duplicated attribute names shall not be allowed:\n" + t);
         } catch (IllegalArgumentException e) {
             final String message = e.getMessage();
@@ -329,17 +326,16 @@ public final strictfp class DefaultFeatu
     public void testQualifiedNames() {
         final NameFactory factory = DefaultFactories.forBuildin(NameFactory.class);
         final DefaultAttributeType<String> city = new DefaultAttributeType<>(
-                singletonMap(DefaultAttributeType.NAME_KEY, factory.createGenericName(null, "ns1", "name")),
+                name(factory.createGenericName(null, "ns1", "name")),
                 String.class, 1, 1, null);
         final DefaultAttributeType<Integer> cityId = new DefaultAttributeType<>(
-                singletonMap(DefaultAttributeType.NAME_KEY, factory.createGenericName(null, "ns2", "name")),
+                name(factory.createGenericName(null, "ns2", "name")),
                 Integer.class, 1, 1, null);
         final DefaultAttributeType<Integer> population = new DefaultAttributeType<>(
-                singletonMap(DefaultAttributeType.NAME_KEY, factory.createGenericName(null, "ns1", "population")),
+                name(factory.createGenericName(null, "ns1", "population")),
                 Integer.class, 1, 1, null);
         final DefaultFeatureType feature = new DefaultFeatureType(
-                singletonMap(DefaultAttributeType.NAME_KEY, "City"),
-                false, null, city, cityId, population);
+                name("City"), false, null, city, cityId, population);
 
         final Iterator<PropertyType> it = feature.getProperties(false).iterator();
         assertSame ("properties[0]", city,       it.next());
@@ -362,13 +358,35 @@ public final strictfp class DefaultFeatu
     }
 
     /**
+     * Tests two names having the same tip, but where only one of the two names have a namespace.
+     *
+     * @since 0.8
+     */
+    @Test
+    @DependsOnMethod("testQualifiedNames")
+    public void testQualifiedAndUnqualifiedNames() {
+        final NameFactory factory = DefaultFactories.forBuildin(NameFactory.class);
+        final DefaultAttributeType<String> a1 = new DefaultAttributeType<>(
+                name(factory.createGenericName(null, "sis", "identifier")),
+                String.class, 1, 1, null);
+        final DefaultAttributeType<String> a2 = new DefaultAttributeType<>(
+                name(factory.createGenericName(null, "identifier")),
+                String.class, 1, 1, null);
+        final DefaultFeatureType feature = new DefaultFeatureType(
+                name("City"), false, null, a1, a2);
+
+        assertSame("sis:identifier", a1, feature.getProperty("sis:identifier"));
+        assertSame(    "identifier", a2, feature.getProperty(    "identifier"));
+    }
+
+    /**
      * Tests inclusion of a property of kind operation.
      */
     @Test
     public void testOperationProperty() {
-        final Map<String,String> featureName = singletonMap(DefaultFeatureType.NAME_KEY, "Identified city");
-        final Map<String,String> identifierName = singletonMap(DefaultAttributeType.NAME_KEY, "identifier");
-        final DefaultFeatureType[] parent = {city()};
+        final Map<String,?> featureName    = name("Identified city");
+        final Map<String,?> identifierName = name("identifier");
+        final DefaultFeatureType[] parent  = {city()};
         final DefaultFeatureType city = new DefaultFeatureType(featureName, false,
                 parent, new LinkOperation(identifierName, parent[0].getProperty("city")));
         assertPropertiesEquals(city, true, "city", "population", "identifier");
@@ -428,9 +446,9 @@ public final strictfp class DefaultFeatu
         final DefaultFeatureType metropolis   = metropolis();
         final DefaultFeatureType capital      = capital();      // Tested by 'testComplex()'.
         final DefaultFeatureType metroCapital = new DefaultFeatureType(
-                singletonMap(DefaultFeatureType.NAME_KEY, "Metropolis and capital"), false,
+                name("Metropolis and capital"), false,
                 new DefaultFeatureType[] {metropolis, capital},
-                new DefaultAttributeType<>(singletonMap(DefaultAttributeType.NAME_KEY, "country"),
+                new DefaultAttributeType<>(name("country"),
                         String.class, 1, 1, null));
 
         assertUnmodifiable(metroCapital);
@@ -508,7 +526,7 @@ public final strictfp class DefaultFeatu
     @DependsOnMethod("testPropertyOverride")
     public void testPropertyDuplication() {
         DefaultFeatureType city = city();
-        city = new DefaultFeatureType(singletonMap(DefaultFeatureType.NAME_KEY, "New-City"),
+        city = new DefaultFeatureType(name("New-City"),
                 false, new DefaultFeatureType[] {city()}, city.getProperty("city"));
 
         assertPropertiesEquals(city, false);

Modified: sis/branches/JDK7/core/sis-feature/src/test/java/org/apache/sis/feature/EnvelopeOperationTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-feature/src/test/java/org/apache/sis/feature/EnvelopeOperationTest.java?rev=1791992&r1=1791991&r2=1791992&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-feature/src/test/java/org/apache/sis/feature/EnvelopeOperationTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-feature/src/test/java/org/apache/sis/feature/EnvelopeOperationTest.java [UTF-8] Wed Apr 19 21:51:31 2017
@@ -59,7 +59,7 @@ public final strictfp class EnvelopeOper
      *   <li>{@code classes} as a {@link Polygon}</li>
      *   <li>{@code climbing wall} as a {@link Point}</li>
      *   <li>{@code gymnasium} as a {@link Polygon}</li>
-     *   <li>{@code @geometry} as a link to the default geometry</li>
+     *   <li>{@code sis:geometry} as a link to the default geometry</li>
      *   <li>{@code bounds} as the feature envelope attribute.</li>
      * </ul>
      *

Modified: sis/branches/JDK7/core/sis-feature/src/test/java/org/apache/sis/feature/builder/FeatureTypeBuilderTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-feature/src/test/java/org/apache/sis/feature/builder/FeatureTypeBuilderTest.java?rev=1791992&r1=1791991&r2=1791992&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-feature/src/test/java/org/apache/sis/feature/builder/FeatureTypeBuilderTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-feature/src/test/java/org/apache/sis/feature/builder/FeatureTypeBuilderTest.java [UTF-8] Wed Apr 19 21:51:31 2017
@@ -168,8 +168,8 @@ public final strictfp class FeatureTypeB
 
     /**
      * Tests {@link FeatureTypeBuilder#addAttribute(Class)} where one attribute is an identifier that already has
-     * the {@code "@identifier"} name. This is called "anonymous" because identifiers with an explicit name in the
-     * data file should use that name instead in the feature type.
+     * the {@code "sis:identifier"} name. This is called "anonymous" because identifiers with an explicit name in
+     * the data file should use that name instead in the feature type.
      */
     @Test
     @DependsOnMethod("testAddIdentifierAndGeometry")
@@ -191,8 +191,8 @@ public final strictfp class FeatureTypeB
 
     /**
      * Tests {@link FeatureTypeBuilder#addAttribute(Class)} where one attribute is a geometry that already has
-     * the {@code "@geometry"} name. This is called "anonymous" because geometries with an explicit name in the
-     * data file should use that name instead in the feature type.
+     * the {@code "sis:geometry"} name. This is called "anonymous" because geometries with an explicit name in
+     * the data file should use that name instead in the feature type.
      */
     @Test
     @DependsOnMethod("testAddIdentifierAndGeometry")
@@ -245,7 +245,7 @@ public final strictfp class FeatureTypeB
 
         final FeatureType type = builder.build();
         builder = new FeatureTypeBuilder(type);
-        assertEquals("name",       "City", builder.getName().toString());
+        assertEquals("name", "City", builder.getName().toString());
         assertEquals("superTypes", 0, builder.getSuperTypes().length);
 
         final Iterator<PropertyTypeBuilder> it = builder.properties().iterator();

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/SQLTranslator.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/SQLTranslator.java?rev=1791992&r1=1791991&r2=1791992&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/SQLTranslator.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/SQLTranslator.java [UTF-8] Wed Apr 19 21:51:31 2017
@@ -101,7 +101,7 @@ import org.apache.sis.internal.jdk8.JDK8
  * @author  Martin Desruisseaux (IRD)
  * @author  Didier Richard (IGN)
  * @author  John Grange
- * @version 0.7
+ * @version 0.8
  * @since   0.7
  * @module
  */
@@ -161,14 +161,21 @@ public class SQLTranslator {
      *       In such case, {@code SQLTranslator} will tries to automatically detect the schema.</li>
      * </ul>
      *
-     * <p><b>Consider this field as final.</b> This field is non-final only for construction convenience,
-     * or for updating after the {@link EPSGInstaller} class created the database.</p>
+     * <b>Consider this field as final.</b> This field is non-final only for construction convenience,
+     * or for updating after the {@link EPSGInstaller} class created the database.
      *
      * @see #getSchema()
      */
     private String schema;
 
     /**
+     * Whether the table names are prefixed by {@value #TABLE_PREFIX}. When installed by Apache SIS,
+     * the table names are not prefixed if the tables are stored in a schema. However the dataset may
+     * have been installed manually by users following different rules.
+     */
+    private boolean isPrefixed;
+
+    /**
      * Mapping from words used in the MS-Access database to words used in the ANSI versions of EPSG databases.
      * A word may be a table or a column name, or a part of it. A table name may consist in many words separated
      * by spaces.
@@ -256,6 +263,7 @@ public class SQLTranslator {
             try (ResultSet result = md.getTables(catalog, schema, table, null)) {
                 if (result.next()) {
                     isTableFound    = true;
+                    isPrefixed      = table.startsWith(TABLE_PREFIX);
                     quoteTableNames = (i == MIXED_CASE);
                     do {
                         catalog = result.getString("TABLE_CAT");
@@ -405,7 +413,7 @@ public class SQLTranslator {
                 if (quoteTableNames) {
                     ansi.append(quote);
                 }
-                if (schema == null) {
+                if (isPrefixed) {
                     ansi.append(TABLE_PREFIX);
                 }
                 if (quoteTableNames) {

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/UnitFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/UnitFormat.java?rev=1791992&r1=1791991&r2=1791992&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/UnitFormat.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/UnitFormat.java [UTF-8] Wed Apr 19 21:51:31 2017
@@ -59,7 +59,7 @@ import org.apache.sis.util.iso.DefaultNa
  *
  * <div class="section">NetCDF unit symbols</div>
  * The attributes in NetCDF files often merge the axis direction with the angular unit,
- * as in {@code "degrees_east"} or {@code "degrees_north"}.
+ * as in {@code "degrees_east"}, {@code "degrees_north"} or {@code "Degrees North"}.
  * This class ignores those suffixes and unconditionally returns {@link Units#DEGREE} for all axis directions.
  * In particular, the units for {@code "degrees_west"} and {@code "degrees_east"} do <strong>not</strong> have
  * opposite sign. It is caller responsibility to handle the direction of axes associated to NetCDF units.

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractName.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractName.java?rev=1791992&r1=1791991&r2=1791992&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractName.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractName.java [UTF-8] Wed Apr 19 21:51:31 2017
@@ -271,7 +271,7 @@ public abstract class AbstractName imple
      * Returns the separator to write before the given name. If the scope of the given name
      * is a {@link DefaultNameSpace} instance, then this method returns its head separator.
      * We really want {@link DefaultNameSpace#headSeparator}, not {@link DefaultNameSpace#separator}.
-     * See {@link DefaultNameSpace#child(CharSequence)} for details.
+     * See {@link DefaultNameSpace#child(CharSequence, String)} for details.
      *
      * @param  name  the name after which to write a separator.
      * @return the separator to write after the given name.
@@ -341,7 +341,7 @@ public abstract class AbstractName imple
 
     /**
      * An international string built from a snapshot of {@link GenericName}.
-     * This class is immutable is the list given to the constructor is immutable.
+     * This class is immutable if the list given to the constructor is immutable.
      *
      * @author  Martin Desruisseaux (IRD, Geomatys)
      * @version 0.3

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultLocalName.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultLocalName.java?rev=1791992&r1=1791991&r2=1791992&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultLocalName.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultLocalName.java [UTF-8] Wed Apr 19 21:51:31 2017
@@ -113,7 +113,7 @@ public class DefaultLocalName extends Ab
     protected DefaultLocalName(NameSpace scope, final CharSequence name) {
         ArgumentChecks.ensureNonNull("name", name);
         if (scope == GlobalNameSpace.GLOBAL) {
-            scope = null; // Handled specially by scope().
+            scope = null;                                       // Handled specially by scope().
         }
         this.scope = scope;
         if (name instanceof InternationalString) {
@@ -323,7 +323,7 @@ public class DefaultLocalName extends Ab
      */
     private Object readResolve() throws ObjectStreamException {
         final DefaultNameSpace ns;
-        if (scope == null) { // Not a bug: readResolve() is intentionally private.
+        if (scope == null) {                    // Not a bug: readResolve() is intentionally private.
             ns = GlobalNameSpace.GLOBAL;
         } else if (scope instanceof DefaultNameSpace) {
             ns = (DefaultNameSpace) scope;

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameSpace.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameSpace.java?rev=1791992&r1=1791991&r2=1791992&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameSpace.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultNameSpace.java [UTF-8] Wed Apr 19 21:51:31 2017
@@ -51,7 +51,7 @@ import static org.apache.sis.util.Argume
  * remain safe to call from multiple threads and do not change any public {@code NameSpace} state.
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
- * @version 0.3
+ * @version 0.8
  *
  * @see DefaultScopedName
  * @see DefaultLocalName
@@ -345,10 +345,11 @@ public class DefaultNameSpace implements
      * but it is {@code "."} for all children ({@code "opengeospatial"} and {@code "org"}).</p>
      *
      * @param  name  the name of the child namespace.
+     * @param  sep   the separator to use (typically {@link #separator}).
      * @return the child namespace. It may be an existing instance.
      */
-    final DefaultNameSpace child(final CharSequence name) {
-        return child(key(name), name, separator, separator);
+    final DefaultNameSpace child(final CharSequence name, final String sep) {
+        return child(key(name), name, sep, sep);
     }
 
     /**

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultScopedName.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultScopedName.java?rev=1791992&r1=1791991&r2=1791992&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultScopedName.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultScopedName.java [UTF-8] Wed Apr 19 21:51:31 2017
@@ -49,7 +49,7 @@ import org.apache.sis.internal.util.Unmo
  * state.
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
- * @version 0.3
+ * @version 0.8
  *
  * @see DefaultNameSpace
  * @see DefaultLocalName
@@ -133,7 +133,7 @@ public class DefaultScopedName extends A
         do {
             ArgumentChecks.ensureNonNullElement("names", i, name);
             locals[i++] = new DefaultLocalName(ns, name);
-            ns = ns.child(name);
+            ns = ns.child(name, ns.separator);
             name = it.next();
         } while (it.hasNext());
         /*
@@ -148,7 +148,7 @@ public class DefaultScopedName extends A
             tip.fullyQualified = fullyQualified = this;
         }
         locals[i++] = tip;
-        if (i != size) { // Paranoiac check.
+        if (i != size) {                                        // Paranoiac check.
             throw new ConcurrentModificationException(Errors.format(Errors.Keys.UnexpectedChange_1, "names"));
         }
         // Following line is safe because 'parsedNames' type is <? extends LocalName>.
@@ -162,15 +162,13 @@ public class DefaultScopedName extends A
      * @param path  the first part to concatenate.
      * @param tail  the second part to concatenate.
      */
-    @SuppressWarnings("SuspiciousToArrayCall")
     protected DefaultScopedName(final GenericName path, final GenericName tail) {
         ArgumentChecks.ensureNonNull("path", path);
         ArgumentChecks.ensureNonNull("tail", tail);
         final List<? extends LocalName> parsedPath = path.getParsedNames();
         final List<? extends LocalName> parsedTail = tail.getParsedNames();
         int index = parsedPath.size();
-        LocalName[] locals = new LocalName[index + parsedTail.size()];
-        locals = parsedPath.toArray(locals);
+        final LocalName[] locals = parsedPath.toArray(new LocalName[index + parsedTail.size()]);
         /*
          * We have copied the LocalNames from the path unconditionally.  Now we need to process the
          * LocalNames from the tail. If the tail scope follows the path scope, we can just copy the
@@ -193,7 +191,7 @@ public class DefaultScopedName extends A
             if (path instanceof LocalName) {
                 this.tail = tail;
             }
-            while (true) {
+            for (;;) {
                 locals[index++] = name;
                 if (!it.hasNext()) break;
                 name = it.next();
@@ -205,8 +203,8 @@ public class DefaultScopedName extends A
              */
             DefaultNameSpace scope = DefaultNameSpace.castOrCopy(lastScope);
             CharSequence label = name(lastName);
-            while (true) {
-                scope = scope.child(label);
+            for (;;) {
+                scope = scope.child(label, scope.separator);
                 label = name(name);
                 name  = new DefaultLocalName(scope, label);
                 locals[index++] = name;
@@ -225,6 +223,38 @@ public class DefaultScopedName extends A
     }
 
     /**
+     * Constructs a scoped name as the concatenation of the given generic name with a single character sequence.
+     * The scope of the new name will be the scope of the {@code path} argument.
+     * The tail is a local name created from the given character sequence.
+     *
+     * @param path       the first part to concatenate.
+     * @param separator  the separator between the head and the tail,
+     *                   or {@code null} for inheriting the same separator than the given path.
+     * @param tail       the second part to concatenate.
+     *
+     * @see Names#createScopedName(GenericName, String, CharSequence)
+     *
+     * @since 0.8
+     */
+    protected DefaultScopedName(final GenericName path, final String separator, final CharSequence tail) {
+        /*
+         * Following is the same code than DefaultScopedName(GenericName, GenericName)
+         * after simplification we can do because we create the LocalName ourselves.
+         */
+        ArgumentChecks.ensureNonNull("path", path);
+        ArgumentChecks.ensureNonNull("tail", tail);
+        final List<? extends LocalName> parsedPath = path.getParsedNames();
+        final int index = parsedPath.size();
+        final LocalName[] locals = parsedPath.toArray(new LocalName[index + 1]);
+        final LocalName lastName = locals[index - 1];
+        DefaultNameSpace scope = DefaultNameSpace.castOrCopy(lastName.scope());
+        scope = scope.child(name(lastName), separator != null ? separator : scope.separator);
+        locals[index] = new DefaultLocalName(scope, tail);
+        parsedNames = UnmodifiableArrayList.wrap(locals);
+        this.path = path;
+    }
+
+    /**
      * Returns the name to be given to {@link DefaultLocalName} constructors.
      */
     private static CharSequence name(final GenericName name) {

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/Names.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/Names.java?rev=1791992&r1=1791991&r2=1791992&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/Names.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/Names.java [UTF-8] Wed Apr 19 21:51:31 2017
@@ -20,6 +20,7 @@ import java.util.Collections;
 import org.opengis.util.TypeName;
 import org.opengis.util.LocalName;
 import org.opengis.util.MemberName;
+import org.opengis.util.ScopedName;
 import org.opengis.util.GenericName;
 import org.opengis.util.NameSpace;
 import org.opengis.util.NameFactory;
@@ -127,6 +128,24 @@ public final class Names extends Static
     }
 
     /**
+     * Constructs a scoped name as the concatenation of the given generic name with a single character sequence.
+     * The scope of the new name will be the scope of the {@code path} argument.
+     * The tail is a local name created from the given character sequence.
+     *
+     * @param  scope      the first part to concatenate.
+     * @param  separator  the separator between the head and the tail,
+     *                    or {@code null} for inheriting the same separator than the given scope.
+     * @param  name       the second part to concatenate.
+     * @return a scoped name in the given namespace.
+     *
+     * @since 0.8
+     */
+    public static ScopedName createScopedName(final GenericName scope, final String separator, final CharSequence name) {
+        // Current version does not perform any caching, but this is something we could add in the future.
+        return new DefaultScopedName(scope, separator, name);
+    }
+
+    /**
      * Creates a name which is local in the given namespace.
      * The character sequences can be either {@link String} or {@link InternationalString} instances.
      * Those character sequences are taken verbatim; they are <em>not</em> parsed into their components.

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/package-info.java?rev=1791992&r1=1791991&r2=1791992&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/package-info.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/package-info.java [UTF-8] Wed Apr 19 21:51:31 2017
@@ -107,7 +107,7 @@
  * </table>
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
- * @version 0.7
+ * @version 0.8
  * @since   0.3
  * @module
  */



Mime
View raw message