| java.lang.Object com.ivata.mask.web.struts.util.MaskMessageResources
MaskMessageResources | public class MaskMessageResources (Code) | | Methods in this class wrap/extend the message resource system of
Struts.
since: ivata masks 0.5 (2005-01-20) author: Colin MacLeod author: colin.macleod@ivata.com version: $Revision: 1.4 $ |
Field Summary | |
final public static String | FIELD_PREFIX This is prepended to fields to get their message resource string. | final public static String | NULL_BUNDLE Name of the null bundle in the map. | final public static String | SUBMIT_PREFIX This is prepended to submit buttons to get their message resource string. | final public static String | TITLE_SUFFIX This string is appended to field names to find their titles in the
message resource bundle. | final public static String | VALUE_SUFFIX This string is appended to field names to find their values in the
message resource bundle. |
Method Summary | |
public String | getDefaultLabel(String fieldName, String labelKey, List labelArgs, String labelKeySuffix, boolean button, boolean mandatory) Get the default label for this field. | public String | getDefaultTitle(String fieldName, String titleKey, List titleArgs, boolean button, boolean mandatory) Get the default title for this field. | public String | getDefaultValue(String fieldName, String valueKey, List valueArgs, boolean button, boolean mandatory) Get the default value for this field. | public String | getMessage(String key) Refer to
MaskMessageResources.getMessage(String,List) .. | public String | getMessage(String key, List argsList) This first tries using the
bundle you provided. | public String | getMessage(String key, Object[] args) This first tries using the
bundle you provided. | public static MessageResources | getMessages(String bundleParam) Get a bundle with the given name.
Parameters: bundleParam - message resources identifier -see Struts docu. | public static synchronized void | registerMessages(String bundleParam, String fullPath) Register resources for a given bundle. |
FIELD_PREFIX | final public static String FIELD_PREFIX(Code) | | This is prepended to fields to get their message resource string.
|
NULL_BUNDLE | final public static String NULL_BUNDLE(Code) | | Name of the null bundle in the map.
|
SUBMIT_PREFIX | final public static String SUBMIT_PREFIX(Code) | | This is prepended to submit buttons to get their message resource string.
|
TITLE_SUFFIX | final public static String TITLE_SUFFIX(Code) | | This string is appended to field names to find their titles in the
message resource bundle.
|
VALUE_SUFFIX | final public static String VALUE_SUFFIX(Code) | | This string is appended to field names to find their values in the
message resource bundle.
|
MaskMessageResources | public MaskMessageResources(Locale localeParam, String bundleParam, String resourceFieldPathParam)(Code) | | Create message resources for a mask.
Parameters: localeParam - The current user's locale - used to localize messages. Parameters: bundleParam - Identifies the message resources to use. Parameters: resourceFieldPathParam - Identifies the prefix of the resourcesto search for first. |
getDefaultLabel | public String getDefaultLabel(String fieldName, String labelKey, List labelArgs, String labelKeySuffix, boolean button, boolean mandatory) throws SystemException(Code) | | Get the default label for this field. If no label key is specifically
set, the combination of
labelFieldPath + ".label" is tried in the
application resources. Failing that, the same is attempted using the
default path (defaultPath + ".label" ).
Parameters: fieldName - name of the field for which to return the title. Parameters: labelKey - key used to access the title in the resources. If thisis null , a default key is tried. Parameters: labelArgs - arguments used in conjunction with the key, in themessage resources. Parameters: labelKeySuffix - Some fields have multiple label keys. Thissuffix is appended to the key when retrieving the localized text from theapplication resources file. Parameters: button - buttons have a different default path to field.true if this field represents a button. Parameters: mandatory - if true an exception is thrown if novalue is found for this combination. title, if this tag has one, otherwise null . throws: SystemException - if the text cannot be retrieved because of asystem failure, or if the field is mandatory and cannot be found. |
getDefaultTitle | public String getDefaultTitle(String fieldName, String titleKey, List titleArgs, boolean button, boolean mandatory) throws SystemException(Code) | | Get the default title for this field. If no title key is specifically
set, the combination of
labelFieldPath + ".title" is tried in the
application resources. Failing that, the same is attempted using the
default path (defaultPath + ".title" ).
Parameters: fieldName - name of the field for which to return the title. Parameters: titleKey - key used to access the title in the resources. If thisis null , a default key is tried. Parameters: titleArgs - arguments used in conjunction with the key, in themessage resources. Parameters: button - buttons have a different default path to field.true if this field represents a button. Parameters: mandatory - if true an exception is thrown if novalue is found for this combination. title, if this tag has one, otherwise null . throws: SystemException - if the text cannot be retrieved because of asystem failure, or if the field is mandatory and cannot be found. |
getDefaultValue | public String getDefaultValue(String fieldName, String valueKey, List valueArgs, boolean button, boolean mandatory) throws SystemException(Code) | | Get the default value for this field. If no value key is specifically
set, the combination of
labelFieldPath + ".value" is tried in the
application resources. Failing that, the same is attempted using the
default path (defaultPath + ".value" ).
Parameters: fieldName - name of the field for which to return the title. Parameters: valueKey - key used to access the title in the resources. If thisis null , a default key is tried. Parameters: valueArgs - arguments used in conjunction with the key, in themessage resources. Parameters: button - buttons have a different default path to field.true if this field represents a button. Parameters: mandatory - if true an exception is thrown if novalue is found for this combination. title, if this tag has one, otherwise null . throws: SystemException - if the text cannot be retrieved because of asystem failure, or if the field is mandatory and cannot be found. |
getMessage | public String getMessage(String key, List argsList) throws SystemException(Code) | | This first tries using the
bundle you provided. If that returns null , it tries again
without a bundle.
Parameters: key - Refer to MessageResources.getMessage. Parameters: argsList - Will be converted to an array of objects. Refer toMessageResources.getMessage. Refer to MessageResources.getMessage. throws: SystemException - Refer to MessageResources.getMessage. |
getMessage | public String getMessage(String key, Object[] args) throws SystemException(Code) | | This first tries using the
bundle you provided. If that returns null , it tries again
without a bundle.
Parameters: key - Refer to MessageResources.getMessage. Parameters: args - Refer to MessageResources.getMessage. Refer to MessageResources.getMessage. throws: SystemException - Refer to MessageResources.getMessage. |
getMessages | public static MessageResources getMessages(String bundleParam) throws SystemException(Code) | | Get a bundle with the given name.
Parameters: bundleParam - message resources identifier -see Struts docu. resources message resources instance. throws: SystemException - if the message resources are undefined. |
registerMessages | public static synchronized void registerMessages(String bundleParam, String fullPath)(Code) | | Register resources for a given bundle.
Parameters: bundleParam - message resources identifier - see Struts docu. Parameters: fullPath - full path to the resources |
|
|