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
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringprotected static I18NConnectorprotected static CCConfigurationObject<I18NConnector>protected static I18N -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) entrySet()static ResourceBundleThis method may only be called within a request processing.static ResourceBundleThis method may only be called within a request processing.static StringbooleanisEmpty()keySet()voidstatic voidsetI18NConnector(I18NConnector connector) Allows to pass an own mechanism for retrieving texts that are used within CaptainCasa default screens (e.g.intsize()values()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
containsValuein interfaceMap<String,String>
-
entrySet
-
isEmpty
public boolean isEmpty() -
keySet
-
put
-
putAll
-
remove
-
size
public int size() -
values
-
containsKey
- Specified by:
containsKeyin 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.
-