sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1762553 - in /sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources: Errors.java IndexedResourceBundle.java KeyConstants.java Messages.java Vocabulary.java
Date Tue, 27 Sep 2016 20:00:54 GMT
Author: desruisseaux
Date: Tue Sep 27 20:00:54 2016
New Revision: 1762553

URL: http://svn.apache.org/viewvc?rev=1762553&view=rev
Log:
Make IndexedResourceBundle.getKeyConstants() protected for allowing us to declare resource
bundles outside the org.apache.sis.resources package.
The intend is to start splitting some resources on a per-module basis instead of putting everything
in sis-utility.
This commit contains also opportunistic javadoc formatting.

Modified:
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/KeyConstants.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java?rev=1762553&r1=1762552&r2=1762553&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
[UTF-8] Tue Sep 27 20:00:54 2016
@@ -37,7 +37,7 @@ import org.opengis.util.InternationalStr
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.3
- * @version 0.4
+ * @version 0.8
  * @module
  */
 public final class Errors extends IndexedResourceBundle {
@@ -1290,9 +1290,11 @@ public final class Errors extends Indexe
 
     /**
      * Returns the handle for the {@code Keys} constants.
+     *
+     * @return a handler for the constants declared in the inner {@code Keys} class.
      */
     @Override
-    final KeyConstants getKeyConstants() {
+    protected KeyConstants getKeyConstants() {
         return Keys.INSTANCE;
     }
 
@@ -1312,7 +1314,7 @@ public final class Errors extends Indexe
      * for the {@link #LOCALE_KEY} entry. If the given map is null, or contains no entry
for the locale key,
      * or the value is not an instance of {@link Locale}, then this method fallback on the
default locale.
      *
-     * @param  properties the map of properties, or {@code null} if none.
+     * @param  properties  the map of properties, or {@code null} if none.
      * @return resources in the given locale.
      * @throws MissingResourceException if resources can't be found.
      *
@@ -1325,7 +1327,7 @@ public final class Errors extends Indexe
     /**
      * Gets a string for the given key from this resource bundle or one of its parents.
      *
-     * @param  key the key for the desired string.
+     * @param  key  the key for the desired string.
      * @return the string for the given key.
      * @throws MissingResourceException if no object for the given key can be found.
      */

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java?rev=1762553&r1=1762552&r2=1762553&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/IndexedResourceBundle.java
[UTF-8] Tue Sep 27 20:00:54 2016
@@ -72,7 +72,7 @@ import org.apache.sis.internal.util.Patc
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.3
- * @version 0.7
+ * @version 0.8
  * @module
  */
 public class IndexedResourceBundle extends ResourceBundle implements Localized {
@@ -127,8 +127,8 @@ public class IndexedResourceBundle exten
     /**
      * Constructs a new resource bundle loading data from the given UTF file.
      *
-     * @param resources The path of the binary file containing resources, or {@code null}
if
-     *        there is no resources. The resources may be a file or an entry in a JAR file.
+     * @param  resources  the path of the binary file containing resources, or {@code null}
if
+     *         there is no resources. The resources may be a file or an entry in a JAR file.
      */
     protected IndexedResourceBundle(final URL resources) {
         this.resources = resources;
@@ -137,10 +137,10 @@ public class IndexedResourceBundle exten
     /**
      * Returns a resource bundle of the specified class.
      *
-     * @param  <T>     The resource bundle class.
-     * @param  base    The resource bundle class.
-     * @param  locale  The locale, or {@code null} for the default locale.
-     * @return Resources in the given locale.
+     * @param  <T>      the resource bundle class.
+     * @param  base     the resource bundle class.
+     * @param  locale   the locale, or {@code null} for the default locale.
+     * @return resources in the given locale.
      * @throws MissingResourceException if resources can't be found.
      *
      * @see Vocabulary#getResources(Locale)
@@ -158,13 +158,11 @@ public class IndexedResourceBundle exten
 
     /**
      * Returns a handler for the constants declared in the inner {@code Keys} class.
-     * Subclasses defined in the {@code org.apache.sis.util.resources} package
-     * override this method for efficiency. However the default implementation
-     * should work for other cases (we don't want to expose too much internal API).
+     * Subclasses should override this method for efficiency, but this is not mandatory.
      *
-     * @return A handler for the constants declared in the inner {@code Keys} class.
+     * @return a handler for the constants declared in the inner {@code Keys} class.
      */
-    KeyConstants getKeyConstants() {
+    protected KeyConstants getKeyConstants() {
         Class<?> keysClass = KeyConstants.class;
         for (final Class<?> inner : getClass().getClasses()) {
             if ("Keys".equals(inner.getSimpleName())) {
@@ -178,7 +176,7 @@ public class IndexedResourceBundle exten
     /**
      * Returns an enumeration of the keys.
      *
-     * @return All keys in this resource bundle.
+     * @return all keys in this resource bundle.
      */
     @Override
     public final Enumeration<String> getKeys() {
@@ -225,7 +223,7 @@ public class IndexedResourceBundle exten
      * Lists resources to the specified stream. If a resource has more than one line, only
      * the first line will be written. This method is used mostly for debugging purposes.
      *
-     * @param  out The destination stream.
+     * @param  out  the destination stream.
      * @throws IOException if an output operation failed.
      */
     @Debug
@@ -261,9 +259,9 @@ public class IndexedResourceBundle exten
     /**
      * Ensures that resource values are loaded. If they are not, loads them immediately.
      *
-     * @param  key Key for the requested resource, or {@code null} if all resources
+     * @param  key  key for the requested resource, or {@code null} if all resources
      *         are requested. This key is used mostly for constructing messages.
-     * @return The resources.
+     * @return the resources.
      * @throws MissingResourceException if this method failed to load resources.
      */
     private String[] ensureLoaded(final String key) throws MissingResourceException {
@@ -342,7 +340,7 @@ public class IndexedResourceBundle exten
      * Returns null if this resource bundle does not contain an
      * object for the given key.
      *
-     * @param  key the key for the desired object
+     * @param  key  the key for the desired object
      * @throws NullPointerException if {@code key} is {@code null}
      * @return the object for the given key, or null
      */
@@ -384,7 +382,7 @@ public class IndexedResourceBundle exten
      * <div class="note"><b>Note:</b>
      * If more cases are added, remember to update class and package javadoc.</div>
      *
-     * @param  arguments The object to check.
+     * @param  arguments  the object to check.
      * @return {@code arguments} as an array, eventually with some elements replaced.
      */
     private Object[] toArray(final Object arguments) {
@@ -449,9 +447,9 @@ public class IndexedResourceBundle exten
      * Gets a string for the given key and appends "…" to it.
      * This method is typically used for creating menu items.
      *
-     * @param  key The key for the desired string.
-     * @return The string for the given key.
-     * @throws MissingResourceException If no object for the given key can be found.
+     * @param  key  the key for the desired string.
+     * @return the string for the given key.
+     * @throws MissingResourceException if no object for the given key can be found.
      */
     public final String getMenuLabel(final short key) throws MissingResourceException {
         return getString(key) + '…';
@@ -463,8 +461,8 @@ public class IndexedResourceBundle exten
      * No space is added after the string; it is up to the caller to add such space if needed.
      *
      * @param  key The key for the desired string.
-     * @return The string for the given key.
-     * @throws MissingResourceException If no object for the given key can be found.
+     * @return the string for the given key.
+     * @throws MissingResourceException if no object for the given key can be found.
      */
     public final String getLabel(final short key) throws MissingResourceException {
         String label = getString(key);
@@ -479,9 +477,9 @@ public class IndexedResourceBundle exten
     /**
      * Gets a string for the given key from this resource bundle or one of its parents.
      *
-     * @param  key The key for the desired string.
-     * @return The string for the given key.
-     * @throws MissingResourceException If no object for the given key can be found.
+     * @param  key  the key for the desired string.
+     * @return the string for the given key.
+     * @throws MissingResourceException if no object for the given key can be found.
      */
     public final String getString(final short key) throws MissingResourceException {
         return getString(String.valueOf(key));
@@ -502,10 +500,10 @@ public class IndexedResourceBundle exten
      * {@link MessageFormat}, all occurrences of "{0}", "{1}", "{2}" in the resource string
will be
      * replaced by {@code arg0[0]}, {@code arg0[1]}, {@code arg0[2]}, etc.
      *
-     * @param  key The key for the desired string.
-     * @param  arg0 A single object or an array of objects to be formatted and substituted.
-     * @return The string for the given key.
-     * @throws MissingResourceException If no object for the given key can be found.
+     * @param  key   the key for the desired string.
+     * @param  arg0  a single object or an array of objects to be formatted and substituted.
+     * @return the string for the given key.
+     * @throws MissingResourceException if no object for the given key can be found.
      *
      * @see #getString(String)
      * @see #getString(short,Object,Object)
@@ -546,11 +544,11 @@ public class IndexedResourceBundle exten
      * Gets a string for the given key and replaces all occurrences of "{0}",
      * "{1}", with values of {@code arg0}, {@code arg1}, etc.
      *
-     * @param  key The key for the desired string.
-     * @param  arg0 Value to substitute for "{0}".
-     * @param  arg1 Value to substitute for "{1}".
-     * @return The formatted string for the given key.
-     * @throws MissingResourceException If no object for the given key can be found.
+     * @param  key   the key for the desired string.
+     * @param  arg0  value to substitute for "{0}".
+     * @param  arg1  value to substitute for "{1}".
+     * @return the formatted string for the given key.
+     * @throws MissingResourceException if no object for the given key can be found.
      */
     public final String getString(final short  key,
                                   final Object arg0,
@@ -563,12 +561,12 @@ public class IndexedResourceBundle exten
      * Gets a string for the given key and replaces all occurrences of "{0}",
      * "{1}", with values of {@code arg0}, {@code arg1}, etc.
      *
-     * @param  key The key for the desired string.
-     * @param  arg0 Value to substitute for "{0}".
-     * @param  arg1 Value to substitute for "{1}".
-     * @param  arg2 Value to substitute for "{2}".
-     * @return The formatted string for the given key.
-     * @throws MissingResourceException If no object for the given key can be found.
+     * @param  key   the key for the desired string.
+     * @param  arg0  value to substitute for "{0}".
+     * @param  arg1  value to substitute for "{1}".
+     * @param  arg2  value to substitute for "{2}".
+     * @return the formatted string for the given key.
+     * @throws MissingResourceException if no object for the given key can be found.
      */
     public final String getString(final short  key,
                                   final Object arg0,
@@ -582,13 +580,13 @@ public class IndexedResourceBundle exten
      * Gets a string for the given key and replaces all occurrences of "{0}",
      * "{1}", with values of {@code arg0}, {@code arg1}, etc.
      *
-     * @param  key The key for the desired string.
-     * @param  arg0 Value to substitute for "{0}".
-     * @param  arg1 Value to substitute for "{1}".
-     * @param  arg2 Value to substitute for "{2}".
-     * @param  arg3 Value to substitute for "{3}".
-     * @return The formatted string for the given key.
-     * @throws MissingResourceException If no object for the given key can be found.
+     * @param  key   the key for the desired string.
+     * @param  arg0  value to substitute for "{0}".
+     * @param  arg1  value to substitute for "{1}".
+     * @param  arg2  value to substitute for "{2}".
+     * @param  arg3  value to substitute for "{3}".
+     * @return the formatted string for the given key.
+     * @throws MissingResourceException if no object for the given key can be found.
      */
     public final String getString(final short  key,
                                   final Object arg0,
@@ -603,14 +601,14 @@ public class IndexedResourceBundle exten
      * Gets a string for the given key and replaces all occurrences of "{0}",
      * "{1}", with values of {@code arg0}, {@code arg1}, etc.
      *
-     * @param  key The key for the desired string.
-     * @param  arg0 Value to substitute for "{0}".
-     * @param  arg1 Value to substitute for "{1}".
-     * @param  arg2 Value to substitute for "{2}".
-     * @param  arg3 Value to substitute for "{3}".
-     * @param  arg4 Value to substitute for "{4}".
-     * @return The formatted string for the given key.
-     * @throws MissingResourceException If no object for the given key can be found.
+     * @param  key   the key for the desired string.
+     * @param  arg0  value to substitute for "{0}".
+     * @param  arg1  value to substitute for "{1}".
+     * @param  arg2  value to substitute for "{2}".
+     * @param  arg3  value to substitute for "{3}".
+     * @param  arg4  value to substitute for "{4}".
+     * @return the formatted string for the given key.
+     * @throws MissingResourceException if no object for the given key can be found.
      */
     public final String getString(final short  key,
                                   final Object arg0,
@@ -625,9 +623,9 @@ public class IndexedResourceBundle exten
     /**
      * Gets a localized log record.
      *
-     * @param  level The log record level.
-     * @param  key   The resource key.
-     * @return The log record.
+     * @param  level  the log record level.
+     * @param  key    the resource key.
+     * @return the log record.
      */
     public final LogRecord getLogRecord(final Level level, final short key) {
         final LogRecord record = new LogRecord(level, getKeyConstants().getKeyName(key));
@@ -639,10 +637,10 @@ public class IndexedResourceBundle exten
     /**
      * Gets a localized log record.
      *
-     * @param  level The log record level.
-     * @param  key   The resource key.
-     * @param  arg0  The parameter for the log message, which may be an array.
-     * @return The log record.
+     * @param  level  the log record level.
+     * @param  key    the resource key.
+     * @param  arg0   the parameter for the log message, which may be an array.
+     * @return the log record.
      */
     public final LogRecord getLogRecord(final Level level, final short key,
                                         final Object arg0)
@@ -655,11 +653,11 @@ public class IndexedResourceBundle exten
     /**
      * Gets a localized log record.
      *
-     * @param  level The log record level.
-     * @param  key   The resource key.
-     * @param  arg0  The first parameter.
-     * @param  arg1  The second parameter.
-     * @return The log record.
+     * @param  level  the log record level.
+     * @param  key    the resource key.
+     * @param  arg0   the first parameter.
+     * @param  arg1   the second parameter.
+     * @return the log record.
      */
     public final LogRecord getLogRecord(final Level level, final short key,
                                         final Object arg0,
@@ -671,12 +669,12 @@ public class IndexedResourceBundle exten
     /**
      * Gets a localized log record.
      *
-     * @param  level The log record level.
-     * @param  key   The resource key.
-     * @param  arg0  The first parameter.
-     * @param  arg1  The second parameter.
-     * @param  arg2  The third parameter.
-     * @return The log record.
+     * @param  level  the log record level.
+     * @param  key    the resource key.
+     * @param  arg0   the first parameter.
+     * @param  arg1   the second parameter.
+     * @param  arg2   the third parameter.
+     * @return the log record.
      */
     public final LogRecord getLogRecord(final Level level, final short key,
                                         final Object arg0,
@@ -689,13 +687,13 @@ public class IndexedResourceBundle exten
     /**
      * Gets a localized log record.
      *
-     * @param  level The log record level.
-     * @param  key   The resource key.
-     * @param  arg0  The first parameter.
-     * @param  arg1  The second parameter.
-     * @param  arg2  The third parameter.
-     * @param  arg3  The fourth parameter.
-     * @return The log record.
+     * @param  level  the log record level.
+     * @param  key    the resource key.
+     * @param  arg0   the first parameter.
+     * @param  arg1   the second parameter.
+     * @param  arg2   the third parameter.
+     * @param  arg3   the fourth parameter.
+     * @return the log record.
      */
     public final LogRecord getLogRecord(final Level level, final short key,
                                         final Object arg0,
@@ -710,8 +708,8 @@ public class IndexedResourceBundle exten
      * Returns the locale specified in the given map, or {@code null} if none.
      * Value of unexpected type are ignored.
      *
-     * @param  properties The map of properties, or {@code null} if none.
-     * @return The locale found in the given map, or {@code null} if none.
+     * @param  properties  the map of properties, or {@code null} if none.
+     * @return the locale found in the given map, or {@code null} if none.
      *
      * @since 0.4
      */
@@ -729,7 +727,7 @@ public class IndexedResourceBundle exten
      * Returns a string representation of this object.
      * This method is for debugging purposes only.
      *
-     * @return A string representation of this resources bundle.
+     * @return a string representation of this resources bundle.
      */
     @Debug
     @Override

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/KeyConstants.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/KeyConstants.java?rev=1762553&r1=1762552&r2=1762553&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/KeyConstants.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/KeyConstants.java
[UTF-8] Tue Sep 27 20:00:54 2016
@@ -29,11 +29,13 @@ import org.apache.sis.util.CharSequences
  * from its name and conversely.
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @since   0.3
- * @version 0.4
+ * @since   0.8
+ * @version 0.8
  * @module
+ *
+ * @see IndexedResourceBundle#getKeyConstants()
  */
-class KeyConstants {
+public class KeyConstants {
     /**
      * The class that defines key constants.
      */
@@ -68,6 +70,7 @@ class KeyConstants {
      * The keys names are used only in rare situation, like {@link IndexedResourceBundle#list(Appendable)}
      * or in log records.
      */
+    @SuppressWarnings("ReturnOfCollectionOrArrayField")
     final synchronized String[] getKeyNames() {
         if (keys == null) {
             String[] names;

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java?rev=1762553&r1=1762552&r2=1762553&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java
[UTF-8] Tue Sep 27 20:00:54 2016
@@ -28,7 +28,7 @@ import org.opengis.util.InternationalStr
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.3
- * @version 0.4
+ * @version 0.8
  * @module
  */
 public final class Messages extends IndexedResourceBundle {
@@ -289,7 +289,7 @@ public final class Messages extends Inde
     /**
      * Constructs a new resource bundle loading data from the given UTF file.
      *
-     * @param resources The path of the binary file containing resources, or {@code null}
if
+     * @param resources  the path of the binary file containing resources, or {@code null}
if
      *        there is no resources. The resources may be a file or an entry in a JAR file.
      */
     Messages(final URL resources) {
@@ -298,17 +298,19 @@ public final class Messages extends Inde
 
     /**
      * Returns the handle for the {@code Keys} constants.
+     *
+     * @return a handler for the constants declared in the inner {@code Keys} class.
      */
     @Override
-    final KeyConstants getKeyConstants() {
+    protected KeyConstants getKeyConstants() {
         return Keys.INSTANCE;
     }
 
     /**
      * Returns resources in the given locale.
      *
-     * @param  locale The locale, or {@code null} for the default locale.
-     * @return Resources in the given locale.
+     * @param  locale  the locale, or {@code null} for the default locale.
+     * @return resources in the given locale.
      * @throws MissingResourceException if resources can't be found.
      */
     public static Messages getResources(final Locale locale) throws MissingResourceException
{
@@ -318,9 +320,9 @@ public final class Messages extends Inde
     /**
      * Gets a string for the given key from this resource bundle or one of its parents.
      *
-     * @param  key The key for the desired string.
-     * @return The string for the given key.
-     * @throws MissingResourceException If no object for the given key can be found.
+     * @param  key  the key for the desired string.
+     * @return the string for the given key.
+     * @throws MissingResourceException if no object for the given key can be found.
      */
     public static String format(final short key) throws MissingResourceException {
         return getResources(null).getString(key);
@@ -330,10 +332,10 @@ public final class Messages extends Inde
      * Gets a string for the given key are replace all occurrence of "{0}"
      * with values of {@code arg0}.
      *
-     * @param  key The key for the desired string.
-     * @param  arg0 Value to substitute to "{0}".
-     * @return The formatted string for the given key.
-     * @throws MissingResourceException If no object for the given key can be found.
+     * @param  key   the key for the desired string.
+     * @param  arg0  value to substitute to "{0}".
+     * @return the formatted string for the given key.
+     * @throws MissingResourceException if no object for the given key can be found.
      */
     public static String format(final short  key,
                                 final Object arg0) throws MissingResourceException
@@ -345,11 +347,11 @@ public final class Messages extends Inde
      * Gets a string for the given key are replace all occurrence of "{0}",
      * "{1}", with values of {@code arg0}, {@code arg1}.
      *
-     * @param  key The key for the desired string.
-     * @param  arg0 Value to substitute to "{0}".
-     * @param  arg1 Value to substitute to "{1}".
-     * @return The formatted string for the given key.
-     * @throws MissingResourceException If no object for the given key can be found.
+     * @param  key   the key for the desired string.
+     * @param  arg0  value to substitute to "{0}".
+     * @param  arg1  value to substitute to "{1}".
+     * @return the formatted string for the given key.
+     * @throws MissingResourceException if no object for the given key can be found.
      */
     public static String format(final short  key,
                                 final Object arg0,
@@ -362,12 +364,12 @@ public final class Messages extends Inde
      * Gets a string for the given key are replace all occurrence of "{0}",
      * "{1}", with values of {@code arg0}, {@code arg1}, etc.
      *
-     * @param  key The key for the desired string.
-     * @param  arg0 Value to substitute to "{0}".
-     * @param  arg1 Value to substitute to "{1}".
-     * @param  arg2 Value to substitute to "{2}".
-     * @return The formatted string for the given key.
-     * @throws MissingResourceException If no object for the given key can be found.
+     * @param  key   the key for the desired string.
+     * @param  arg0  value to substitute to "{0}".
+     * @param  arg1  value to substitute to "{1}".
+     * @param  arg2  value to substitute to "{2}".
+     * @return the formatted string for the given key.
+     * @throws MissingResourceException if no object for the given key can be found.
      */
     public static String format(final short  key,
                                 final Object arg0,
@@ -381,13 +383,13 @@ public final class Messages extends Inde
      * Gets a string for the given key are replace all occurrence of "{0}",
      * "{1}", with values of {@code arg0}, {@code arg1}, etc.
      *
-     * @param  key The key for the desired string.
-     * @param  arg0 Value to substitute to "{0}".
-     * @param  arg1 Value to substitute to "{1}".
-     * @param  arg2 Value to substitute to "{2}".
-     * @param  arg3 Value to substitute to "{3}".
-     * @return The formatted string for the given key.
-     * @throws MissingResourceException If no object for the given key can be found.
+     * @param  key   the key for the desired string.
+     * @param  arg0  value to substitute to "{0}".
+     * @param  arg1  value to substitute to "{1}".
+     * @param  arg2  value to substitute to "{2}".
+     * @param  arg3  value to substitute to "{3}".
+     * @return the formatted string for the given key.
+     * @throws MissingResourceException if no object for the given key can be found.
      */
     public static String format(final short  key,
                                 final Object arg0,
@@ -417,8 +419,8 @@ public final class Messages extends Inde
      * validity. If the key is invalid, then a {@link MissingResourceException} may be thrown
      * when a {@link InternationalString#toString(Locale)} method is invoked.
      *
-     * @param  key The key for the desired string.
-     * @return An international string for the given key.
+     * @param  key  the key for the desired string.
+     * @return an international string for the given key.
      */
     public static InternationalString formatInternational(final short key) {
         return new International(key);
@@ -434,9 +436,9 @@ public final class Messages extends Inde
      * of a temporary array. There is no risk of confusion since the two methods delegate
their
      * work to the same {@code format} method anyway.</div>
      *
-     * @param  key The key for the desired string.
-     * @param  arg Values to substitute to "{0}".
-     * @return An international string for the given key.
+     * @param  key  the key for the desired string.
+     * @param  arg  values to substitute to "{0}".
+     * @return an international string for the given key.
      */
     public static InternationalString formatInternational(final short key, final Object arg)
{
         return new International(key, arg);
@@ -447,9 +449,9 @@ public final class Messages extends Inde
      * validity. If the key is invalid, then a {@link MissingResourceException} may be thrown
      * when a {@link InternationalString#toString(Locale)} method is invoked.
      *
-     * @param  key  The key for the desired string.
-     * @param  args Values to substitute to "{0}", "{1}", <i>etc</i>.
-     * @return An international string for the given key.
+     * @param  key   the key for the desired string.
+     * @param  args  values to substitute to "{0}", "{1}", <i>etc</i>.
+     * @return an international string for the given key.
      */
     public static InternationalString formatInternational(final short key, final Object...
args) {
         return new International(key, args);

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java?rev=1762553&r1=1762552&r2=1762553&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
[UTF-8] Tue Sep 27 20:00:54 2016
@@ -29,7 +29,7 @@ import org.opengis.util.InternationalStr
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.3
- * @version 0.7
+ * @version 0.8
  * @module
  */
 public final class Vocabulary extends IndexedResourceBundle {
@@ -635,7 +635,7 @@ public final class Vocabulary extends In
     /**
      * Constructs a new resource bundle loading data from the given UTF file.
      *
-     * @param resources The path of the binary file containing resources, or {@code null}
if
+     * @param resources  the path of the binary file containing resources, or {@code null}
if
      *        there is no resources. The resources may be a file or an entry in a JAR file.
      */
     Vocabulary(final URL resources) {
@@ -644,17 +644,19 @@ public final class Vocabulary extends In
 
     /**
      * Returns the handle for the {@code Keys} constants.
+     *
+     * @return a handler for the constants declared in the inner {@code Keys} class.
      */
     @Override
-    final KeyConstants getKeyConstants() {
+    protected KeyConstants getKeyConstants() {
         return Keys.INSTANCE;
     }
 
     /**
      * Returns resources in the given locale.
      *
-     * @param  locale The locale, or {@code null} for the default locale.
-     * @return Resources in the given locale.
+     * @param  locale  the locale, or {@code null} for the default locale.
+     * @return resources in the given locale.
      * @throws MissingResourceException if resources can't be found.
      */
     public static Vocabulary getResources(final Locale locale) throws MissingResourceException
{
@@ -679,9 +681,9 @@ public final class Vocabulary extends In
     /**
      * Gets a string for the given key from this resource bundle or one of its parents.
      *
-     * @param  key The key for the desired string.
-     * @return The string for the given key.
-     * @throws MissingResourceException If no object for the given key can be found.
+     * @param  key  the key for the desired string.
+     * @return the string for the given key.
+     * @throws MissingResourceException if no object for the given key can be found.
      */
     public static String format(final short key) throws MissingResourceException {
         return getResources((Locale) null).getString(key);
@@ -706,8 +708,8 @@ public final class Vocabulary extends In
      * validity. If the key is invalid, then a {@link MissingResourceException} may be thrown
      * when a {@link InternationalString#toString(Locale)} method is invoked.
      *
-     * @param  key The key for the desired string.
-     * @return An international string for the given key.
+     * @param  key  the key for the desired string.
+     * @return an international string for the given key.
      */
     public static InternationalString formatInternational(final short key) {
         return new International(key);
@@ -723,9 +725,9 @@ public final class Vocabulary extends In
      * of a temporary array. There is no risk of confusion since the two methods delegate
their
      * work to the same {@code format} method anyway.</div>
      *
-     * @param  key The key for the desired string.
-     * @param  arg Values to substitute to "{0}".
-     * @return An international string for the given key.
+     * @param  key  the key for the desired string.
+     * @param  arg  values to substitute to "{0}".
+     * @return an international string for the given key.
      */
     public static InternationalString formatInternational(final short key, final Object arg)
{
         return new International(key, arg);
@@ -736,9 +738,9 @@ public final class Vocabulary extends In
      * validity. If the key is invalid, then a {@link MissingResourceException} may be thrown
      * when a {@link InternationalString#toString(Locale)} method is invoked.
      *
-     * @param  key  The key for the desired string.
-     * @param  args Values to substitute to "{0}", "{1}", <i>etc</i>.
-     * @return An international string for the given key.
+     * @param  key   the key for the desired string.
+     * @param  args  values to substitute to "{0}", "{1}", <i>etc</i>.
+     * @return an international string for the given key.
      */
     public static InternationalString formatInternational(final short key, final Object...
args) {
         return new International(key, args);



Mime
View raw message