|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.elca.el4j.services.i18n.RewritingMessageSource
public class RewritingMessageSource
A MessageSource based on MessageRewriters.
| Field Summary | |
|---|---|
protected MessageRewriter.Rule[] |
m_additionalRules
A list of additional rules to be used by every locale. |
protected String[] |
m_basenames
The base names. |
protected Map<Locale,MessageRewriter> |
m_rewriters
The already loaded rewriters. |
protected static org.slf4j.Logger |
s_logger
The logger. |
| Constructor Summary | |
|---|---|
RewritingMessageSource()
|
|
| Method Summary | |
|---|---|
protected String |
assembleFileName(String... parts)
Assembles the filename consisting of the given parts, separated by '_'. |
protected MessageRewriter |
createRewriter(Locale loc)
Creates a new MessageRewriter for the given locale. |
String |
getMessage(MessageSourceResolvable resolvable,
Locale locale)
|
String |
getMessage(String code,
Object[] args,
Locale locale)
|
String |
getMessage(String code,
Object[] args,
String defaultMessage,
Locale locale)
|
void |
setAdditionalRules(MessageRewriter.Rule... rules)
Sets m_additionalRules. |
void |
setBasenames(String... basenames)
Like ResourceBundleMessageSource.setBasenames(String[]). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected String[] m_basenames
setBasenames(String[])
protected MessageRewriter.Rule[] m_additionalRules
protected Map<Locale,MessageRewriter> m_rewriters
protected static final org.slf4j.Logger s_logger
| Constructor Detail |
|---|
public RewritingMessageSource()
| Method Detail |
|---|
public void setBasenames(String... basenames)
ResourceBundleMessageSource.setBasenames(String[]).
public void setAdditionalRules(MessageRewriter.Rule... rules)
m_additionalRules.
protected String assembleFileName(String... parts)
parts - the parts to assembles. A part may be null, in which case
it is omitted.
protected MessageRewriter createRewriter(Locale loc)
loc - .
public String getMessage(MessageSourceResolvable resolvable,
Locale locale)
throws NoSuchMessageException
getMessage in interface MessageSourceNoSuchMessageException
public String getMessage(String code,
Object[] args,
Locale locale)
throws NoSuchMessageException
getMessage in interface MessageSourceNoSuchMessageException
public String getMessage(String code,
Object[] args,
String defaultMessage,
Locale locale)
getMessage in interface MessageSource
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||