Class AbstractReporter

    • Method Detail

      • createSubReporter

        public Reporter createSubReporter​(String taskKey,
                                          String defaultName)
        Description copied from interface: Reporter
        Create a sub-reporter for a specific task, to separate from current reports the reports from that task, with no associated value.
        Specified by:
        createSubReporter in interface Reporter
        Parameters:
        taskKey - the key identifying that task
        defaultName - a name or message describing the corresponding task
        Returns:
        the new sub-reporter
      • createSubReporter

        public Reporter createSubReporter​(String taskKey,
                                          String defaultName,
                                          String key,
                                          Object value)
        Description copied from interface: Reporter
        Create a sub-reporter for a specific task, to separate from current reports the reports from that task, with one associated value.
        Specified by:
        createSubReporter in interface Reporter
        Parameters:
        taskKey - the key identifying that task
        defaultName - a name or message describing the corresponding task, which may contain references to the provided value
        key - the key for the value which follows
        value - the value which may be referred to within the defaultName or within the reports message of the created sub-reporter
        Returns:
        the new sub-reporter
      • createSubReporter

        public Reporter createSubReporter​(String taskKey,
                                          String defaultName,
                                          String key,
                                          Object value,
                                          String type)
        Description copied from interface: Reporter
        Create a sub-reporter for a specific task, to separate from current reports the reports from that task, with one associated typed value.
        Specified by:
        createSubReporter in interface Reporter
        Parameters:
        taskKey - the key identifying that task
        defaultName - a name or message describing the corresponding task, which may contain references to the provided typed value
        key - the key for the typed value which follows
        value - the value which may be referred to within the defaultName or within the reports message of the created sub-reporter
        type - the string representing the type of the value provided
        Returns:
        the new sub-reporter
      • report

        public void report​(String reportKey,
                           String defaultMessage,
                           Map<String,​TypedValue> values)
        Description copied from interface: Reporter
        Add a new report with its associated values.
        Specified by:
        report in interface Reporter
        Parameters:
        reportKey - a key identifying the current report
        defaultMessage - the default report message, which may contain references to the provided values or to the values of current reporter
        values - a map of TypedValue indexed by their key, which may be referred to within the defaultMessage provided
      • report

        public void report​(String reportKey,
                           String defaultMessage)
        Description copied from interface: Reporter
        Add a new report with no associated value.
        Specified by:
        report in interface Reporter
        Parameters:
        reportKey - a key identifying the current report
        defaultMessage - the default report message, which may contain references to the values of current reporter
      • report

        public void report​(String reportKey,
                           String defaultMessage,
                           String valueKey,
                           Object value)
        Description copied from interface: Reporter
        Add a new report with one associated value.
        Specified by:
        report in interface Reporter
        Parameters:
        reportKey - a key identifying the current report
        defaultMessage - the default report message, which may contain references to the provided value or to the values of current reporter
        valueKey - the key for the value which follows
        value - the int, long, float, double, boolean or String value which may be referred to within the defaultMessage provided
      • report

        public void report​(String reportKey,
                           String defaultMessage,
                           String valueKey,
                           Object value,
                           String type)
        Description copied from interface: Reporter
        Add a new report with one associated typed value.
        Specified by:
        report in interface Reporter
        Parameters:
        reportKey - a key identifying the current report
        defaultMessage - the default report message, which may contain references to the provided typed value or to the values of current reporter
        valueKey - the key for the typed value which follows
        value - the int, long, float, double, boolean or String value which may be referred to within the defaultMessage provided
        type - the string representing the type of the value provided
      • formatReportMessage

        protected static String formatReportMessage​(Report report,
                                                    Map<String,​TypedValue> taskValues)
        Format default message of given report by replacing value references by the corresponding values. The values in the report default message have to be referred to with their corresponding key, using the ${key} syntax. The values are first searched in the report key-value map, then in or the given key-value map. StringSubstitutor is used for the string replacements.
        Parameters:
        report - the report whose default message needs to be formatted
        taskValues - the key-value map used if any value reference is not found among the report values
        Returns:
        the resulting formatted string
      • formatMessage

        protected static String formatMessage​(String message,
                                              Map<String,​TypedValue> values)
        Format given message by replacing value references by the corresponding values. The values in the given message have to be referred to with their corresponding key, using the ${key} syntax. StringSubstitutor is used for the string replacements.
        Parameters:
        message - the message to be formatted
        values - the key-value map used to look for the values
        Returns:
        the resulting formatted string