Class MessageFormatExpression

  • All Implemented Interfaces:
    Serializable, Cloneable, Expression

    public class MessageFormatExpression
    extends AbstractExpression
    Formats a message using named parameters. The parameters are resolved against the current data-row.

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

    Author:
    Thomas Morgner
    See Also:
    Serialized Form
    • Constructor Detail

      • MessageFormatExpression

        public MessageFormatExpression()
        Default constructor.
    • Method Detail

      • getPattern

        public String getPattern()
        Returns the format string used in the message format.
        Returns:
        the format string.
      • setPattern

        public void setPattern​(String pattern)
        Defines the format string for the MessageFormat object used in this implementation.
        Parameters:
        pattern - the message format.
      • getEncoding

        public String getEncoding()
        Returns the defined character encoding that is used to transform the Java-Unicode strings into bytes.
        Returns:
        the encoding.
      • setEncoding

        public void setEncoding​(String encoding)
        Defines the character encoding that is used to transform the Java-Unicode strings into bytes.
        Parameters:
        encoding - the encoding.
      • setUrlEncodeValues

        public void setUrlEncodeValues​(boolean urlEncode)
        Defines, whether the values read from the data-row should be URL encoded. Dates and Number objects are never encoded.
        Parameters:
        urlEncode - true, if the values from the data-row should be URL encoded before they are passed to the MessageFormat, false otherwise.
      • isUrlEncodeValues

        public boolean isUrlEncodeValues()
        Queries, whether the values read from the data-row should be URL encoded.
        Returns:
        true, if the values are encoded, false otherwise.
      • isUrlEncodeResult

        public boolean isUrlEncodeResult()
        Queries, whether the formatted result-string will be URL encoded.
        Returns:
        true, if the formatted result will be encoded, false otherwise.
      • setUrlEncodeResult

        public void setUrlEncodeResult​(boolean urlEncodeResult)
        Defines, whether the formatted result-string will be URL encoded.
        Parameters:
        urlEncodeResult - true, if the formatted result will be encoded, false otherwise.
      • 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.