Package com.helger.commons.text
Class AbstractHasText
- java.lang.Object
-
- com.helger.commons.text.AbstractHasText
-
- All Implemented Interfaces:
IHasText
- Direct Known Subclasses:
AbstractReadOnlyMapBasedMultilingualText,ConstantHasText,ConstantHasTextWithArgs,ResourceBundleTextProvider
public abstract class AbstractHasText extends Object implements IHasText
An abstract implementation of theIHasTextthat has default implementations for the formatting things.- Author:
- Philip Helger
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractHasText()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description StringgetText(Locale aContentLocale)Get the text specific for the passed locale.protected LocaleinternalGetLocaleToUseWithFallback(Locale aContentLocale)Determine the locale to use.protected abstract StringinternalGetText(Locale aContentLocale)Main text resolving.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.helger.commons.text.IHasText
getAsHasDisplayText
-
-
-
-
Method Detail
-
internalGetLocaleToUseWithFallback
@Nullable protected Locale internalGetLocaleToUseWithFallback(@Nonnull Locale aContentLocale)
Determine the locale to use.- Parameters:
aContentLocale- Requested locale. Nevernull.- Returns:
- The locale to use. May be
null.
-
internalGetText
@Nullable protected abstract String internalGetText(@Nonnull Locale aContentLocale)
Main text resolving. Get the text in the passed locale.- Parameters:
aContentLocale- Locale to use. This is the locale resolved internally. Nevernull.- Returns:
nullif no such text present in the passed locale
-
-