public class LocalisedChangeReport extends ChangeReport
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.CheckReport.ReportEntry, CheckReport.ResultType| Modifier and Type | Field and Description |
|---|---|
protected LocalisedCheckReport |
localisedReport
The localised check report managing all report entries.
|
newInstance, newInstanceID, oldInstanceIDlocale, nextEntryNumber, reportEntries| Constructor and Description |
|---|
LocalisedChangeReport(java.net.URI baseURI,
java.util.UUID oldInstanceID,
LocalisationFactory locFac,
java.util.Locale... locales)
Sets up a change report which is a check report providing the old and the new ID of the changed
instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addReportEntry(java.lang.String checkId,
CheckReport.ResultType reportEntryType,
java.lang.String defaultMessage,
java.util.Map<java.util.Locale,java.lang.String> localisedMessage,
java.net.URI... affElems)
Adds a new localisable entry to the report.
|
void |
addReportEntry(java.lang.String checkId,
CheckReport.ResultType reportEntryType,
java.lang.String defaultMessage,
java.net.URI... affElems)
Adds a new entry to the report.
|
CheckReport.ResultType |
getCheckResult()
Returns the overall result of all checks which have been run with this
check report.
|
java.util.List<? extends LocalisedCheckReport.LocalisedReportEntry> |
getEntriesForCheckID(java.lang.String checkId)
Returns all check report entries which do have the given checkID
|
LocalisedCheckReport.LocalisedReportEntry |
getLastAddedReportEntry()
Returns the last added report entry
|
LocalisationFactory |
getLocalisationFactory()
Gets the localisation factory which to use for localising attributes from model elements or
null if model elements should not be localised. |
java.util.List<java.util.Locale> |
getPreferredLocales()
Gets the locales this change report should provide (or at least a fallback of each).
|
java.util.List<? extends LocalisedCheckReport.LocalisedReportEntry> |
getReportEntries()
Returns all report entries that keep the output of the different checks and
are assigned to the check report.
|
java.lang.String |
getReportSummary()
Returns a textual summary of all check report entries.
|
java.lang.String |
getReportSummary(java.util.Locale locale)
Gets a report summary of all check report entries using the designated locale for all messages.
|
java.lang.String |
getSimpleReportSummary()
Returns a textual summary of all warning and failure check report entries.
|
java.lang.String |
getSimpleReportSummary(java.util.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(java.util.Locale locale)
Prints the report summary to STDOUT using the designated locale.
|
setNewInstance, setNewInstanceIDaddReportEntry, getBase, getPreferredLocaleprotected final LocalisedCheckReport localisedReport
public LocalisedChangeReport(java.net.URI baseURI,
java.util.UUID oldInstanceID,
LocalisationFactory locFac,
java.util.Locale... locales)
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.public java.util.List<java.util.Locale> getPreferredLocales()
public LocalisationFactory getLocalisationFactory()
null if model elements should not be localised.null if model elements should not be localised.public void addReportEntry(java.lang.String checkId,
CheckReport.ResultType reportEntryType,
java.lang.String defaultMessage,
java.net.URI... affElems)
CheckReportreportEntryType.addReportEntry in class CheckReportcheckId - 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.public void addReportEntry(java.lang.String checkId,
CheckReport.ResultType reportEntryType,
java.lang.String defaultMessage,
java.util.Map<java.util.Locale,java.lang.String> localisedMessage,
java.net.URI... affElems)
reportEntryType.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.public java.util.List<? extends LocalisedCheckReport.LocalisedReportEntry> getReportEntries()
CheckReportgetReportEntries in class CheckReportpublic java.lang.String getReportSummary()
CheckReportgetReportSummary in class CheckReportpublic java.lang.String getReportSummary(java.util.Locale locale)
locale - The locale which to use for the messages in the report summary.getReportSummary()public java.lang.String getSimpleReportSummary()
CheckReportgetSimpleReportSummary in class CheckReportpublic java.lang.String getSimpleReportSummary(java.util.Locale locale)
locale - The locale which to use for the messages in the simple report summary.getSimpleReportSummary()public void printReportSummary()
CheckReportprintReportSummary in class CheckReportpublic void printReportSummary(java.util.Locale locale)
locale - The locale which to use for the printed messages.public java.util.List<? extends LocalisedCheckReport.LocalisedReportEntry> getEntriesForCheckID(java.lang.String checkId)
CheckReportgetEntriesForCheckID in class CheckReportpublic LocalisedCheckReport.LocalisedReportEntry getLastAddedReportEntry()
CheckReportgetLastAddedReportEntry in class CheckReportpublic CheckReport.ResultType getCheckResult()
CheckReportgetCheckResult in class CheckReport