|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pf.nls.TextContainer
public class TextContainer
This is is a simple container for text strings associated with an identifying key. It also allows to set a default TextContainer which will be checked for a key if this container cannot find it.
Constructor Summary | |
---|---|
TextContainer(Locale aLocale)
Initialize the new instance with default values. |
Method Summary | |
---|---|
boolean |
containsKey(String key)
Returns true if this container or its default container can provide a text for the specified key. |
boolean |
containsNothing()
Returns true if this container holds no text and also its default container contains nothing. |
IExtendedTextProvider |
getDefaultProvider()
Returns the default container that will be used if a key cannot be found in this container. |
String[] |
getKeys()
Returns an array with all keys of this container. |
Locale |
getLocale()
Returns the locale for which this container holds the text strings |
Locale[] |
getLocales()
Returns the locales for which this text provider has text |
String |
getText(String key)
Returns the text associated with the given key or null if the key cannot be found. |
boolean |
hasKey(String key)
Returns true if this container can provide a text for the specified key. |
boolean |
isEmpty()
Returns true if this container holds no text. |
void |
setDefaultProvider(IExtendedTextProvider textContainer)
Sets the default container. |
int |
size()
Returns the number of entries in this container. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TextContainer(Locale aLocale)
Method Detail |
---|
public IExtendedTextProvider getDefaultProvider()
public void setDefaultProvider(IExtendedTextProvider textContainer)
textContainer
- A new default container or null to remove any existingpublic Locale getLocale()
public String getText(String key)
getText
in interface ITextProvider
key
- The identifier for the textpublic Locale[] getLocales()
getLocales
in interface IExtendedTextProvider
public String[] getKeys()
public boolean containsKey(String key)
key
- The key to lookuphasKey(String)
public boolean hasKey(String key)
key
- The key to lookupcontainsKey(String)
public boolean isEmpty()
containsNothing()
public boolean containsNothing()
containsNothing
in interface IExtendedTextProvider
isEmpty()
public int size()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |