@ThreadSafe public abstract class AbstractEnumTextResolverWithOverrideAndFallback extends Object implements IEnumTextResolver
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEFAULT_CHECK_FOR_FALLBACK |
static boolean |
DEFAULT_CHECK_FOR_OVERRIDE |
| Constructor and Description |
|---|
AbstractEnumTextResolverWithOverrideAndFallback() |
| Modifier and Type | Method and Description |
|---|---|
String |
getText(Enum<?> aEnum,
IHasText aTP,
Locale aContentLocale)
Get the text of an enumeration item.
|
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.
|
boolean |
isCheckForFallback() |
boolean |
isCheckForOverride() |
void |
setCheckForFallback(boolean bCheckForFallback) |
void |
setCheckForOverride(boolean bCheckForOverride) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetTextWithArgs, getTextWithArgspublic static final boolean DEFAULT_CHECK_FOR_OVERRIDE
public static final boolean DEFAULT_CHECK_FOR_FALLBACK
public AbstractEnumTextResolverWithOverrideAndFallback()
public final boolean isCheckForOverride()
public final void setCheckForOverride(boolean bCheckForOverride)
public final boolean isCheckForFallback()
public final void setCheckForFallback(boolean bCheckForFallback)
@Nullable protected abstract String internalGetOverrideString(@Nonnull String sID, @Nonnull Locale aContentLocale)
isCheckForOverride() is true
.sID - Unique string IDaContentLocale - locale to use.null.@Nullable protected abstract String internalGetFallbackString(@Nonnull String sID, @Nonnull Locale aContentLocale)
isCheckForFallback() is true
.sID - Unique string IDaContentLocale - locale to use.null.@Nullable public final String getText(@Nonnull Enum<?> aEnum, @Nonnull IHasText 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.Copyright © 2014–2020 Philip Helger. All rights reserved.