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:
  • Field Details

    • localisedReport

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

    • 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 Details

    • 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.
    • getReportEntries

      public List<? extends LocalisedCheckReport.LocalisedReportEntry> getReportEntries()
      Description copied from class: CheckReport
      Returns all report entries that keep the output of the different checks and are assigned to the check report.
      Overrides:
      getReportEntries in class CheckReport
      Returns:
      list of all report entries
    • 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:
    • 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:
    • printReportSummary

      public void printReportSummary()
      Description copied from class: CheckReport
      Prints the report summary to STDOUT.
      Overrides:
      printReportSummary in class CheckReport
    • 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.
    • getEntriesForCheckID

      public List<? extends LocalisedCheckReport.LocalisedReportEntry> getEntriesForCheckID(String checkId)
      Description copied from class: CheckReport
      Returns all check report entries which do have the given checkID
      Overrides:
      getEntriesForCheckID in class CheckReport
      Returns:
      check report entries or null if the check report does not contain any entries for the given id
    • getLastAddedReportEntry

      public LocalisedCheckReport.LocalisedReportEntry getLastAddedReportEntry()
      Description copied from class: CheckReport
      Returns the last added report entry
      Overrides:
      getLastAddedReportEntry in class CheckReport
      Returns:
      last added reportEntry or null if no entry exists till now.
    • 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.