Class MessageFormatFilter

    • Constructor Detail

      • MessageFormatFilter

        public MessageFormatFilter()
        Default constructor.

        Uses a general number format for the current locale.

    • Method Detail

      • setFormatString

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

        public String getFormatString()
        Returns the format string used in the message format.
        Returns:
        the format string.
      • getValue

        public Object getValue​(ExpressionRuntime runtime,
                               ReportElement element)
        Returns the formatted string. The value is read using the data source given and formated using the formatter of this object. The formating is guaranteed to completly form the object to an string or to return the defined NullValue.

        If format, datasource or object are null, the NullValue is returned.

        Specified by:
        getValue in interface DataSource
        Parameters:
        runtime - the expression runtime that is used to evaluate formulas and expressions when computing the value of this filter.
        element -
        Returns:
        The formatted value.
      • getNullString

        public String getNullString()
        Returns the replacement text if one of the referenced fields in the message is null.
        Returns:
        the replacement string for null-values.
      • setNullString

        public void setNullString​(String nullString)
        Defines the replacement text that is used, if one of the referenced fields in the message is null.
        Parameters:
        nullString - the replacement string for null-values.