|
||||||||||
| 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(java.lang.String text,
java.lang.String shortText)
Constructor with text and short text. |
|
| Method Summary | |
|---|---|
static java.util.ResourceBundle |
getResourceBundle(Label label,
java.util.Locale locale,
java.lang.Class<?> clasz)
Returns the resource bundle for a given label. |
java.lang.String |
getShortText()
Returns the abbreviation of the text. |
static java.lang.String |
getShortText(java.util.ResourceBundle bundle,
Label label,
java.lang.String defaultKey)
Returns the short text for the label. |
java.lang.String |
getText()
Returns the text of the label. |
static java.lang.String |
getText(java.util.ResourceBundle bundle,
Label label,
java.lang.String defaultKey)
Returns the text for the label. |
protected static java.lang.String |
toNullableString(java.lang.String value)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LabelInfo(java.lang.String text,
java.lang.String shortText)
text - Text.shortText - Abbreviation of the text.| Method Detail |
|---|
public final java.lang.String getText()
public final java.lang.String getShortText()
@Requires(value="(bundle != null) && (label != null) && (field!=null)")
public static java.lang.String getText(java.util.ResourceBundle bundle,
Label label,
java.lang.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 java.lang.String getShortText(java.util.ResourceBundle bundle,
Label label,
java.lang.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 java.util.ResourceBundle getResourceBundle(Label label,
java.util.Locale locale,
java.lang.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 java.lang.String toNullableString(java.lang.String value)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||