|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pentaho.reporting.engine.classic.core.filter.MessageFormatSupport
public class MessageFormatSupport
The message format support class helps to translate named references to fields in a message format string into numeric index positions. With the help of this mapping, we can use a standard Java MessageFormat object to reference fields by their name instead of an arbitrary index position.
A field is referenced by the pattern "$(fieldname)". For additional formatting, all MessageFormat format options are available using the format "$(fieldname, <message option>)". To format a date field with the default short date format, one would use the pattern $(datefield,date,short).
Constructor Summary | |
---|---|
MessageFormatSupport()
Default Constructor. |
Method Summary | |
---|---|
Object |
clone()
Creates a copy of this message format support object. |
String |
getCompiledFormat()
Returns the compiled message format string. |
String[] |
getFields()
|
String |
getFormatString()
Returns the original format string that is used to format the fields. |
Locale |
getLocale()
Returns the locale that is used to format the messages. |
String |
getNullString()
Returns the replacement text that is used if one of the referenced message parameters is null. |
String |
performFormat(DataRow dataRow)
Formats the message using the fields from the given data-row as values for the parameters. |
void |
setFormatString(String formatString)
Updates the named format string and compiles a new field list and message-format string. |
void |
setLocale(Locale locale)
Updates the locale that is used to format the messages. |
void |
setNullString(String nullString)
Defines the replacement text that is used if one of the referenced message parameters is null. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MessageFormatSupport()
Method Detail |
---|
public String getFormatString()
public void setFormatString(String formatString)
formatString
- the format string.public String performFormat(DataRow dataRow)
dataRow
- the data row.
public String getCompiledFormat()
public Locale getLocale()
public void setLocale(Locale locale)
locale
- the locale in the message format.public String getNullString()
public void setNullString(String nullString)
nullString
- the replacement text for null-values.public String[] getFields()
public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
- if an error occured.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |