Class LocalisedChangeReport
- java.lang.Object
-
- de.aristaflow.adept2.util.CheckReport
-
- de.aristaflow.adept2.model.processmodel.ChangeReport
-
- de.aristaflow.adept2.model.processmodel.LocalisedChangeReport
-
- All Implemented Interfaces:
Serializable
public class LocalisedChangeReport extends ChangeReport
AChangeReport
providing localisation like aLocalisedCheckReport
. This needs to be aChangeReport
, so aLocalisedCheckReport
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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.aristaflow.adept2.util.CheckReport
CheckReport.ReportEntry, CheckReport.ResultType
-
-
Field Summary
Fields Modifier and Type Field Description protected LocalisedCheckReport
localisedReport
The localised check report managing all report entries.-
Fields inherited from class de.aristaflow.adept2.model.processmodel.ChangeReport
newInstance, newInstanceID, oldInstanceID
-
Fields inherited from class de.aristaflow.adept2.util.CheckReport
locale, nextEntryNumber, reportEntries
-
-
Constructor Summary
Constructors Constructor Description 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addReportEntry(String checkId, CheckReport.ResultType reportEntryType, String defaultMessage, URI... affElems)
Adds a new entry to the report.void
addReportEntry(String checkId, CheckReport.ResultType reportEntryType, String defaultMessage, Map<Locale,String> localisedMessage, URI... affElems)
Adds a new localisable entry to the report.CheckReport.ResultType
getCheckResult()
Returns the overall result of all checks which have been run with this check report.List<? extends LocalisedCheckReport.LocalisedReportEntry>
getEntriesForCheckID(String checkId)
Returns all check report entries which do have the given checkIDLocalisedCheckReport.LocalisedReportEntry
getLastAddedReportEntry()
Returns the last added report entryLocalisationFactory
getLocalisationFactory()
Gets the localisation factory which to use for localising attributes from model elements ornull
if model elements should not be localised.List<Locale>
getPreferredLocales()
Gets the locales this change report should provide (or at least a fallback of each).List<? extends LocalisedCheckReport.LocalisedReportEntry>
getReportEntries()
Returns all report entries that keep the output of the different checks and are assigned to the check report.String
getReportSummary()
Returns a textual summary of all check report entries.String
getReportSummary(Locale locale)
Gets a report summary of all check report entries using the designated locale for all messages.String
getSimpleReportSummary()
Returns a textual summary of all warning and failure check report entries.String
getSimpleReportSummary(Locale locale)
Gets a report summary of all warning and failure check report entries using the designated locale for all messages.void
printReportSummary()
Prints the report summary to STDOUT.void
printReportSummary(Locale locale)
Prints the report summary to STDOUT using the designated locale.-
Methods inherited from class de.aristaflow.adept2.model.processmodel.ChangeReport
setNewInstance, setNewInstanceID
-
Methods inherited from class de.aristaflow.adept2.util.CheckReport
addReportEntry, getBase, getPreferredLocale, isFailure
-
-
-
-
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 isnull
, 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 ornull
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 givenreportEntryType
.- Overrides:
addReportEntry
in classCheckReport
- 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 designatedreportEntryType
.- 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 classCheckReport
- 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 classCheckReport
- 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 classCheckReport
- 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()
Description copied from class:CheckReport
Prints the report summary to STDOUT.- Overrides:
printReportSummary
in classCheckReport
-
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 classCheckReport
- 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 classCheckReport
- 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 classCheckReport
- Returns:
- The current overall result of all checks.
-
-