You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2014/05/29 23:47:37 UTC

svn commit: r1598418 - in /sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/iso: AbstractName.java Names.java

Author: desruisseaux
Date: Thu May 29 21:47:37 2014
New Revision: 1598418

URL: http://svn.apache.org/r1598418
Log:
Omit for now the convenience method without separator argument.
Javadoc formatting.

Modified:
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractName.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/iso/Names.java

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractName.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractName.java?rev=1598418&r1=1598417&r2=1598418&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractName.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/iso/AbstractName.java [UTF-8] Thu May 29 21:47:37 2014
@@ -39,7 +39,7 @@ import java.util.Objects;
  * Names shall be <em>immutable</em> and thread-safe. A name can be local to a namespace.
  * See the {@linkplain org.apache.sis.util.iso package javadoc} for an illustration of name anatomy.
  *
- * <p>The easiest way to create a name is to use the {@link Names#createLocalName(CharSequence, CharSequence)}
+ * <p>The easiest way to create a name is to use the {@link Names#createLocalName(CharSequence, String, CharSequence)}
  * convenience static method. That method supports the common case where the name is made only of a
  * (<var>namespace</var>, <var>local part</var>) pair of strings. However generic names allows finer grain.
  * For example the above-cited strings can both be split into smaller name components.

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/iso/Names.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/iso/Names.java?rev=1598418&r1=1598417&r2=1598418&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/iso/Names.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/iso/Names.java [UTF-8] Thu May 29 21:47:37 2014
@@ -87,8 +87,7 @@ public final class Names extends Static 
     }
 
     /**
-     * Creates a name which is local in the given namespace, using the
-     * {@linkplain DefaultNameSpace#DEFAULT_SEPARATOR default separator}.
+     * 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.
      *
@@ -99,32 +98,23 @@ public final class Names extends Static 
      *   <tr><td>{@code localPart}</td> <td><code>name.{@linkplain DefaultLocalName#toString() toString()}</code></td></tr>
      * </table>
      *
-     * @param  namespace The namespace, or {@code null} for the global namespace.
-     * @param  localPart The name which is locale in the given namespace.
-     * @return A local name in the given namespace.
-     */
-    public static LocalName createLocalName(final CharSequence namespace, final CharSequence localPart) {
-        ensureNonNull("localPart", localPart);
-        return DefaultFactories.NAMES.createLocalName(createNameSpace(namespace, null), localPart);
-    }
-
-    /**
-     * Creates a name which is local in the given namespace, using the given separator.
-     * This method performs the same work than {@link #createLocalName(CharSequence, CharSequence)},
-     * except that the namespace and the local part are separated by the given separator.
-     *
      * <div class="note"><b>Example:</b>
      * for a name created by {@code create("http://www.opengis.net/gml/srs/epsg.xml", "#", "4326")}:
-     * <ul>
-     *   <li><code>name.{@linkplain DefaultLocalName#scope() scope()}</code>
-     *       returns the {@code "http://www.opengis.net/gml/srs/epsg.xml"} namespace.</li>
-     *   <li><code>name.{@linkplain DefaultLocalName#toString() toString()}</code>
-     *       returns the {@code "4326"} string.</li>
-     *   <li><code>name.{@linkplain DefaultLocalName#toFullyQualifiedName() toFullyQualifiedName()}</code>
-     *       returns the {@code "http://www.opengis.net/gml/srs/epsg.xml#4326"} name.
-     *   <li><code>{@linkplain #toExpandedString(GenericName) toExpandedString}(name)</code>
-     *       returns the {@code "{http://www.opengis.net/gml/srs/epsg.xml}4326"} string.
-     * </ul></div>
+     * <blockquote><table class="compact" summary="Examples of return values for a name built by this method.">
+     *   <tr><td>• <code>name.{@linkplain DefaultLocalName#scope() scope()}</code></td>
+     *       <td>returns the {@code "http://www.opengis.net/gml/srs/epsg.xml"} namespace.</td></tr>
+     *   <tr><td>• <code>name.{@linkplain DefaultLocalName#toString() toString()}</code></td>
+     *       <td>returns the {@code "4326"} string.</td></tr>
+     *   <tr><td>• <code>name.{@linkplain DefaultLocalName#toFullyQualifiedName() toFullyQualifiedName()}</code></td>
+     *       <td>returns the {@code "http://www.opengis.net/gml/srs/epsg.xml#4326"} name.
+     *   <tr><td>• <code>{@linkplain #toExpandedString(GenericName) toExpandedString}(name)</code></td>
+     *       <td>returns the {@code "{http://www.opengis.net/gml/srs/epsg.xml}4326"} string.</td></tr>
+     * </table></blockquote></div>
+     *
+     * <b>Performance note:</b> this method is okay for <em>casual</em> use. If many names need to be created in the
+     * same namespace, a more efficient method is {@link DefaultNameFactory#createLocalName(NameSpace, CharSequence)}
+     * for avoiding unnecessary creations of the same {@code NameSpace} object. The later can be obtained by creating
+     * a first name using this {@code createLocalName} method, then invoke {@link GenericName#scope()}.
      *
      * @param  namespace The namespace, or {@code null} for the global namespace.
      * @param  separator The separator between the namespace and the local part.