Class MessageFieldTemplate
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.core.filter.templates.AbstractTemplate
-
- org.pentaho.reporting.engine.classic.core.filter.templates.MessageFieldTemplate
-
- All Implemented Interfaces:
Serializable
,Cloneable
,DataSource
,Template
public class MessageFieldTemplate extends AbstractTemplate
The message field template simplifies the on-the-fly creation of strings.- Author:
- Thomas Morgner
- See Also:
MessageFormatSupport
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MessageFieldTemplate()
Creates a new string field template.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MessageFieldTemplate
clone()
Clones the template.String
getFormat()
Returns the format string used in the message format filter.String
getNullValue()
Returns the value displayed by the field when the data source value isnull
.Object
getValue(ExpressionRuntime runtime, ReportElement element)
Returns the current value for the data source.void
setFormat(String format)
Redefines the format string for the message format.void
setNullValue(String nullValue)
Sets the value displayed by the field when the data source value isnull
.-
Methods inherited from class org.pentaho.reporting.engine.classic.core.filter.templates.AbstractTemplate
getInstance, getName, setName
-
-
-
-
Method Detail
-
getFormat
public String getFormat()
Returns the format string used in the message format filter. This is a raw value which contains untranslated references to column names. It cannot be used directly in java.text.MessageFormat objects.- Returns:
- the format string.
-
setFormat
public void setFormat(String format)
Redefines the format string for the message format. The assigned message format string must be given as raw value, where column references are given in the format $(COLNAME).- Parameters:
format
- the new format string.
-
getNullValue
public String getNullValue()
Returns the value displayed by the field when the data source value isnull
.- Returns:
- A value to represent
null
.
-
setNullValue
public void setNullValue(String nullValue)
Sets the value displayed by the field when the data source value isnull
.- Parameters:
nullValue
- the value that representsnull
.
-
getValue
public Object getValue(ExpressionRuntime runtime, ReportElement element)
Returns the current value for the data source.- Parameters:
runtime
- the expression runtime that is used to evaluate formulas and expressions when computing the value of this filter.element
-- Returns:
- the value.
-
clone
public MessageFieldTemplate clone() throws CloneNotSupportedException
Clones the template.- Specified by:
clone
in interfaceDataSource
- Overrides:
clone
in classAbstractTemplate
- Returns:
- the clone.
- Throws:
CloneNotSupportedException
- this should never happen.
-
-