jimmc.util
Interface ResourceSource
- All Known Implementing Classes:
- RootsBase
- public interface ResourceSource
A source for strings from resource files.
Method Summary |
java.lang.String |
getResourceFormatted(java.lang.String name,
java.lang.Object arg)
Get a string from a resource and pass it to MessageFormat.format
with the specified one argument put into a new Object[1],
returning the result. |
java.lang.String |
getResourceFormatted(java.lang.String name,
java.lang.Object[] args)
Get a string from a resource and pass it to MessageFormat.format
with the specified arguments, returning the result. |
java.lang.String |
getResourceString(java.lang.String name)
Get a string from resources. |
getResourceString
public java.lang.String getResourceString(java.lang.String name)
- Get a string from resources.
- Parameters:
name
- The resource name.- Returns:
- The value of the resource,
or the name if no value is found.
getResourceFormatted
public java.lang.String getResourceFormatted(java.lang.String name,
java.lang.Object[] args)
- Get a string from a resource and pass it to MessageFormat.format
with the specified arguments, returning the result.
- Parameters:
name
- The resource name.args
- The args to MessageFormat.format.- Returns:
- The formatted resource string.
getResourceFormatted
public java.lang.String getResourceFormatted(java.lang.String name,
java.lang.Object arg)
- Get a string from a resource and pass it to MessageFormat.format
with the specified one argument put into a new Object[1],
returning the result.
- Parameters:
name
- The resource name.arg
- The argument to MessageFormat.format.- Returns:
- The formatted resource string.