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
AChangeReportproviding localisation like aLocalisedCheckReport. This needs to be aChangeReport, so aLocalisedCheckReportwill 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 LocalisedCheckReportlocalisedReportThe 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 voidaddReportEntry(String checkId, CheckReport.ResultType reportEntryType, String defaultMessage, URI... affElems)Adds a new entry to the report.voidaddReportEntry(String checkId, CheckReport.ResultType reportEntryType, String defaultMessage, Map<Locale,String> localisedMessage, URI... affElems)Adds a new localisable entry to the report.CheckReport.ResultTypegetCheckResult()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.LocalisedReportEntrygetLastAddedReportEntry()Returns the last added report entryLocalisationFactorygetLocalisationFactory()Gets the localisation factory which to use for localising attributes from model elements ornullif 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.StringgetReportSummary()Returns a textual summary of all check report entries.StringgetReportSummary(Locale locale)Gets a report summary of all check report entries using the designated locale for all messages.StringgetSimpleReportSummary()Returns a textual summary of all warning and failure check report entries.StringgetSimpleReportSummary(Locale locale)Gets a report summary of all warning and failure check report entries using the designated locale for all messages.voidprintReportSummary()Prints the report summary to STDOUT.voidprintReportSummary(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 ornullif model elements should not be localised.- Returns:
- The localisation factory which to use for localising attributes from model elements or
nullif model elements should not be localised.
-
addReportEntry
public void addReportEntry(String checkId, CheckReport.ResultType reportEntryType, String defaultMessage, URI... affElems)
Description copied from class:CheckReportAdds a new entry to the report. Besides, the overall result of the report is adjusted accordingly to the givenreportEntryType.- Overrides:
addReportEntryin 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:CheckReportReturns all report entries that keep the output of the different checks and are assigned to the check report.- Overrides:
getReportEntriesin classCheckReport- Returns:
- list of all report entries
-
getReportSummary
public String getReportSummary()
Description copied from class:CheckReportReturns a textual summary of all check report entries. Intended for use, e.g. at the console.- Overrides:
getReportSummaryin 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:CheckReportReturns a textual summary of all warning and failure check report entries. Intended for use, e.g. at the console.- Overrides:
getSimpleReportSummaryin 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:CheckReportPrints the report summary to STDOUT.- Overrides:
printReportSummaryin 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:CheckReportReturns all check report entries which do have the given checkID- Overrides:
getEntriesForCheckIDin 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:CheckReportReturns the last added report entry- Overrides:
getLastAddedReportEntryin classCheckReport- Returns:
- last added reportEntry or null if no entry exists till now.
-
getCheckResult
public CheckReport.ResultType getCheckResult()
Description copied from class:CheckReportReturns the overall result of all checks which have been run with this check report.- Overrides:
getCheckResultin classCheckReport- Returns:
- The current overall result of all checks.
-
-