org.pentaho.reporting.engine.classic.core.function.strings
Class ResourceMesssageFormatExpression

java.lang.Object
  extended by org.pentaho.reporting.engine.classic.core.function.AbstractExpression
      extended by org.pentaho.reporting.engine.classic.core.function.strings.ResourceMesssageFormatExpression
All Implemented Interfaces:
Serializable, Cloneable, Expression

public class ResourceMesssageFormatExpression
extends AbstractExpression

Formats a message read from a resource-bundle using named parameters. The parameters are resolved against the current data-row.

This performs the same task as the ResourceMessageFormatFilter does inside a text-element.

Author:
Thomas Morgner
See Also:
Serialized Form

Constructor Summary
ResourceMesssageFormatExpression()
          Default constructor.
 
Method Summary
 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()
          Returns the formatted message.
 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.
 
Methods inherited from class org.pentaho.reporting.engine.classic.core.function.AbstractExpression
clone, getDataRow, getDependencyLevel, getInstance, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, isDeepTraversing, isPreserve, setActive, setDependencyLevel, setName, setPreserve, setRuntime
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceMesssageFormatExpression

public ResourceMesssageFormatExpression()
Default constructor.

Method Detail

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 to getValue() will result in null 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.

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.

getValue

public Object getValue()
Returns the formatted message.

Returns:
the formatted message.