com.groiss.component
Class Resource
java.lang.Object
com.groiss.component.Resource
- All Implemented Interfaces:
- java.io.Serializable
public class Resource
- extends java.lang.Object
- implements java.io.Serializable
Provides resource strings in several languages.
- See Also:
- Serialized Form
Constructor Summary |
Resource(java.lang.String strings,
java.lang.String errors)
|
Resource(java.lang.String strings,
java.lang.String errors,
java.util.Locale l)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
resname
protected java.lang.String resname
errname
protected java.lang.String errname
defaultLocale
protected java.util.Locale defaultLocale
Resource
public Resource(java.lang.String strings,
java.lang.String errors)
Resource
public Resource(java.lang.String strings,
java.lang.String errors,
java.util.Locale l)
getString
public java.lang.String getString(java.lang.String key)
getString
public java.lang.String getString(java.lang.String key,
java.lang.Object[] arguments)
getString
public java.lang.String getString(java.lang.String key,
java.util.Locale l)
getErrorMessage
public java.lang.String getErrorMessage(java.lang.String key)
getErrorMessage
public java.lang.String getErrorMessage(java.lang.String key,
java.lang.Object[] arguments)
getErrorMessage
public java.lang.String getErrorMessage(java.lang.String key,
java.util.Locale l)
loadAndLocalizeResource
public java.lang.String loadAndLocalizeResource(java.lang.String resource)
loadAndLocalizeResource
public java.lang.String loadAndLocalizeResource(java.lang.String resource,
java.util.Locale l)
localize
public java.lang.String localize(java.lang.String resource,
java.util.Locale l)
- Localize a string containing keys in following syntax: @@@key@@.
- Parameters:
resource
- the string to localizel
- the used locale
- Returns:
- the localized string
getDefaultLocale
public java.util.Locale getDefaultLocale()
setDefaultLocale
public void setDefaultLocale(java.util.Locale newDefault)
getErrorsName
public java.lang.String getErrorsName()
getStringsName
public java.lang.String getStringsName()
getResourceBundle
protected java.util.ResourceBundle getResourceBundle(java.util.Locale l,
java.lang.String bundleName)
createLocalizedList
public java.util.List<java.lang.String> createLocalizedList(java.lang.String... args)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
@enterprise 8.0.22989 Copyright © 2001-2017 Groiss Informatics GmbH. All Rights Reserved.