|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.ivata.mask.web.struts.util.MessageResourcesHandling
Methods in this class wrap/extend the message resource system of Struts.
| Field Summary | |
static java.lang.String |
FIELD_PREFIX
This is prepended to fields to get their message resource string. |
static java.lang.String |
SUBMIT_PREFIX
This is prepended to submit buttons to get their message resource string. |
static java.lang.String |
TITLE_SUFFIX
This string is appended to field names to find their titles in the message resource bundle. |
static java.lang.String |
VALUE_SUFFIX
This string is appended to field names to find their values in the message resource bundle. |
| Method Summary | |
static java.lang.String |
getDefaultLabel(java.util.Locale locale,
java.lang.String bundle,
java.lang.String fieldName,
java.lang.String labelKey,
java.util.List labelArgs,
java.lang.String resourceFieldPath,
java.lang.String labelKeySuffix,
boolean button,
boolean mandatory)
Get the default label for this field. |
static java.lang.String |
getDefaultTitle(java.util.Locale locale,
java.lang.String bundle,
java.lang.String fieldName,
java.lang.String titleKey,
java.util.List titleArgs,
java.lang.String resourceFieldPath,
boolean button,
boolean mandatory)
Get the default title for this field. |
static java.lang.String |
getDefaultValue(java.util.Locale locale,
java.lang.String bundle,
java.lang.String fieldName,
java.lang.String valueKey,
java.util.List valueArgs,
java.lang.String resourceFieldPath,
boolean button,
boolean mandatory)
Get the default value for this field. |
static java.lang.String |
getMessage(java.lang.String bundle,
java.util.Locale locale,
java.lang.String key,
java.util.List argsList)
This first tries using the bundle you provided. |
static java.lang.String |
getMessage(java.lang.String bundle,
java.util.Locale locale,
java.lang.String key,
java.lang.Object[] args)
This first tries using the bundle you provided. |
static java.lang.String |
getMessage(java.lang.String bundle,
java.lang.String locale,
java.lang.String key,
java.util.List args)
This first tries using the bundle you provided. |
static java.lang.String |
getMessage(java.lang.String bundle,
java.lang.String locale,
java.lang.String key,
java.lang.Object[] args)
This first tries using the bundle you provided. |
static org.apache.struts.util.MessageResources |
getMessages(java.lang.String bundle)
Get a bundle with the given name. |
static boolean |
isGuessLabel()
|
static void |
registerMessages(java.lang.String bundle,
java.lang.String fullPath)
Register resources for a given bundle. |
static void |
setGuessLabel(boolean guessLabelParam)
Refer to #getguessLabel. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static java.lang.String FIELD_PREFIX
public static java.lang.String SUBMIT_PREFIX
public static java.lang.String TITLE_SUFFIX
public static java.lang.String VALUE_SUFFIX
| Method Detail |
public static java.lang.String getDefaultLabel(java.util.Locale locale,
java.lang.String bundle,
java.lang.String fieldName,
java.lang.String labelKey,
java.util.List labelArgs,
java.lang.String resourceFieldPath,
java.lang.String labelKeySuffix,
boolean button,
boolean mandatory)
throws com.ivata.mask.util.SystemException
labelFieldPath + ".label" is tried in the
application resources. Failing that, the same is attempted using the
default path (defaultPath + ".label").
locale - Refer to MessageResources.getMessage(java.lang.String).bundle - Refer to MessageResources.getMessage(java.lang.String).fieldName - name of the field for which to return the title.labelKey - key used to access the title in the resources. If this
is null, a default key is tried.labelArgs - arguments used in conjunction with the key, in the
message resources.resourceFieldPath - this is the root of the message resource path
searched. This is usually specific to an input mask, or a value object.labelKeySuffix - Some fields have multiple label keys. This
suffix is appended to the key when retrieving the localized text from the
application resources file.button - buttons have a different default path to field.
true if this field represents a button.mandatory - if true an exception is thrown if no
value is found for this combination.
null.
com.ivata.mask.util.SystemException - if the text cannot be retrieved because of a
system failure, or if the field is mandatory and cannot be found.
public static java.lang.String getDefaultTitle(java.util.Locale locale,
java.lang.String bundle,
java.lang.String fieldName,
java.lang.String titleKey,
java.util.List titleArgs,
java.lang.String resourceFieldPath,
boolean button,
boolean mandatory)
throws com.ivata.mask.util.SystemException
labelFieldPath + ".title" is tried in the
application resources. Failing that, the same is attempted using the
default path (defaultPath + ".title").
locale - Refer to MessageResources.getMessage(java.lang.String).bundle - Refer to MessageResources.getMessage(java.lang.String).fieldName - name of the field for which to return the title.titleKey - key used to access the title in the resources. If this
is null, a default key is tried.titleArgs - arguments used in conjunction with the key, in the
message resources.resourceFieldPath - this is the root of the message resource path
searched. This is usually specific to an input mask, or a value object.button - buttons have a different default path to field.
true if this field represents a button.mandatory - if true an exception is thrown if no
value is found for this combination.
null.
com.ivata.mask.util.SystemException - if the text cannot be retrieved because of a
system failure, or if the field is mandatory and cannot be found.
public static java.lang.String getDefaultValue(java.util.Locale locale,
java.lang.String bundle,
java.lang.String fieldName,
java.lang.String valueKey,
java.util.List valueArgs,
java.lang.String resourceFieldPath,
boolean button,
boolean mandatory)
throws com.ivata.mask.util.SystemException
labelFieldPath + ".value" is tried in the
application resources. Failing that, the same is attempted using the
default path (defaultPath + ".value").
locale - Refer to MessageResources.getMessage(java.lang.String).bundle - Refer to MessageResources.getMessage(java.lang.String).fieldName - name of the field for which to return the title.valueKey - key used to access the title in the resources. If this
is null, a default key is tried.valueArgs - arguments used in conjunction with the key, in the
message resources.resourceFieldPath - this is the root of the message resource path
searched. This is usually specific to an input mask, or a value object.button - buttons have a different default path to field.
true if this field represents a button.mandatory - if true an exception is thrown if no
value is found for this combination.
null.
com.ivata.mask.util.SystemException - if the text cannot be retrieved because of a
system failure, or if the field is mandatory and cannot be found.
public static java.lang.String getMessage(java.lang.String bundle,
java.util.Locale locale,
java.lang.String key,
java.util.List argsList)
throws com.ivata.mask.util.SystemException
null, it tries again
without a bundle.
bundle - Refer to MessageResources.getMessage(java.lang.String).locale - Refer to MessageResources.getMessage(java.lang.String).key - Refer to MessageResources.getMessage(java.lang.String).argsList - Will be converted to an array of objects. Refer to
MessageResources.getMessage(java.lang.String).
MessageResources.getMessage(java.lang.String).
com.ivata.mask.util.SystemException - Refer to MessageResources.getMessage(java.lang.String).TagUtils.getInstance()
public static java.lang.String getMessage(java.lang.String bundle,
java.util.Locale locale,
java.lang.String key,
java.lang.Object[] args)
throws com.ivata.mask.util.SystemException
null, it tries again
without a bundle.
bundle - Refer to MessageResources.getMessage(java.lang.String).locale - Refer to MessageResources.getMessage(java.lang.String).key - Refer to MessageResources.getMessage(java.lang.String).args - Refer to MessageResources.getMessage(java.lang.String).
MessageResources.getMessage(java.lang.String).
com.ivata.mask.util.SystemException - Refer to MessageResources.getMessage(java.lang.String).TagUtils.getInstance()
public static java.lang.String getMessage(java.lang.String bundle,
java.lang.String locale,
java.lang.String key,
java.util.List args)
throws com.ivata.mask.util.SystemException
null, it tries again
without a bundle.
bundle - Refer to MessageResources.getMessage(java.lang.String).locale - Refer to MessageResources.getMessage(java.lang.String).key - Refer to MessageResources.getMessage(java.lang.String).args - Will be converted to an array of objects. Refer to
MessageResources.getMessage(java.lang.String).
MessageResources.getMessage(java.lang.String).
com.ivata.mask.util.SystemException - Refer to MessageResources.getMessage(java.lang.String).TagUtils.getInstance()
public static java.lang.String getMessage(java.lang.String bundle,
java.lang.String locale,
java.lang.String key,
java.lang.Object[] args)
throws com.ivata.mask.util.SystemException
null, it tries again
without a bundle.
bundle - Refer to MessageResources.getMessage(java.lang.String).locale - Refer to MessageResources.getMessage(java.lang.String).key - Refer to MessageResources.getMessage(java.lang.String).args - Refer to MessageResources.getMessage(java.lang.String).
MessageResources.getMessage(java.lang.String).
com.ivata.mask.util.SystemException - Refer to MessageResources.getMessage(java.lang.String).TagUtils.getInstance()
public static org.apache.struts.util.MessageResources getMessages(java.lang.String bundle)
throws com.ivata.mask.util.SystemException
bundle - message resources identifier - see Struts
docu.
com.ivata.mask.util.SystemException - if the message resources are undefined.public static boolean isGuessLabel()
public static void registerMessages(java.lang.String bundle,
java.lang.String fullPath)
bundle - message resources identifier - see Struts
docu.fullPath - full path to the resourcespublic static void setGuessLabel(boolean guessLabelParam)
#getguessLabel.
guessLabelParam - Refer to #getguessLabel.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||