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.| Modifier and Type | Field and Description |
|---|---|
protected LocalisedCheckReport |
localisedReport
The localised check report managing all report entries.
|
newInstance, newInstanceID, oldInstanceID| 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,
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,
ResultType reportEntryType,
java.lang.String defaultMessage,
java.net.URI... affElems) |
ResultType |
getCheckResult() |
java.util.List<? extends LocalisedCheckReport.LocalisedReportEntry> |
getEntriesForCheckID(java.lang.String checkId) |
LocalisedCheckReport.LocalisedReportEntry |
getLastAddedReportEntry() |
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() |
java.lang.String |
getReportSummary() |
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() |
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() |
void |
printReportSummary(java.util.Locale locale)
Prints the report summary to STDOUT using the designated locale.
|
setNewInstance, setNewInstanceIDprotected 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,
ResultType reportEntryType,
java.lang.String defaultMessage,
java.net.URI... affElems)
public void addReportEntry(java.lang.String checkId,
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()
public java.lang.String getReportSummary()
public 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()
public 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()
public 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)
public LocalisedCheckReport.LocalisedReportEntry getLastAddedReportEntry()
public ResultType getCheckResult()