com.ivata.mask.web.tag.html
Class MaskProperties

java.lang.Object
  extended bycom.ivata.mask.web.tag.html.MaskProperties

public class MaskProperties
extends java.lang.Object

This is the implementation of routines shared across the Struts override tags. It originally appeared in ivata op .

One of the functions of these properties is to automate message resource paths. If a label key, or a title is not specified for a tag, it is defaulted by searching for the key in the bundle specified and, if it is not found there, in the main bundle.

This docu is not complete. For an example of the paths and how they work, please refer to the ApplicationResources file in the ivata masks demo. TODO: explain fully the path defaulting here...

Since:
ivata masks 0.4 (2003-01-18)
Author:
Colin MacLeod colin.macleod@ivata.com

Constructor Summary
MaskProperties()
           
 
Method Summary
 java.lang.String getBundle()
           Set the bundle for this mask tag.
 java.lang.String getClassName()
           In a label tag, you can specify a class for which to display the correct label.
 java.lang.String getFieldName()
           The field name is used to default the following attributes of the tag:
styleId titleKey valueKey .
 java.util.List getLabelArgs()
           Contains any arguments to the label key.
 java.lang.String getLabelKey()
           Localization key of a string which will appear as a label, for example to the right of a check box.
 java.lang.String getLabelKeySuffix()
           Some fields have multiple label keys.
 java.lang.String getLocale()
           String representation of the current locale.
 boolean getMandatory()
           Get whether or not the value this control must be entered.
 javax.servlet.jsp.PageContext getPageContext()
           Current JSP page context.
 FormTag getParentForm()
           Stores a reference to the FormTag which surrounds this mask tagf.
 boolean getReadOnly()
           Specifies whether or not the input values can be altered.
 java.lang.String getTitle()
           Get the value of the title for this tag.
 java.util.List getTitleArgs()
           Contains any arguments to the title key.
 java.lang.String getTitleKey()
           Stores the value of the key used to localize the title tag attribute.
 java.lang.String getValue()
           Get the localized value text from the value key and arguments.
 java.util.List getValueArgs()
           Contains any arguments to the value key.
 java.lang.String getValueKey()
           Stores the value of the key used to localize the value tag attribute.
 void modifyIfMandatory(org.apache.struts.taglib.html.BaseHandlerTag control)
           Modified the Struts control provided on the basis of whether or not it is mandatory.
 void reset(org.apache.struts.taglib.html.BaseHandlerTag maskTag)
           Reset the attributes and mask properties of the supplied tag.
 void setBundle(java.lang.String bundleParam)
          Refer to getBundle().
 void setClassName(java.lang.String classNameParam)
          Refer to getClassName().
 void setFieldName(java.lang.String fieldNameParam)
           The field name is used to default the following attributes of the tag:
styleId titleKey valueKey .
 void setLabelArgs(java.util.List args)
          Set the arguments for the label message, as an array of strings.
 void setLabelKey(java.lang.String labelKeyParam)
           Localization key of a string which will appear as a label, for example to the right of a check box.
 void setLabelKeySuffix(java.lang.String labelKeySuffixParam)
           Some fields have multiple label keys.
 void setLocale(java.lang.String localeParam)
           String representation of the current locale.
 void setMandatory(boolean mandatoryParam)
           Set whether or not the value this control must be entered.
 void setPageContext(javax.servlet.jsp.PageContext pageContextParam)
           Current JSP page context.
 void setParentForm(FormTag parentFormParam)
           Stores a reference to the FormTag which surrounds this mask tagf.
 void setReadOnly(boolean readOnlyParam)
           Specifies whether or not the input values can be altered.
 void setTitleArgs(java.util.List args)
          Set the arguments for the title message.
 void setTitleKey(java.lang.String titleKeyParam)
           Stores the value of the key used to localize the title tag attribute.
 void setValueArgs(java.util.List valueArgsParam)
           Contains any arguments to the value key.
 void setValueKey(java.lang.String valueKeyParam)
           Stores the value of the key used to localize the value tag attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MaskProperties

public MaskProperties()
Method Detail

getBundle

public final java.lang.String getBundle()

Set the bundle for this mask tag. The bundle is used to identify the set of message resources used to localize texts. See the Struts docu for more information.

Returns:
text name of the message resources.

getClassName

public java.lang.String getClassName()

In a label tag, you can specify a class for which to display the correct label.

Returns:
Returns the className.

getFieldName

public java.lang.String getFieldName()

The field name is used to default the following attributes of the tag:

.

The valueKey and titleKey are obtained by prefixing the value of resourceFieldPath from the surrounding form.

Returns:
the current value of fieldName.

getLabelArgs

public java.util.List getLabelArgs()

Contains any arguments to the label key.

Returns:
the current value of labelArgs.

getLabelKey

public java.lang.String getLabelKey()

Localization key of a string which will appear as a label, for example to the right of a check box.

Returns:
the current value of labelKey.

getLabelKeySuffix

public java.lang.String getLabelKeySuffix()

Some fields have multiple label keys. This suffix is appended to the key when retrieving the localized text from the application resources file.

Returns:
the current value of labelKeySuffix.

getLocale

public java.lang.String getLocale()

String representation of the current locale. Taken from the session in doStartTag.

Returns:
the current value of locale.

getMandatory

public boolean getMandatory()

Get whether or not the value this control must be entered.

Returns:
true if this field must be entered, otherwise false if the field is optional.

getPageContext

public javax.servlet.jsp.PageContext getPageContext()

Current JSP page context. Set in doStartTag.

Returns:
the current value of pageContext.

getParentForm

public FormTag getParentForm()

Stores a reference to the FormTag which surrounds this mask tagf.

Returns:
the current value of parentForm.

getReadOnly

public boolean getReadOnly()

Specifies whether or not the input values can be altered.

The handling here has been extended to take into account the state of the parent form. If the read only state of this tag has not been set explicitly (by setReadOnly(boolean readOnly), then we get the read only state of the parent formtag and return that.

Returns:
true if the input of this field can be changed, otherwise false to only display the current value.

getTitle

public java.lang.String getTitle()
                          throws javax.servlet.jsp.JspException

Get the value of the title for this tag.

Returns:
the current value of title.
Throws:
javax.servlet.jsp.JspException - thrown by getMessage.

getTitleArgs

public java.util.List getTitleArgs()

Contains any arguments to the title key.

Returns:
the current value of titleArgs.

getTitleKey

public java.lang.String getTitleKey()

Stores the value of the key used to localize the title tag attribute.

Returns:
the current value of titleKey.

getValue

public java.lang.String getValue()
                          throws javax.servlet.jsp.JspException

Get the localized value text from the value key and arguments.

Returns:
localized text representing valueKey.
Throws:
javax.servlet.jsp.JspException - thrown by getMessage.

getValueArgs

public java.util.List getValueArgs()

Contains any arguments to the value key.

Returns:
the current value of valueArgs.

getValueKey

public java.lang.String getValueKey()

Stores the value of the key used to localize the value tag attribute.

Returns:
the current value of valueKey.

modifyIfMandatory

public void modifyIfMandatory(org.apache.struts.taglib.html.BaseHandlerTag control)

Modified the Struts control provided on the basis of whether or not it is mandatory.

Parameters:
control - Struts tag instance to be modified on the basis of whether or not it is mandatory.

reset

public void reset(org.apache.struts.taglib.html.BaseHandlerTag maskTag)
           throws javax.servlet.jsp.JspException

Reset the attributes and mask properties of the supplied tag. This method should be called after all processing on the tag, as the tag instances are re-used by the servlet engine. Calling this method ensures no two tags sharing the same instance receive the same attributes.

Parameters:
maskTag - the tag whose properties should be reset.
Throws:
javax.servlet.jsp.JspException - if there is an error accessing methods to reset, using PropertyUtils.setSimpleProperty.

setBundle

public void setBundle(java.lang.String bundleParam)
Refer to getBundle().

Parameters:
bundleParam - Refer to getBundle().

setClassName

public void setClassName(java.lang.String classNameParam)
Refer to getClassName().

Parameters:
classNameParam - Refer to getClassName().

setFieldName

public void setFieldName(java.lang.String fieldNameParam)

The field name is used to default the following attributes of the tag:

.

The valueKey and titleKey are obtained by prefixing the value of resourceFieldPath from the surrounding form.

Parameters:
fieldNameParam - the new value of fieldName.

setLabelArgs

public void setLabelArgs(java.util.List args)
Set the arguments for the label message, as an array of strings.

Parameters:
args - new value of the message argument.

setLabelKey

public final void setLabelKey(java.lang.String labelKeyParam)

Localization key of a string which will appear as a label, for example to the right of a check box.

Parameters:
labelKeyParam - the new value of labelKey.

setLabelKeySuffix

public final void setLabelKeySuffix(java.lang.String labelKeySuffixParam)

Some fields have multiple label keys. This suffix is appended to the key when retrieving the localized text from the application resources file.

Parameters:
labelKeySuffixParam - the new value of labelKeySuffix.

setLocale

public void setLocale(java.lang.String localeParam)

String representation of the current locale. Taken from the session in doStartTag.

Parameters:
localeParam - the new value of locale.

setMandatory

public void setMandatory(boolean mandatoryParam)

Set whether or not the value this control must be entered.

Parameters:
mandatoryParam - true if this field must be entered, otherwise false if the field is optional.

setPageContext

public void setPageContext(javax.servlet.jsp.PageContext pageContextParam)

Current JSP page context. Set in doStartTag.

Parameters:
pageContextParam - the new value of pageContext.

setParentForm

public void setParentForm(FormTag parentFormParam)

Stores a reference to the FormTag which surrounds this mask tagf.

Parameters:
parentFormParam - the new value of parentForm.

setReadOnly

public void setReadOnly(boolean readOnlyParam)

Specifies whether or not the input values can be altered.

Parameters:
readOnlyParam - true if the input of this field can be changed, otherwise false to only display the current value.

setTitleArgs

public final void setTitleArgs(java.util.List args)
Set the arguments for the title message.

Parameters:
args - new value of the title arguments.

setTitleKey

public final void setTitleKey(java.lang.String titleKeyParam)

Stores the value of the key used to localize the title tag attribute.

Parameters:
titleKeyParam - the new value of titleKey.

setValueArgs

public final void setValueArgs(java.util.List valueArgsParam)

Contains any arguments to the value key.

Parameters:
valueArgsParam - the new value of valueArgs.

setValueKey

public void setValueKey(java.lang.String valueKeyParam)

Stores the value of the key used to localize the value tag attribute.

Parameters:
valueKeyParam - the new value of valueKey.


Copyright © 2001-2005 ivata limited. All Rights Reserved.