Class LocalisedChangeReport

  • All Implemented Interfaces:
    Serializable

    public class LocalisedChangeReport
    extends ChangeReport
    A ChangeReport providing localisation like a LocalisedCheckReport. This needs to be a ChangeReport, so a LocalisedCheckReport will be wrapped. The wrapped report will also provide all report entries, so that all report entry methods are forwarded to the wrapped report instead of the superclass.
    See Also:
    Serialized Form
    • Field Detail

      • localisedReport

        protected final LocalisedCheckReport localisedReport
        The localised check report managing all report entries.
    • Constructor Detail

      • LocalisedChangeReport

        public LocalisedChangeReport​(URI baseURI,
                                     UUID oldInstanceID,
                                     LocalisationFactory locFac,
                                     Locale... locales)
        Sets up a change report which is a check report providing the old and the new ID of the changed instance. The new ID will only be provided if the change has been successfully integrated.
        Parameters:
        baseURI - The process element identifier URI of the instance this check report is assigned to.
        oldInstanceID - The old ID of the instance.
        locFac - The localisation factory which to use for localising attributes from model elements. If this is null, model elements will not be localised.
        locales - The locales this change report should provide.
    • Method Detail

      • getPreferredLocales

        public List<Locale> getPreferredLocales()
        Gets the locales this change report should provide (or at least a fallback of each).
        Returns:
        The locales this change report should provide (or at least a fallback of each).
      • getLocalisationFactory

        public LocalisationFactory getLocalisationFactory()
        Gets the localisation factory which to use for localising attributes from model elements or null if model elements should not be localised.
        Returns:
        The localisation factory which to use for localising attributes from model elements or null if model elements should not be localised.
      • addReportEntry

        public void addReportEntry​(String checkId,
                                   CheckReport.ResultType reportEntryType,
                                   String defaultMessage,
                                   URI... affElems)
        Description copied from class: CheckReport
        Adds a new entry to the report. Besides, the overall result of the report is adjusted accordingly to the given reportEntryType.
        Overrides:
        addReportEntry in class CheckReport
        Parameters:
        checkId - The identifier of the check that generates this report entry.
        reportEntryType - The severity of this report item.
        defaultMessage - The message to report.
        affElems - The process element identifier URIs of the process elements affected by this report entry.
      • addReportEntry

        public void addReportEntry​(String checkId,
                                   CheckReport.ResultType reportEntryType,
                                   String defaultMessage,
                                   Map<Locale,​String> localisedMessage,
                                   URI... affElems)
        Adds a new localisable entry to the report. Besides, the overall result of the report is adjusted accordingly to the designated reportEntryType.
        Parameters:
        checkId - The identifier of the check that generates this report entry.
        reportEntryType - The severity of this report item.
        defaultMessage - The default message used if no corresponding localisation is found.
        localisedMessage - The localised message for the corresponding locale. This should contain all preferred locales (or at least the corresponding fallbacks) of the check report.
        affElems - The process element identifier URIs of the process elements affected by this report entry.
      • getReportSummary

        public String getReportSummary()
        Description copied from class: CheckReport
        Returns a textual summary of all check report entries. Intended for use, e.g. at the console.
        Overrides:
        getReportSummary in class CheckReport
        Returns:
        A textual summary of all entries.
      • getReportSummary

        public String getReportSummary​(Locale locale)
        Gets a report summary of all check report entries using the designated locale for all messages.
        Parameters:
        locale - The locale which to use for the messages in the report summary.
        Returns:
        A textual summary of all entries.
        See Also:
        getReportSummary()
      • getSimpleReportSummary

        public String getSimpleReportSummary()
        Description copied from class: CheckReport
        Returns a textual summary of all warning and failure check report entries. Intended for use, e.g. at the console.
        Overrides:
        getSimpleReportSummary in class CheckReport
        Returns:
        A textual summary of all warning and failure entries.
      • getSimpleReportSummary

        public String getSimpleReportSummary​(Locale locale)
        Gets a report summary of all warning and failure check report entries using the designated locale for all messages.
        Parameters:
        locale - The locale which to use for the messages in the simple report summary.
        Returns:
        A textual summary of all warning and failure entries.
        See Also:
        getSimpleReportSummary()
      • printReportSummary

        public void printReportSummary​(Locale locale)
        Prints the report summary to STDOUT using the designated locale.
        Parameters:
        locale - The locale which to use for the printed messages.
      • getCheckResult

        public CheckReport.ResultType getCheckResult()
        Description copied from class: CheckReport
        Returns the overall result of all checks which have been run with this check report.
        Overrides:
        getCheckResult in class CheckReport
        Returns:
        The current overall result of all checks.