@ThreadSafe public abstract class AbstractEnumTextResolverWithOverrideAndFallback extends Object implements IEnumTextResolver
| Constructor and Description |
|---|
AbstractEnumTextResolverWithOverrideAndFallback() |
| Modifier and Type | Method and Description |
|---|---|
String |
getText(Enum<?> aEnum,
ISimpleTextProvider aTP,
Locale aContentLocale)
Get the text of an enumeration item.
|
String |
getTextWithArgs(Enum<?> aEnum,
ITextProvider aTP,
Locale aContentLocale,
Object... aArgs)
Get the text of an enumeration item with placeholder texts being replaced.
|
protected abstract String |
internalGetFallbackString(String sID,
Locale aContentLocale)
This method must return the fallback string for the passed parameters.
|
protected abstract String |
internalGetOverrideString(String sID,
Locale aContentLocale)
This method must return the override string for the passed parameters.
|
public AbstractEnumTextResolverWithOverrideAndFallback()
@Nullable protected abstract String internalGetOverrideString(@Nonnull String sID, @Nonnull Locale aContentLocale)
sID - Unique string IDaContentLocale - locale to use.null.@Nullable protected abstract String internalGetFallbackString(@Nonnull String sID, @Nonnull Locale aContentLocale)
sID - Unique string IDaContentLocale - locale to use.null.@Nullable public final String getText(@Nonnull Enum<?> aEnum, @Nonnull ISimpleTextProvider aTP, @Nonnull Locale aContentLocale)
IEnumTextResolvergetText in interface IEnumTextResolveraEnum - The enumeration item to get the unique ID of. May not be
null.aTP - The text provider containing the text. May not be null.aContentLocale - The locale to be used. May not be null.null if no text could be resolved.@Nullable public final String getTextWithArgs(@Nonnull Enum<?> aEnum, @Nonnull ITextProvider aTP, @Nonnull Locale aContentLocale, @Nullable Object... aArgs)
IEnumTextResolvergetTextWithArgs in interface IEnumTextResolveraEnum - The enumeration item to get the unique ID of. May not be
null.aTP - The text provider containing the text. May not be null.aContentLocale - The locale to be used. May not be null.aArgs - The arguments to be added into the string. May be null
but this makes no sense.null if no text could be resolved.Copyright © 2006–2014 phloc systems. All rights reserved.