Package org.eclnt.jsfserver.i18n
Class I18N
java.lang.Object
org.eclnt.jsfserver.i18n.I18N
- All Implemented Interfaces:
Serializable
,Map<String,
String>
Access of localized information that is required within the JSF
server processing part of Enterprise Client. This class is
instanciated as managed bean with request scope under the name
"eclnti18n".
The class does nothing else than delegating the get-method to a ResourceBundle:
public String get(Object key)
{
ResourceBundle rb = ResourceBundle.getBundle(s_bundle,HttpSessionAccess.getCurrentFacesContext().getViewRoot().getLocale());
return rb.getString(key.toString());
}
All other functions of Map are not implemented, i.e. this is pure read-only map in which only the get-method is implemented. As consequence it can be nicely used in expressions, e.g. "#{eclnt18n.OKPopup_ok}".
You can override this class by overriding the s_bundle member in the constructor of your class and point it to your resource bundle.
Attention: keys must not contain any "." because this is interpreted as property separator by JSF expressions.
The class does nothing else than delegating the get-method to a ResourceBundle:
public String get(Object key)
{
ResourceBundle rb = ResourceBundle.getBundle(s_bundle,HttpSessionAccess.getCurrentFacesContext().getViewRoot().getLocale());
return rb.getString(key.toString());
}
All other functions of Map are not implemented, i.e. this is pure read-only map in which only the get-method is implemented. As consequence it can be nicely used in expressions, e.g. "#{eclnt18n.OKPopup_ok}".
You can override this class by overriding the s_bundle member in the constructor of your class and point it to your resource bundle.
Attention: keys must not contain any "." because this is interpreted as property separator by JSF expressions.
- See Also:
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
protected static I18NConnector
protected static CCConfigurationObject<I18NConnector>
protected static I18N
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
boolean
containsKey
(Object key) boolean
containsValue
(Object value) entrySet()
static ResourceBundle
This method may only be called within a request processing.static ResourceBundle
This method may only be called within a request processing.static String
boolean
isEmpty()
keySet()
void
static void
setI18NConnector
(I18NConnector connector) Allows to pass an own mechanism for retrieving texts that are used within CaptainCasa default screens (e.g.int
size()
values()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
I18N_RESOURCEBUNDLE
- See Also:
-
I18N_RESOURCEMANAGER_RESOURCENAME
- See Also:
-
s_connector
-
s_connectorCO
-
s_instance
-
-
Constructor Details
-
I18N
public I18N()
-
-
Method Details
-
setI18NConnector
Allows to pass an own mechanism for retrieving texts that are used within CaptainCasa default screens (e.g. Yes/No Popup). By default the literals are read from property files that are kept in elcntjsfserver.jar. But: you can provide the literal information on your own as well, by setting this interface.
After setting the interface, I18N will first call your connector and only uses the default literals if your connector returns back null. -
clear
public void clear() -
containsValue
- Specified by:
containsValue
in interfaceMap<String,
String>
-
entrySet
-
isEmpty
public boolean isEmpty() -
keySet
-
put
-
putAll
-
remove
-
size
public int size() -
values
-
containsKey
- Specified by:
containsKey
in interfaceMap<String,
String>
-
get
-
get
-
getString
-
getBundle
This method may only be called within a request processing. -
getBundle
This method may only be called within a request processing.
-