Class LocalisedCheckReport.LocalisedReportEntry
- java.lang.Object
-
- de.aristaflow.adept2.util.CheckReport.ReportEntry
-
- de.aristaflow.adept2.model.common.LocalisedCheckReport.LocalisedReportEntry
-
- All Implemented Interfaces:
Serializable
- Enclosing class:
- LocalisedCheckReport
public static class LocalisedCheckReport.LocalisedReportEntry extends CheckReport.ReportEntry
A report entry extension providing localised messages.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<Locale,String>
localisedMessage
The localised message of this report entry.
-
Constructor Summary
Constructors Modifier Constructor Description protected
LocalisedReportEntry(int entryNumber, String checkID, CheckReport.ResultType reportEntryType, String defaultMessage, Map<Locale,String> localisedMessage, URI... affectedElements)
Constructs the report entry with the designated parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<Locale,String>
getAllMessages()
Gets the localised message(s) for all (preferred) locales.String
getMessage(Collection<Locale> locales)
Gets the localised message of the check report entry corresponding to the designated locales preferring previous locales.String
getMessage(Locale locale)
Gets the localised message of the check report entry corresponding to the designated locale or one of its fallback.-
Methods inherited from class de.aristaflow.adept2.util.CheckReport.ReportEntry
getAffectedADEPT2ProcessElements, getCheckID, getEntryNumber, getMessage, getReportEntryType
-
-
-
-
Constructor Detail
-
LocalisedReportEntry
protected LocalisedReportEntry(int entryNumber, String checkID, CheckReport.ResultType reportEntryType, String defaultMessage, Map<Locale,String> localisedMessage, URI... affectedElements)
Constructs the report entry with the designated parameters.- Parameters:
entryNumber
- the number of this entry in the reportcheckID
- the check which created the entryreportEntryType
- the type of the entrydefaultMessage
- 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.affectedElements
- the process elements affected by this entry
-
-
Method Detail
-
getAllMessages
public Map<Locale,String> getAllMessages()
Gets the localised message(s) for all (preferred) locales. This does not consider fallback locales. You should usually usegetMessage(Locale)
orgetMessage(Collection)
.- Returns:
- The localised message(s) for all (preferred) locales.
-
getMessage
public String getMessage(Locale locale)
Gets the localised message of the check report entry corresponding to the designated locale or one of its fallback.- Parameters:
locale
- The locale for which to get the message of the check report entry.- Returns:
- The localised message of the check report entry.
-
getMessage
public String getMessage(Collection<Locale> locales)
Gets the localised message of the check report entry corresponding to the designated locales preferring previous locales.- Parameters:
locales
- The locales for which to get the message of the check report entry with the first locale having the highest priority and the last locale the least priority.- Returns:
- The localised message of the check report entry.
-
-