public class TextProvider extends AbstractTextProvider implements IReadonlyMultiLingualText
ITextProvider interface.| Modifier and Type | Field and Description |
|---|---|
static Locale |
DE
German locale used
|
static Locale |
EN
English locale used
|
| Constructor and Description |
|---|
TextProvider() |
| Modifier and Type | Method and Description |
|---|---|
TextProvider |
addTextDE(String sDE) |
TextProvider |
addTextEN(String sEN) |
boolean |
containsLocale(Locale aLocale)
Check if the passed locale is directly contained.
|
boolean |
containsLocaleWithFallback(Locale aContentLocale)
Check if the passed locale is directly or by fallback contained.
|
static TextProvider |
create_DE_EN(String sDE,
String sEN) |
static TextProvider |
create_DE(String sDE) |
static TextProvider |
create_EN(String sEN) |
boolean |
equals(Object o) |
Set<Locale> |
getAllLocales() |
int |
getLocaleCount() |
Map<Locale,String> |
getMap() |
int |
hashCode() |
protected TextProvider |
internalAddText(Locale aContentLocale,
String sValue) |
protected EChange |
internalClear() |
Set<Locale> |
internalGetAllLocales() |
protected Locale |
internalGetLocaleToUseWithFallback(Locale aContentLocale)
Determine the locale to use.
|
protected Map<Locale,String> |
internalGetMap() |
protected String |
internalGetText(Locale aContentLocale)
Main text resolving
|
protected EChange |
internalRemoveText(Locale aLocale) |
protected TextProvider |
internalSetText(Locale aContentLocale,
String sValue) |
boolean |
isEmpty() |
static boolean |
isPerformConsistencyChecks() |
static void |
setPerformConsistencyChecks(boolean bPerformConsistencyChecks)
Enable or disable the internal consistency checks.
|
int |
size() |
String |
toString() |
getTextWithArgs, getTextWithLocaleFallbackAndArgsgetText, getTextWithLocaleFallbackclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetTextWithArgs, getTextWithLocaleFallbackAndArgsgetText, getTextWithLocaleFallbackpublic static final Locale DE
public static final Locale EN
public static void setPerformConsistencyChecks(boolean bPerformConsistencyChecks)
bPerformConsistencyChecks - true to enable them, false to disable
them.public static boolean isPerformConsistencyChecks()
true if consistency checks are enabled,
false if not. The default value is
GlobalDebug.isDebugMode().@Nonnull protected final TextProvider internalAddText(@Nonnull Locale aContentLocale, @Nonnull String sValue)
@Nonnull protected final TextProvider internalSetText(@Nonnull Locale aContentLocale, @Nullable String sValue)
@Nonnull public final TextProvider addTextDE(@Nonnull String sDE)
@Nonnull public final TextProvider addTextEN(@Nonnull String sEN)
@Nonnull @ReturnsMutableObject(reason="Internal use only") protected final Map<Locale,String> internalGetMap()
@Nullable protected final Locale internalGetLocaleToUseWithFallback(@Nonnull Locale aContentLocale)
AbstractSimpleTextProviderinternalGetLocaleToUseWithFallback in class AbstractSimpleTextProvideraContentLocale - Requested localenull.@OverrideOnDemand @Nullable protected String internalGetText(@Nonnull Locale aContentLocale)
AbstractSimpleTextProviderinternalGetText in class AbstractSimpleTextProvideraContentLocale - locale to usenull if no such text present in the passed locale@Nonnull @ReturnsMutableObject(reason="Internal use only") public final Set<Locale> internalGetAllLocales()
@Nonnull @ReturnsMutableCopy public final Set<Locale> getAllLocales()
getAllLocales in interface IHasLocalesnull.@Nonnegative public final int getLocaleCount()
getLocaleCount in interface IHasLocalespublic final boolean containsLocale(@Nullable Locale aLocale)
IHasLocalescontainsLocale in interface IHasLocalesaLocale - The locale to check. May be null.true if the locale is directly contained,
false if not.public final boolean containsLocaleWithFallback(@Nullable Locale aContentLocale)
IHasLocalescontainsLocaleWithFallback in interface IHasLocalesaContentLocale - The locale to check. May be null.true if the locale is contained, false if
not.@Nonnull @ReturnsMutableCopy public final Map<Locale,String> getMap()
getMap in interface IReadonlyMultiLingualTextnull
.@Nonnegative public final int size()
public final boolean isEmpty()
isEmpty in interface IHasSizetrue if no items are present, false if at
least a single item is present.IHasSize.size()@OverridingMethodsMustInvokeSuper public boolean equals(Object o)
@OverridingMethodsMustInvokeSuper public int hashCode()
@OverridingMethodsMustInvokeSuper public String toString()
@Nonnull public static TextProvider create_DE(@Nonnull String sDE)
@Nonnull public static TextProvider create_EN(@Nonnull String sEN)
Copyright © 2006–2015 phloc systems. All rights reserved.