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
An abstract implementation of the
IHasText that has default
implementations for the formatting things.- Author:
- Philip Helger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal StringGet 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, waitMethods inherited from interface com.helger.commons.text.IHasText
getAsHasDisplayText
-
Constructor Details
-
AbstractHasText
protected AbstractHasText()
-
-
Method Details
-
internalGetLocaleToUseWithFallback
Determine the locale to use.- Parameters:
aContentLocale- Requested locale. Nevernull.- Returns:
- The locale to use. May be
null.
-
internalGetText
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
-
getText
Description copied from interface:IHasTextGet the text specific for the passed locale. The implementation class MAY add locale-generalisation when resolving the text ("de_DE" => "de" => default).
-