|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.fuin.objects4j.LabelInfo
@Immutable public abstract class LabelInfo
Label information for a concrete object.
| Constructor Summary | |
|---|---|
LabelInfo(String text,
String shortText)
Constructor with text and short text. |
|
| Method Summary | |
|---|---|
static ResourceBundle |
getResourceBundle(Label label,
Locale locale,
Class<?> clasz)
Returns the resource bundle for a given label. |
String |
getShortText()
Returns the abbreviation of the text. |
static String |
getShortText(ResourceBundle bundle,
Label label,
String defaultKey)
Returns the short text for the label. |
String |
getText()
Returns the text of the label. |
static String |
getText(ResourceBundle bundle,
Label label,
String defaultKey)
Returns the text for the label. |
protected static String |
toNullableString(String value)
Returns null if the argument is an empty string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LabelInfo(String text,
String shortText)
text - Text.shortText - Abbreviation of the text.| Method Detail |
|---|
public final String getText()
public final String getShortText()
@Requires(value="(bundle != null) && (label != null) && (field!=null)")
public static String getText(ResourceBundle bundle,
Label label,
String defaultKey)
Label.key() then Label.value() will be
returned instead. If Label.value() is also empty then
null is returned. If Label.key() is empty
defaultKey will be used as key in the properties file.
bundle - Resource bundle to use.label - Label for the field.defaultKey - Default key if Label.key() is empty.
null.
@Requires(value="(bundle != null) && (label != null) && (field!=null)")
public static String getShortText(ResourceBundle bundle,
Label label,
String defaultKey)
Label.shortKey() then
Label.shortText() will be returned instead. If
Label.shortText() is also empty then null is
returned. If Label.shortKey() is empty defaultKey
will be used as key in the properties file.
bundle - Resource bundle to use.label - Label for the field.defaultKey - Default key if Label.shortKey() is empty.
null.
@Requires(value="(label != null) && (locale != null) && (clasz != null)")
@Ensures(value="\result != null")
public static ResourceBundle getResourceBundle(Label label,
Locale locale,
Class<?> clasz)
label.bundle() is empty the clasz is used to
create a path and filename information.
label - Label with bundle name.locale - Locale to use.clasz - Class to use if the label.bundle() is empty.
Example: a.b.c.MyClass is used as
a/b/c/MyClass.properties or
a/b/c/MyClass_en.properties (with
Locale.ENGLISH).
protected static String toNullableString(String value)
null if the argument is an empty string.
value - Argument to check.
null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||