Package com.jgoodies.common.internal
Class StringResourceAccess
java.lang.Object
com.jgoodies.common.internal.StringResourceAccess
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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
getResourceString
(StringResourceAccessor accessor, String key, Object... args) Looks up and returns a String associated with the given resource key from the given StringResourceAccessor.
-
Constructor Details
-
StringResourceAccess
public StringResourceAccess()
-
-
Method Details
-
getResourceString
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 usingString.format
with the given arguments.If the resource is missing, the key itself is returned.
- Parameters:
accessor
- maps keys to resource Stringskey
- the key in the resource bundleargs
- optional format arguments forwarded toString#format
- Returns:
- the String value provided by the accessor for the given resource key formatted with the optional arguments - if any
- See Also:
-