StringResourceAccess (JGoodies Common 1.8 API)
Date: 2015-01-03

com.jgoodies.common.internal

## Class StringResourceAccess

- java.lang.Object
- - com.jgoodies.common.internal.StringResourceAccess

-     public final class StringResourceAccess
      extends Object

  Provides access to String resources

  Note: This class is not part of the public JGoodies Common API. It is intended for implementation purposes only. The class's API may change at any time.

  Since:
    1.8
  Author:
    Karsten Lentzsch

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `StringResourceAccess()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static String` | `getResourceString(StringResourceAccessor accessor, String key, Object... args)` Looks up and returns a String associated with the given resource key from the given StringResourceAccessor.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### StringResourceAccess

          public StringResourceAccess()

  - ### Method Detail

    - #### getResourceString

          public static String getResourceString(StringResourceAccessor accessor,
                                 String key,
                                 Object... args)

      Looks up and returns a String associated with the given resource key from the given StringResourceAccessor. If no arguments are provided, the plain String is returned. Otherwise the string will be formatted using `String.format` with the given arguments.

      If the resource is missing, the key itself is returned.

      Parameters:
        `accessor` - maps keys to resource Strings
        `key` - the key in the resource bundle
        `args` - optional format arguments forwarded to `String#format`
      Returns:
        the String value provided by the accessor for the given resource key formatted with the optional arguments - if any
      See Also:
        `String.format(String, Object...)`

Copyright © 2009-2014 JGoodies Software GmbH. All Rights Reserved.