com.buildforge.services.common.text
Class Localizer.Generic
java.lang.Object
com.buildforge.services.common.text.Localizer.Generic
- All Implemented Interfaces:
- Localizer
- Enclosing interface:
- Localizer
public static class Localizer.Generic
- extends java.lang.Object
- implements Localizer
This is the default implementation of the Localizer
interface. If another localizer has been selected for use by
calling MessageDBO.setLocalizer(Localizer)
, but that
localizer returns null, then this localizer is used
as a fallback.
The generic localizer renders the information from the message as-is
instead of relying on a translated format string. The format is
identical to that used by MessageDBO.toString()
.
Method Summary |
java.lang.String |
render(MessageDBO msg)
Localize the message to a string, if possible. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INSTANCE
public static final Localizer.Generic INSTANCE
- Singleton
render
public java.lang.String render(MessageDBO msg)
- Description copied from interface:
Localizer
- Localize the message to a string, if possible.
- Specified by:
render
in interface Localizer
- Parameters:
msg
- the message to localize
- Returns:
- the localized string, or null if the message
could not be successfully localized