Class ResourceMessageFormatFilter
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.core.filter.ResourceMessageFormatFilter
-
- All Implemented Interfaces:
Serializable
,Cloneable
,DataSource
public class ResourceMessageFormatFilter extends Object implements DataSource
A filter that formats values from the datarow using a message format object. The message format string is looked up from a Resource-Bundle.- Since:
- 2006-01-24
- Author:
- Thomas Morgner
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ResourceMessageFormatFilter()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResourceMessageFormatFilter
clone()
Clones thisDataSource
.String
getFormatKey()
Returns the key that is used to lookup the format string used in the message format in the resource bundle.String
getNullString()
Returns the replacement text that is used if one of the referenced message parameters is null.String
getResourceIdentifier()
Returns the name of the used resource bundle.Object
getValue(ExpressionRuntime runtime, ReportElement element)
Returns the current value for the data source.void
setFormatKey(String format)
Defines the key that is used to lookup the format string used in the message format in the resource bundle.void
setNullString(String nullString)
Defines the replacement text that is used if one of the referenced message parameters is null.void
setResourceIdentifier(String resourceIdentifier)
Defines the name of the used resource bundle.
-
-
-
Method Detail
-
getValue
public Object getValue(ExpressionRuntime runtime, ReportElement element)
Returns the current value for the data source.- Specified by:
getValue
in interfaceDataSource
- Parameters:
runtime
- the expression runtime that is used to evaluate formulas and expressions when computing the value of this filter.element
-- Returns:
- the value.
-
getResourceIdentifier
public String getResourceIdentifier()
Returns the name of the used resource bundle.- Returns:
- the name of the resourcebundle
- See Also:
ResourceBundleFactory.getResourceBundle(String)
-
setResourceIdentifier
public void setResourceIdentifier(String resourceIdentifier)
Defines the name of the used resource bundle. If undefined, all calls toDataSource.getValue(ExpressionRuntime, org.pentaho.reporting.engine.classic.core.ReportElement)
will result innull
values.- Parameters:
resourceIdentifier
- the resource bundle name
-
setFormatKey
public void setFormatKey(String format)
Defines the key that is used to lookup the format string used in the message format in the resource bundle.- Parameters:
format
- a resourcebundle key for the message format lookup.
-
getFormatKey
public String getFormatKey()
Returns the key that is used to lookup the format string used in the message format in the resource bundle.- Returns:
- the resource bundle key.
-
clone
public ResourceMessageFormatFilter clone() throws CloneNotSupportedException
Clones thisDataSource
.- Specified by:
clone
in interfaceDataSource
- Overrides:
clone
in classObject
- Returns:
- the clone.
- Throws:
CloneNotSupportedException
- this should never happen.
-
getNullString
public String getNullString()
Returns the replacement text that is used if one of the referenced message parameters is null.- Returns:
- the replacement text for null-values.
-
setNullString
public void setNullString(String nullString)
Defines the replacement text that is used if one of the referenced message parameters is null.- Parameters:
nullString
- the replacement text for null-values.
-
-