Class LocalizedMessages
java.lang.Object
com.adobe.epubcheck.messages.LocalizedMessages
Manages storage, caching and retrieval of default localized messages.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ResourceBundleprivate final Severitiesprivate final Localeprivate static final Map<String, LocalizedMessages> -
Constructor Summary
ConstructorsConstructorDescriptionLocalizedMessages(Locale locale) Typical pattern for instantiation should use the static getInstance() methods to ensure that cached objects are used. -
Method Summary
Modifier and TypeMethodDescriptionstatic LocalizedMessagesProvides messages for the default locale.static LocalizedMessagesgetInstance(Locale locale) Provides messages for the given locale.getMessage(MessageId id) Gets the message for the given id.private Stringprivate StringReturns the suggestion message for the given message ID.getSuggestion(MessageId id, String key) Returns the suggestion message for the given message ID and key.
-
Field Details
-
locale
-
bundle
-
localizedMessages
-
cachedMessages
-
defaultSeverities
-
-
Constructor Details
-
LocalizedMessages
Typical pattern for instantiation should use the static getInstance() methods to ensure that cached objects are used. If that behavior isn't desired, direct instantiation is also an option using this constructor.- Parameters:
locale- The locale used to localize the messages, or default.
-
-
Method Details
-
getInstance
Provides messages for the default locale.- Returns:
- Localized messages.
-
getInstance
Provides messages for the given locale.- Parameters:
locale- The locale. If null or unsupported, will use the default locale instead.- Returns:
- Localized messages.
-
getMessage
-
getStringFromBundle
-
getMessageAsString
-
getSuggestion
-
getSuggestion
Returns the suggestion message for the given message ID and key. In other words, for a message ID of `XXX_NNN`, and a key `key`, returns the bundle message named `XXX_NNN_SUG.key`. If the suggestion key is not found, returns the bundle message named `XXX_NNN_SUG.default`. If this latter is not found, returns the bundle message nameed `XXX_NNN_SUG`.- Parameters:
id- a message IDkey- the key of a specific suggestion string- Returns:
- the associated suggestion string
-