|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface BundleTemplateMessage
This MessageBuilder implementation creates Message objects by loading resource bundle keys as templates with
values supplied as parameters.
Message m
Message m =And the corresponding messageBundle.properties file:MessageFactory.info(newBundleKey("messageBundle", "keyName"), 5, "green") .defaultText("This is default text.").build();
keyName=There are {0} cars, and they are all {1}.
A subsequent call to m.getText() will return:"There are 5 cars, and they are all green."Note: If a bundle/key pair cannot be resolved, the default template will be used instead. If there is no default template, a String representation of the
BundleKey will be displayed instead.
| Method Summary | |
|---|---|
BundleTemplateMessage |
defaults(String text)
Set the default template text. |
BundleTemplateMessage |
detail(BundleKey detail)
Use the given BundleKey to perform a resource lookup, resolving the template to render detail text for this message. |
BundleTemplateMessage |
detailParams(Object... detailParams)
Set the parameters for detail text of this builder's template. |
BundleTemplateMessage |
key(BundleKey text)
Use the given BundleKey to perform a resource lookup, resolving the template to render for this message. |
BundleTemplateMessage |
level(Level level)
Set the severity, level of importance of this message. |
BundleTemplateMessage |
params(Object... textParams)
Set the parameters for this builder's template. |
BundleTemplateMessage |
targets(String targets)
Set the targets for this message. |
| Methods inherited from interface org.jboss.seam.international.status.MessageBuilder |
|---|
build |
| Method Detail |
|---|
BundleTemplateMessage key(BundleKey text)
BundleKey to perform a resource lookup, resolving the template to render for this message.
Any expressions of the form "{0}, {1} ... {N}" found in the template will be interpolated; numbers reference the index of
any given parameters, and can be used more than once per template.
BundleTemplateMessage detail(BundleKey detail)
BundleKey to perform a resource lookup, resolving the template to render detail text for this message.
Any expressions of the form "{0}, {1} ... {N}" found in the template will be interpolated; numbers reference the index of
any given parameters, and can be used more than once per template.
BundleTemplateMessage defaults(String text)
BundleKey will be used instead.
Any expressions of the form "{0}, {1} ... {N}" found in the template will be interpolated; numbers reference the index of
any given parameters, and can be used more than once per template.
BundleTemplateMessage params(Object... textParams)
#textDefault(String), using expressions of the form "
{0}, {1} ... {N}". The same parameters will be used when interpolating default text, in the case when a BundleKey
cannot be resolved.
BundleTemplateMessage detailParams(Object... detailParams)
#textDefault(String), using expressions of the form "
{0}, {1} ... {N}". The same parameters will be used when interpolating default text, in the case when a BundleKey
cannot be resolved.
BundleTemplateMessage targets(String targets)
BundleTemplateMessage level(Level level)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||