public class MessageTool.TextKey extends Object
So instead of $text.get("forms.profile.title")
,1
you can just type $text.forms.profile.title
. Also,
this lets you do things like:
#if( $text.forms.profile.exists ) #set( $profiletext = $text.forms.profile ) <h1>$profiletext.title</h1> <h3>$profiletext.subtitle</h3> #end
Constructor and Description |
---|
TextKey(String key,
String bundle,
Object[] args,
Locale locale) |
Modifier and Type | Method and Description |
---|---|
MessageTool.TextKey |
bundle(String setme)
Returns a new TextKey with the specified resource bundle set.
|
MessageTool.TextKey |
clearArgs()
This will return a new TextKey that has no arguments to
be inserted into the text output.
|
boolean |
exists()
Checks for the existence of the key that we've built up.
|
MessageTool.TextKey |
get(String appendme)
Appends a period and the new key to the current
key and returns a new TextKey instance with the
combined result as its key.
|
boolean |
getExists()
Convenience method to allow
$text.key.exists syntax. |
MessageTool.TextKey |
insert(List addme)
Returns a new TextKey with the specified List of arguments
to be inserted into the text output.
|
MessageTool.TextKey |
insert(Object addme)
Returns a new TextKey with the specified argument
to be inserted into the text output.
|
MessageTool.TextKey |
insert(Object[] addme)
Returns a new TextKey with the specified array of arguments
to be inserted into the text output.
|
MessageTool.TextKey |
insert(Object addme,
Object metoo)
Returns a new TextKey with the specified arguments
to be inserted into the text output.
|
MessageTool.TextKey |
insert(Object addme,
Object metoo,
Object methree)
Returns a new TextKey with the specified arguments
to be inserted into the text output.
|
MessageTool.TextKey |
locale(Locale setme)
Returns a new TextKey with the specified resource bundle set.
|
String |
toString()
Renders the text output according to the collected key value,
bundle, and arguments.
|
public MessageTool.TextKey get(String appendme)
public MessageTool.TextKey bundle(String setme)
public MessageTool.TextKey locale(Locale setme)
public MessageTool.TextKey insert(Object addme)
public MessageTool.TextKey insert(Object addme, Object metoo)
public MessageTool.TextKey insert(Object addme, Object metoo, Object methree)
public MessageTool.TextKey insert(List addme)
public MessageTool.TextKey insert(Object[] addme)
public MessageTool.TextKey clearArgs()
public boolean getExists()
$text.key.exists
syntax.public boolean exists()
Copyright © 2002–2021 Apache Software Foundation. All rights reserved.