Class ResourceFieldTemplate
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.core.filter.templates.AbstractTemplate
-
- org.pentaho.reporting.engine.classic.core.filter.templates.ResourceFieldTemplate
-
- All Implemented Interfaces:
Serializable
,Cloneable
,DataSource
,Template
public class ResourceFieldTemplate extends AbstractTemplate
A resource field template, which reads a String value from a ResourceBundle.- Author:
- Thomas Morgner
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ResourceFieldTemplate()
Creates a new template.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResourceFieldTemplate
clone()
Clones the template.protected DataRowDataSource
getDataRowDataSource()
Returns the datarow data source used in this template.String
getField()
Returns the field name.String
getFormula()
Returns the formula used to compute the value of the data source.String
getNullValue()
Returns the string that represents anull
value.String
getResourceIdentifier()
Returns the resource class name.Object
getValue(ExpressionRuntime runtime, ReportElement element)
Returns the current value for the data source.void
setField(String field)
Sets the field name.void
setFormula(String formula)
Defines the formula used to compute the value of this data source.void
setNullValue(String nullValue)
Sets the string that represents anull
value.void
setResourceIdentifier(String resourceClassName)
Sets the resource class name.-
Methods inherited from class org.pentaho.reporting.engine.classic.core.filter.templates.AbstractTemplate
getInstance, getName, setName
-
-
-
-
Method Detail
-
getField
public String getField()
Returns the field name.- Returns:
- The field name.
-
setField
public void setField(String field)
Sets the field name.- Parameters:
field
- the field name.
-
getFormula
public String getFormula()
Returns the formula used to compute the value of the data source.- Returns:
- the formula.
-
setFormula
public void setFormula(String formula)
Defines the formula used to compute the value of this data source.- Parameters:
formula
- the formula for the data source.
-
getResourceIdentifier
public String getResourceIdentifier()
Returns the resource class name.- Returns:
- The resource class name.
-
setResourceIdentifier
public void setResourceIdentifier(String resourceClassName) throws MissingResourceException
Sets the resource class name.- Parameters:
resourceClassName
- the resource class name.- Throws:
MissingResourceException
- if the resource is missing.
-
getNullValue
public String getNullValue()
Returns the string that represents anull
value.- Returns:
- The string that represents a
null
value.
-
setNullValue
public void setNullValue(String nullValue)
Sets the string that represents anull
value.- Parameters:
nullValue
- the string that represents anull
value.
-
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 ResourceFieldTemplate clone() throws CloneNotSupportedException
Clones the template.- Specified by:
clone
in interfaceDataSource
- Overrides:
clone
in classAbstractTemplate
- Returns:
- the clone.
- Throws:
CloneNotSupportedException
- this should never happen.
-
getDataRowDataSource
protected DataRowDataSource getDataRowDataSource()
Returns the datarow data source used in this template.- Returns:
- the datarow data source.
-
-