org.norther.tammi.spray.template.tool
Class FormTool

java.lang.Object
  extended by org.norther.tammi.core.rt.Introspector
      extended by org.norther.tammi.spray.engine.tool.BeanTool
          extended by org.norther.tammi.spray.template.tool.FormTool
All Implemented Interfaces:
Serializable, EventListener, Poolable, Recyclable, ContextBindingListener, FormContext

public class FormTool
extends BeanTool
implements FormContext

A request context tool for rendering forms.

Version:
$Id: FormTool.java,v 1.110 2010-07-01 06:58:58 cvsimp Exp $
Author:
Ilkka Priha
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.norther.tammi.spray.template.form.FormContext
FORM_INDEX_SEPARATOR, FORM_NAME_SEPARATOR, FORM_NAME_SPLITTER, FORM_PREFIX_SEPARATOR, PARAMETER_ELEMENT_SEPARATOR
 
Constructor Summary
FormTool()
          Constructs a new form.
 
Method Summary
 boolean checkPermission(String actions)
          Checks access permission for the current form.
 boolean checkPermission(Variable variable, String actions)
          Checks access permission for the specified variable.
 void clearContext()
          Clears the context.
 void clearFormParameters()
          Clears the request parameters of the current form.
 void clearPostFields()
          Clears all post fields.
 boolean contains(String name)
          Checks whether the current form variable contains the named attribute.
 boolean containsPostField(String name)
          Checks a post fields.
 boolean containsTrait(String trait)
          Checks whether the current form variable contains any attribute with the named trait.
 boolean containsTrait(VariableAttributeInfo.Trait trait)
          Checks whether the current form variable contains any attribute with the specified trait.
protected  Variable createVariable(String type)
          Creates a variable MBean instance.
 void dispose()
          Disposes the object after use.
 VariableAttributeInfo firstInfo(String trait)
          Returns the first attribute of the current form variable with the named trait set.
 VariableAttributeInfo firstInfo(Variable variable, String trait)
          Returns the first attribute of the specified form variable with the named trait set.
<T> Comparator<T>
getComparator()
          Gets the comparator of the current form attribute.
 String getDescription()
          Gets the current form attribute description.
 String getDescription(MBeanAttributeInfo attribute)
          Gets the specified form attribute description.
 String getDetail()
          Gets the current form attribute detail.
 String getDetail(MBeanAttributeInfo attribute)
          Gets the specified form attribute detail.
 String getDetail(MBeanAttributeInfo attribute, Object arg)
          Gets the specified form attribute detail.
 String getDetail(Object arg)
          Gets the current form attribute detail with an argument.
 int getElement()
          Gets the array index of the current form attribute element.
 EnumeratedList getEnumeration()
          Gets the current form attribute value enumeration as a list of localized enumeration entries.
 EnumeratedList getEnumeration(MBeanAttributeInfo attribute)
          Gets the specified form attribute value enumeration as a list of localized enumeration attributes.
 EnumeratedList getEnumeration(Variable variable, MBeanAttributeInfo attribute)
          Gets the specified attribute value enumeration as a list of localized enumeration attributes.
 Exception getException()
          Gets the current form attribute validation exception.
 Exception getException(MBeanAttributeInfo attribute, int... element)
          Gets the specified form attribute invalidation message.
 String getExtension()
          Gets the extension of this request.
 FormContext getFormContext()
          Gets the form context.
protected  FormFilter getFormFilter()
          Gets the form filter from the filter stack.
 int getFormIndex()
          Gets the index of the current form variable, if any.
 String getFormName()
          Gets the name of the current form, if any.
 Map<String,Object> getFormParameters()
          Gets request parameters of the current form.
 String getFormPrefix()
          Gets the prefix of the current form variable and form, if any.
 String getFormPrefix(int index)
          Gets the prefix of the indexed form variable and the current form.
 String getGroup()
          Gets the current form attribute group.
 String getGroup(MBeanAttributeInfo attribute)
          Gets the specified form attribute group.
 String getIndexField()
          Gets the name of the form index field.
 MBeanAttributeInfo getInfo()
          Gets the attribute info of the current form attribute.
 MBeanAttributeInfo getInfo(boolean unlocked)
          Gets the optionally unlocked attribute info of the current form attribute.
 VariableAttributeInfo getInfo(String name)
          Gets the named attribute info of the current form variable.
 VariableAttributeInfo getInfo(String name, boolean unlocked)
          Gets the named and optionally unlocked attribute info of the current form variable.
 List<VariableAttributeInfo> getInfos()
          Gets the attribute info list of the current form variable.
 List<VariableAttributeInfo> getInfos(boolean unlocked)
          Gets the optionally unlocked attribute info list of the current form variable.
 String getInvalidation()
          Gets the current form attribute invalidation message.
 String getInvalidation(MBeanAttributeInfo attribute, int... element)
          Gets the specified form attribute invalidation message.
 Object getKeyValue()
          Gets the current form key attribute value.
 Object getKeyValue(MBeanAttributeInfo attribute)
          Gets the specified form key attribute value.
 Object getKeyValue(String name)
          Gets the named key attribute value of the current form variable.
 Number getMax()
          Gets the maximum value of the current form attribute.
 Number getMin()
          Gets the minimum value of the current form attribute.
 String getName()
          Gets the current form attribute or element name with the form prefix.
 String getName(int index)
          Gets the current form element name with the form prefix.
 String getName(MBeanAttributeInfo attribute)
          Gets the specified form attribute name with the form prefix.
 String getName(MBeanAttributeInfo attribute, int index)
          Gets the specified form attribute element name with the form prefix.
 String getName(String name)
          Gets the form attribute name with the form prefix.
 String getName(String name, int index)
          Gets the form attribute element name with the form prefix.
 String getNameField()
          Gets the name of the form name field.
 String getNestedPrefix()
          Gets the nested form prefix.
protected  PageFilter getPageFilter()
          Gets the page filter from the filter stack.
 String getParameter()
          Gets the request parameter or element of the current form attribute.
 String getParameter(MBeanAttributeInfo attribute)
          Gets the request parameter of the specified form attribute.
 String getParameter(MBeanAttributeInfo attribute, int index)
          Gets the request parameter of the specified form attribute element.
 String getParameter(String name)
          Gets a named request parameter.
 String getParameter(String name, String def)
          Gets a named request parameter with a default value.
 String[] getParameters()
          Gets the request parameters of the current form attribute.
 String[] getParameters(MBeanAttributeInfo attribute)
          Gets the request parameters of the specified form attribute.
 String[] getParameters(String name)
          Gets named request parameters.
 String[] getParameters(String name, String[] defs)
          Gets named request parameters with default values.
 FormContext getParentContext()
          Gets the parent context, if any.
 String getPattern()
          Gets the pattern of the current form attribute.
 Map<String,String> getPostFields()
          Gets post fields.
 String getQualifier()
          Gets the current form attribute qualifier.
 String getQualifier(MBeanAttributeInfo attribute)
          Gets the specified form attribute qualifier.
 FormContext getRootContext()
          Gets the root context.
 int getSelectedEnum()
          Gets the index of the selected enumeration of the current form attribute.
 int getSelectedEnum(MBeanAttributeInfo attribute)
          Gets the index of the selected enumeration of the specified form attribute.
 int getSelectedEnum(MBeanAttributeInfo attribute, int index)
          Gets the index of the element enumeration of the specified form attribute element.
 OrderedSet<Integer> getSelectedEnums()
          Gets the indices of the selected enumerations of the current form attribute.
 OrderedSet<Integer> getSelectedEnums(MBeanAttributeInfo attribute)
          Gets the indices of the selected enumerations of the specified form attribute.
 int getSelectedLine()
          Gets the selected line number of the current form attribute.
 int getSelectedLine(MBeanAttributeInfo attribute)
          Gets the selected line number of the specified form attribute.
 OrderedSet<Integer> getSelectedLines()
          Gets the selected line numbers of the current form attribute.
 OrderedSet<Integer> getSelectedLines(MBeanAttributeInfo attribute)
          Gets the selected line numbers of the specified form attribute.
 Object getSelectedValue()
          Gets the current form attribute value or element selected by the user.
 Object getSelectedValue(MBeanAttributeInfo attribute)
          Gets the specified form attribute value selected by the user.
 Object getSelectedValue(MBeanAttributeInfo attribute, int index)
          Gets the specified form attribute element selected by the user.
 Object[] getSelectedValues()
          Gets the current form attribute values selected by the user.
 Object[] getSelectedValues(MBeanAttributeInfo attribute)
          Gets the specified form attribute values selected by the user.
 String getTagId(String tag)
          Gets a unique tag id for the current form attribute.
 String getTagId(String tag, int index)
          Gets a unique tag id for the indexed value of the current form attribute.
 String getTagId(String tag, MBeanAttributeInfo attribute)
          Gets a unique tag if for the specified form attribute.
 String getTagId(String tag, MBeanAttributeInfo attribute, int index)
          Gets a unique tag id for the indexed value of the specified form attribute.
 String getTagId(String tag, String name)
          Gets a unique tag id for the named form attribute.
 String getTagId(String tag, String name, int index)
          Gets a unique tag id for the indexed value of the named form attribute.
 String getTheme()
          Gets the form theme of this request.
 String getType()
          Gets the current form attribute type.
 String getType(MBeanAttributeInfo attribute)
          Gets the specified form attribute type.
 SortedMap<String,Exception> getValidation()
          Gets validation exceptions of the current form variable.
 SortedMap<String,Exception> getValidation(Variable variable, int... index)
          Gets validation exceptions of the indexed form variable.
 Object getValue()
          Gets the current form attribute value or element without string conversion or localization.
 Object getValue(int index)
          Gets the indexed element of the current form attribute value without string conversion or localization.
 Object getValue(MBeanAttributeInfo attribute)
          Gets the specified form attribute value without string conversion or localization.
 Object getValue(MBeanAttributeInfo attribute, int index)
          Gets indexed element of the specified form attribute value without string conversion or localization.
 Object getValue(String name)
          Gets the named attribute value of the current form variable.
 Object getValue(String name, int index)
          Gets indexed element of the named attribute value of the current form variable.
 Variable getVariable()
          Gets the current form variable.
 boolean isArray()
          Checks if the current form attribute is an array.
 boolean isEnumerated()
          Checks if the current form attribute is an enumerated.
 boolean isEqualGroup(MBeanAttributeInfo attribute)
          Checks whether the specified group equals with the current one.
 boolean isInvalid()
          Checks whether the current form attribute is invalid.
 boolean isInvalid(MBeanAttributeInfo attribute, int... element)
          Checks whether the specified form attribute is invalid.
 boolean isLocalized()
          Checks whether variables are localized.
 boolean isReadable()
          Checks if the current form attribute is readable.
 boolean isReadOnly()
          Checks whether the current form is read-only.
 boolean isSameGroup(MBeanAttributeInfo attribute)
          Checks whether the current group should be applied to the specified attribute.
 boolean isTrait(String trait)
          Checks the named trait of the current form attribute as a string.
 boolean isTrait(VariableAttributeInfo.Trait trait)
          Checks the specified trait of the current form attribute.
 boolean isValidated()
          Checks whether the current form variable is validated.
 boolean isValidated(Variable variable, int... index)
          Checks whether the indexed form variable is validated.
 boolean isVisible()
          Checks if the current form attribute is visible.
 boolean isWritable()
          Checks if the current form attribute is writable.
 VariableAttributeInfo lastInfo(String trait)
          Returns the last attribute of the current form variable with the named trait set.
 VariableAttributeInfo lastInfo(Variable variable, String trait)
          Returns the last attribute of the specified form variable with the named trait set.
 int length()
          Returns the length of the current form array attribute.
 int length(MBeanAttributeInfo attribute)
          Returns the length of the specified form array attribute.
 String makePostField()
          Makes a post field of the current attribute or element.
 String makePostField(int index)
          Makes a post field of indexed element of the current attribute.
 String makePostField(String name)
          Makes a post field of the named attribute.
 String makePostField(String name, int index)
          Makes a post field of the indexed element of the named attribute.
 String newTagId(String tag)
          Creates a unique tag id (letters, digits, '_', '-', '.' and ':' are allowed, but keep it compatible with property names).
 VariableAttributeInfo nextInfo(int index, String trait)
          Returns the next attribute of the current form variable with the named trait set.
 VariableAttributeInfo nextInfo(Variable variable, int index, String trait)
          Returns the next attribute of the specified form variable with the named trait set.
 void popContext()
          Pops the current form context to after leaving a recursive form.
 int position()
          Returns the position of the attribute of the current form variable.
 int position(VariableAttributeInfo attribute)
          Returns the position of the attribute of the current form variable.
 int position(Variable variable, VariableAttributeInfo attribute)
          Returns the position of the attribute of the specified form variable.
 void pushContext()
          Pushes the current form context before entering a recursive form.
 void remove()
          Removes the current form variable.
 void remove(Variable var)
          Removes the specified form variable.
 void remove(Variable var, int index)
          Removes the indexed form variable.
 void removePostField(String name)
          Removes a post field.
 void render()
          Renders the current form variable.
 void render(boolean readonly)
          Renders the current form variable with a read-only option.
 void render(MBeanAttributeInfo attribute, boolean readonly, int... element)
          Renders a form attribute element with a read-only option and marks it as the current one.
 void render(MBeanAttributeInfo attribute, int... element)
          Renders a form attribute element and marks it as the current one.
 void render(String template)
          Renders the current form variable with a template.
 void render(String template, boolean readonly)
          Renders the current form variable with a template and read-only option.
 void render(String template, MBeanAttributeInfo attribute, boolean readonly, int... element)
          Renders a form attribute element with a specified template and read-only option and marks it as the current one.
 void render(String template, MBeanAttributeInfo attribute, int... element)
          Renders a form attribute element with a specified template and marks it as the current one.
 void render(String template, Variable var, boolean readonly, int... index)
          Renders the indexed form variable with a template and read-only option and marks it as the current one.
 void render(String template, Variable var, int... index)
          Renders the indexed form variable with a template and marks it as the current one.
 void render(Variable var, boolean readonly, int... index)
          Renders the indexed form variable and read-only option and marks it as the current one.
 void render(Variable var, int... index)
          Renders the indexed form variable and marks it as the current one.
 void resetFormParameters()
          Resets the request parameters of the current form.
 void resetTheme()
          Resets the form theme of this request and session.
 ConcurrentMap<String,String> resolve()
          Resolves form properties of the current form attribute.
 ConcurrentMap<String,String> resolve(MBeanAttributeInfo attribute)
          Resolves form properties of the specified form attribute.
 ConcurrentMap<String,String> resolve(Variable variable, MBeanAttributeInfo attribute)
          Resolves form properties of the specified form variable and attribute.
 Variable restore(String type)
          Restores a saved form variable or creates a new one.
 Variable restore(String type, boolean create)
          Restores a saved form variable.
 Variable restore(String type, int index)
          Restores a saved indexed form variable or creates a new one.
 Variable restore(String type, int index, boolean create)
          Restores a saved indexed form variable.
 void save()
          Saves the current form variable.
 void save(Variable var)
          Saves the specified form variable.
 void save(Variable var, int index)
          Saves the indexed form variable.
 void setElement(int index)
          Sets the array index of the current form attribute element.
 void setExtension(String type)
          Sets the extension of this request.
 void setFormName(String name)
          Sets the name of the current form and resets its variable index.
 void setInfo(MBeanAttributeInfo attribute)
          Sets the attribute info of the current form attribute.
 void setInfo(String name)
          Sets the named attribute info of the current form attribute.
 void setPostField(String value)
          Sets a post field of the current attribute with the specified value.
 void setPostField(String name, String value)
          Sets a post field of the named attribute with the specified value.
 void setReadOnly(boolean readonly)
          Sets whether the current form is read-only.
 void setTheme(String theme)
          Sets the form theme of this request.
 void setTheme(String theme, boolean perm)
          Sets the form theme of this request and optionally of this session.
 void setTrait(String trait, boolean flag)
          Sets the named trait of the current form attribute as a string.
 void setTrait(VariableAttributeInfo.Trait trait, boolean flag)
          Sets the specified trait of the current form attribute.
 void setValue(int index, Object value)
          Sets the indexed element of the current form attribute value without localization.
 void setValue(MBeanAttributeInfo attribute, int index, Object value)
          Sets indexed element of the specified form attribute value without localization.
 void setValue(MBeanAttributeInfo attribute, Object value)
          Sets the specified form attribute value without localization.
 void setValue(Object value)
          Sets the current form attribute value or element without localization.
 void setValue(String name, int index, Object value)
          Sets indexed element the named attribute value of the current form variable.
 void setValue(String name, Object value)
          Sets the named attribute value of the current form variable.
 void setVariable(Variable var, boolean readonly, int... index)
          Sets the current form variable with a read-only option.
 void setVariable(Variable var, int... index)
          Sets the current form variable.
 String toString()
          Returns the current form attribute value or element as a localized string.
 String toString(MBeanAttributeInfo attribute)
          Returns the specified form attribute value as a localized string.
 String toString(MBeanAttributeInfo attribute, int index)
          Returns the specified form attribute element as a localized string.
 String toString(String name)
          Returns the named form attribute value or element as a localized string.
 String toString(String name, int index)
          Returns the named form attribute element value as a localized string array.
 String[] toStrings()
          Returns the current form attribute values as a localized string array.
 String[] toStrings(MBeanAttributeInfo attribute)
          Returns the specified form attribute values as a localized string array.
 String[] toStrings(String name)
          Returns the named form attribute values as a localized string array.
 boolean update()
          Updates the current form variable with request parameters.
 boolean update(ObjectName name)
          Updates the current form variable with request parameters and exports the result to the specified MBean, if the update was successful.
 boolean update(ObjectName name, AttributeFilter filter)
          Updates the current form variable with request parameters and exports the result to the specified MBean by applying a filter, if the update was successful.
 boolean update(Variable variable, int... index)
          Updates the indexed form variable with request parameters and marks it as the current one.
 boolean validate()
          Validates request parameters of the current form variable.
 boolean validate(Variable variable, int... index)
          Validates request parameters of the indexed form variable and marks it as the current one.
 
Methods inherited from class org.norther.tammi.spray.engine.tool.BeanTool
addValue, addValue, create, create, create, create, create, disposed, getCharacterEncoding, getContext, getContextToolFilter, getDefaultLocale, getDescription, getDetail, getDetail, getEncodingSize, getEnumeration, getFilter, getFilterChain, getFilterKey, getGroup, getInvalidation, getKeyValue, getKMLWriter, getLOBLinkPattern, getMBeanServer, getPrincipal, getQualifier, getRequest, getResourceMap, getResponse, getValue, getValue, getVarHandler, getVariableRegistry, getVarWriter, isBound, isDisposed, isFilterChanged, length, recycle, recycled, removeValue, removeValue, setValue, setValue, toString, toString, toStrings, toStrings, valueBound, valueUnbound
 
Methods inherited from class org.norther.tammi.core.rt.Introspector
clearResourceCache, contains, containsTrait, containsTrait, cutValue, exportTo, exportTo, getComparator, getConverter, getException, getFormat, getInfo, getInfos, getLocale, getMax, getMessage, getMeta, getMin, getNodeValue, getNodeValue, getPattern, getResourceBundle, getResourceBundle, getResourceBundleName, getResourceBundleName, importFrom, importFrom, isArray, isEnumerated, isInvalid, isLOB, isReadable, isTrait, isTrait, isVisible, isWritable, resolve, resolve, setCharacterEncoding, setLOBLinkPattern, setLocale, setTrait, setTrait, toMediaFile, toSerializable, toSerializables
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FormTool

public FormTool()
Constructs a new form.

Method Detail

dispose

public void dispose()
Description copied from interface: Recyclable
Disposes the object after use. The method is called when the object is returned to its pool. The dispose method must call its super.

Specified by:
dispose in interface Recyclable
Overrides:
dispose in class BeanTool

getNameField

public String getNameField()
Gets the name of the form name field.

Returns:
the form name field name.

getIndexField

public String getIndexField()
Gets the name of the form index field.

Returns:
the form index field name.

getFormName

public String getFormName()
Description copied from interface: FormContext
Gets the name of the current form, if any.

Specified by:
getFormName in interface FormContext
Returns:
the form name or null.

setFormName

public void setFormName(String name)
Description copied from interface: FormContext
Sets the name of the current form and resets its variable index.

Specified by:
setFormName in interface FormContext
Parameters:
name - the form name.

getFormIndex

public int getFormIndex()
Description copied from interface: FormContext
Gets the index of the current form variable, if any.

Specified by:
getFormIndex in interface FormContext
Returns:
the form variable index or -1.

getFormPrefix

public String getFormPrefix()
Description copied from interface: FormContext
Gets the prefix of the current form variable and form, if any.

Specified by:
getFormPrefix in interface FormContext
Returns:
the form prefix or null.

getFormPrefix

public String getFormPrefix(int index)
Description copied from interface: FormContext
Gets the prefix of the indexed form variable and the current form.

Specified by:
getFormPrefix in interface FormContext
Parameters:
index - the index.
Returns:
the form prefix or null.

getNestedPrefix

public String getNestedPrefix()
Description copied from interface: FormContext
Gets the nested form prefix.

Specified by:
getNestedPrefix in interface FormContext
Returns:
the nested prefix or null.

isReadOnly

public boolean isReadOnly()
Description copied from interface: FormContext
Checks whether the current form is read-only.

Specified by:
isReadOnly in interface FormContext
Returns:
true if read-only, false otherwise.

setReadOnly

public void setReadOnly(boolean readonly)
Description copied from interface: FormContext
Sets whether the current form is read-only.

Specified by:
setReadOnly in interface FormContext
Parameters:
readonly - true if read-only, false otherwise.

getVariable

public Variable getVariable()
Description copied from interface: FormContext
Gets the current form variable.

Specified by:
getVariable in interface FormContext
Returns:
the form variable or null.

setVariable

public void setVariable(Variable var,
                        int... index)
Description copied from interface: FormContext
Sets the current form variable.

Specified by:
setVariable in interface FormContext
Parameters:
var - the form variable.
index - the form index.

setVariable

public void setVariable(Variable var,
                        boolean readonly,
                        int... index)
Description copied from interface: FormContext
Sets the current form variable with a read-only option.

Specified by:
setVariable in interface FormContext
Parameters:
var - the form variable.
readonly - a forced read-only option.
index - the form index.

getInfo

public MBeanAttributeInfo getInfo()
Description copied from interface: FormContext
Gets the attribute info of the current form attribute.

Specified by:
getInfo in interface FormContext
Returns:
the attribute or null.

getInfo

public MBeanAttributeInfo getInfo(boolean unlocked)
Description copied from interface: FormContext
Gets the optionally unlocked attribute info of the current form attribute.

Specified by:
getInfo in interface FormContext
Parameters:
unlocked - true if unlocked, false otherwise.
Returns:
the attribute or null.

getInfo

public VariableAttributeInfo getInfo(String name)
Description copied from interface: FormContext
Gets the named attribute info of the current form variable.

Specified by:
getInfo in interface FormContext
Parameters:
name - the attribute name.
Returns:
the named attribute or null.

getInfo

public VariableAttributeInfo getInfo(String name,
                                     boolean unlocked)
Description copied from interface: FormContext
Gets the named and optionally unlocked attribute info of the current form variable.

Specified by:
getInfo in interface FormContext
Parameters:
name - the attribute name.
unlocked - true if unlocked, false otherwise.
Returns:
the named attribute or null.

setInfo

public void setInfo(String name)
Description copied from interface: FormContext
Sets the named attribute info of the current form attribute.

Specified by:
setInfo in interface FormContext
Parameters:
name - the attribute name.

setInfo

public void setInfo(MBeanAttributeInfo attribute)
Description copied from interface: FormContext
Sets the attribute info of the current form attribute.

Specified by:
setInfo in interface FormContext
Parameters:
attribute - the form attribute.

getInfos

public List<VariableAttributeInfo> getInfos()
Description copied from interface: FormContext
Gets the attribute info list of the current form variable.

Specified by:
getInfos in interface FormContext
Returns:
a list of form attributes or null.

getInfos

public List<VariableAttributeInfo> getInfos(boolean unlocked)
Description copied from interface: FormContext
Gets the optionally unlocked attribute info list of the current form variable.

Specified by:
getInfos in interface FormContext
Parameters:
unlocked - true if unlocked, false otherwise.
Returns:
a list of form attributes or null.

contains

public boolean contains(String name)
Description copied from interface: FormContext
Checks whether the current form variable contains the named attribute.

Specified by:
contains in interface FormContext
Parameters:
name - the attribute name.
Returns:
true if contained, false otherwise.

getElement

public int getElement()
Description copied from interface: FormContext
Gets the array index of the current form attribute element.

Specified by:
getElement in interface FormContext
Returns:
the element index or -1.

setElement

public void setElement(int index)
Description copied from interface: FormContext
Sets the array index of the current form attribute element.

Specified by:
setElement in interface FormContext
Parameters:
index - the element index.

getParentContext

public FormContext getParentContext()
Description copied from interface: FormContext
Gets the parent context, if any.

Specified by:
getParentContext in interface FormContext
Returns:
the parent context or null.

getRootContext

public FormContext getRootContext()
Description copied from interface: FormContext
Gets the root context.

Specified by:
getRootContext in interface FormContext
Returns:
the root context.

clearContext

public void clearContext()
Description copied from interface: FormContext
Clears the context.

Specified by:
clearContext in interface FormContext

getFormContext

public FormContext getFormContext()
Gets the form context.

Returns:
the form context.

pushContext

public void pushContext()
Pushes the current form context before entering a recursive form.


popContext

public void popContext()
Pops the current form context to after leaving a recursive form.


restore

public Variable restore(String type)
Restores a saved form variable or creates a new one. New ones are automatically saved into the session.

Parameters:
type - the variable type.
Returns:
the form variable or null.

restore

public Variable restore(String type,
                        boolean create)
Restores a saved form variable. If create is true, a new variable is automatically created and saved into the session when needed.

Parameters:
type - the variable type.
create - true to create a missing variable.
Returns:
the form variable or null.

restore

public Variable restore(String type,
                        int index)
Restores a saved indexed form variable or creates a new one. New ones are automatically saved into the session.

Parameters:
type - the variable type.
index - the form index.
Returns:
the form variable or null.

restore

public Variable restore(String type,
                        int index,
                        boolean create)
Restores a saved indexed form variable. If create is true, a new variable is automatically created and saved into the session when needed.

Parameters:
type - the variable type.
index - the form index.
create - true to create a missing variable.
Returns:
the form variable or null.

save

public void save()
Saves the current form variable.


save

public void save(Variable var)
Saves the specified form variable.

Parameters:
var - the variable.

save

public void save(Variable var,
                 int index)
Saves the indexed form variable.

Parameters:
var - the variable.
index - the form index.

remove

public void remove()
Removes the current form variable.


remove

public void remove(Variable var)
Removes the specified form variable.

Parameters:
var - the variable.

remove

public void remove(Variable var,
                   int index)
Removes the indexed form variable.

Parameters:
var - the variable.
index - the form index.

getTheme

public String getTheme()
Gets the form theme of this request.

Returns:
the name of the form theme or null.

setTheme

public void setTheme(String theme)
Sets the form theme of this request.

Parameters:
theme - the name of the form theme.

setTheme

public void setTheme(String theme,
                     boolean perm)
Sets the form theme of this request and optionally of this session.

Parameters:
theme - the name of the form theme.
perm - set permanently if true.

resetTheme

public void resetTheme()
Resets the form theme of this request and session.


getExtension

public String getExtension()
Gets the extension of this request.

Returns:
the content type specific extension or null.

setExtension

public void setExtension(String type)
Sets the extension of this request.

Parameters:
type - the content type specific extension or null.

checkPermission

public boolean checkPermission(String actions)
Checks access permission for the current form.

Parameters:
actions - the actions to access.
Returns:
true or false.

checkPermission

public boolean checkPermission(Variable variable,
                               String actions)
Checks access permission for the specified variable.

Parameters:
variable - the variable.
actions - the actions to access.
Returns:
true or false.

getValue

public Object getValue(String name)
Gets the named attribute value of the current form variable. The original value is returned without string conversion or localization.

Parameters:
name - the attribute name.
Returns:
the attribute value or null.

setValue

public void setValue(String name,
                     Object value)
Sets the named attribute value of the current form variable. The value must not be a localized value.

Parameters:
name - the attribute name.
value - the attribute value.

getValue

public Object getValue(String name,
                       int index)
Gets indexed element of the named attribute value of the current form variable. The original value is returned without string conversion or localization.

Parameters:
name - the attribute name.
index - the element index.
Returns:
the attribute value or null.

setValue

public void setValue(String name,
                     int index,
                     Object value)
Sets indexed element the named attribute value of the current form variable. The value must not be a localized value.

Parameters:
name - the attribute name.
index - the element index.
value - the attribute value.

getKeyValue

public Object getKeyValue(String name)
Gets the named key attribute value of the current form variable.

Parameters:
name - the attribute name.
Returns:
the key attribute value or null.

toString

public String toString(String name)
Returns the named form attribute value or element as a localized string. If the corresponding request parameter is specified, it is returned instead of the value.

Parameters:
name - the attribute name.
Returns:
the attribute value or null.

toStrings

public String[] toStrings(String name)
Returns the named form attribute values as a localized string array. If the corresponding request parameters are specified, they are returned instead of the values.

Parameters:
name - the attribute name.
Returns:
the attribute values or null.

toString

public String toString(String name,
                       int index)
Returns the named form attribute element value as a localized string array. If the corresponding request parameter is specified, it is returned instead of the value.

Parameters:
name - the attribute name.
index - the element index.
Returns:
the attribute element value or null.

getParameter

public String getParameter(String name)
Gets a named request parameter. The name may but need not to contain the current form prefix.

Note that only request parameters of the current form are considered when looking for the parameter.

Parameters:
name - the name.
Returns:
the form parameter or null.

getParameter

public String getParameter(String name,
                           String def)
Gets a named request parameter with a default value. The name may but need not to contain the current form prefix.

Note that only request parameters of the current form are considered when looking for the parameter.

Parameters:
name - the name.
def - the default value.
Returns:
the form parameter or null.

getParameters

public String[] getParameters(String name)
Gets named request parameters. The name may but need not to contain the current form prefix.

Note that only request parameters of the current form are considered when looking for the parameter.

Parameters:
name - the name.
Returns:
the form parameters or null.

getParameters

public String[] getParameters(String name,
                              String[] defs)
Gets named request parameters with default values. The name may but need not to contain the current form prefix.

Note that only request parameters of the current form are considered when looking for the parameter.

Parameters:
name - the name.
defs - the default values.
Returns:
the form parameters or null.

getParameter

public String getParameter()
Gets the request parameter or element of the current form attribute.

Returns:
the request parameter or null.

getParameter

public String getParameter(MBeanAttributeInfo attribute)
Gets the request parameter of the specified form attribute.

Parameters:
attribute - the attribute.
Returns:
the request parameter or null.

getParameter

public String getParameter(MBeanAttributeInfo attribute,
                           int index)
Gets the request parameter of the specified form attribute element.

Parameters:
attribute - the attribute.
index - the element index.
Returns:
the request parameter or null.

getParameters

public String[] getParameters()
Gets the request parameters of the current form attribute.

Returns:
the request parameters or null.

getParameters

public String[] getParameters(MBeanAttributeInfo attribute)
Gets the request parameters of the specified form attribute.

Parameters:
attribute - the attribute.
Returns:
the request parameters or null.

clearFormParameters

public void clearFormParameters()
Clears the request parameters of the current form.


resetFormParameters

public void resetFormParameters()
Resets the request parameters of the current form.


getFormParameters

public Map<String,Object> getFormParameters()
Gets request parameters of the current form.

Note that parameter names are without the form prefix.

Returns:
the form parameters in a map.

getName

public String getName()
Gets the current form attribute or element name with the form prefix.

Returns:
the attribute name with an optional form prefix or null.

getName

public String getName(MBeanAttributeInfo attribute)
Gets the specified form attribute name with the form prefix.

Parameters:
attribute - the form attribute.
Returns:
the attribute name with an optional form prefix.

getName

public String getName(String name)
Gets the form attribute name with the form prefix.

Parameters:
name - the attribute name.
Returns:
the attribute name with an optional form prefix.

getName

public String getName(int index)
Gets the current form element name with the form prefix.

Parameters:
index - the element index.
Returns:
the attribute name with an optional form prefix or null.

getName

public String getName(MBeanAttributeInfo attribute,
                      int index)
Gets the specified form attribute element name with the form prefix.

Parameters:
attribute - the form attribute.
index - the element index.
Returns:
the attribute name with an optional form prefix.

getName

public String getName(String name,
                      int index)
Gets the form attribute element name with the form prefix.

Parameters:
name - the attribute name.
index - the element index.
Returns:
the attribute name with an optional form prefix.

getType

public String getType()
Gets the current form attribute type.

Returns:
the attribute type or null.

getType

public String getType(MBeanAttributeInfo attribute)
Gets the specified form attribute type.

Parameters:
attribute - the attribute.
Returns:
the attribute type.

getValue

public Object getValue()
Gets the current form attribute value or element without string conversion or localization.

Returns:
the attribute value or null.

setValue

public void setValue(Object value)
Sets the current form attribute value or element without localization.

Parameters:
value - the attribute value.

getValue

public Object getValue(int index)
Gets the indexed element of the current form attribute value without string conversion or localization.

Parameters:
index - the element index.
Returns:
the attribute value or null.

setValue

public void setValue(int index,
                     Object value)
Sets the indexed element of the current form attribute value without localization.

Parameters:
index - the element index.
value - the attribute value.

getValue

public Object getValue(MBeanAttributeInfo attribute)
Gets the specified form attribute value without string conversion or localization.

Parameters:
attribute - the attribute.
Returns:
the attribute value or null.

setValue

public void setValue(MBeanAttributeInfo attribute,
                     Object value)
Sets the specified form attribute value without localization.

Parameters:
attribute - the attribute.
value - the attribute value.

getValue

public Object getValue(MBeanAttributeInfo attribute,
                       int index)
Gets indexed element of the specified form attribute value without string conversion or localization.

Parameters:
attribute - the attribute.
index - the element index.
Returns:
the attribute value or null.

setValue

public void setValue(MBeanAttributeInfo attribute,
                     int index,
                     Object value)
Sets indexed element of the specified form attribute value without localization.

Parameters:
attribute - the attribute.
index - the element index.
value - the attribute value.

getKeyValue

public Object getKeyValue()
Gets the current form key attribute value.

Returns:
the key attribute value or null.

getKeyValue

public Object getKeyValue(MBeanAttributeInfo attribute)
Gets the specified form key attribute value.

Parameters:
attribute - the attribute.
Returns:
the key attribute value or null.

toString

public String toString()
Returns the current form attribute value or element as a localized string. If the corresponding request parameter is specified and the form is not a read-only form, it is returned instead of the value.

Overrides:
toString in class Object
Returns:
the attribute value or null.

toString

public String toString(MBeanAttributeInfo attribute)
Returns the specified form attribute value as a localized string. If the corresponding request parameter is specified and the form is not a read-only form, it is returned instead of the value.

Parameters:
attribute - the attribute.
Returns:
the attribute value or an empty string.

toString

public String toString(MBeanAttributeInfo attribute,
                       int index)
Returns the specified form attribute element as a localized string. If the corresponding request parameter is specified and the form is not a read-only form, it is returned instead of the value.

Parameters:
attribute - the attribute.
index - the element index.
Returns:
the element value or an empty string.

toStrings

public String[] toStrings()
Returns the current form attribute values as a localized string array. If the corresponding request parameters are specified and the form is not a read-only form, they are returned instead of the values.

Returns:
the attribute values or null.

toStrings

public String[] toStrings(MBeanAttributeInfo attribute)
Returns the specified form attribute values as a localized string array. If the corresponding request parameters are specified and the form is not a read-only form, they are returned instead of the values.

Parameters:
attribute - the attribute.
Returns:
the attribute values or an empty string array.

length

public int length()
Returns the length of the current form array attribute.

Returns:
the length of the array attribute.

length

public int length(MBeanAttributeInfo attribute)
Returns the length of the specified form array attribute.

Parameters:
attribute - the attribute.
Returns:
the length of the array attribute.

newTagId

public String newTagId(String tag)
Creates a unique tag id (letters, digits, '_', '-', '.' and ':' are allowed, but keep it compatible with property names).

Parameters:
tag - the tag.
Returns:
the tag id.

getTagId

public String getTagId(String tag)
Gets a unique tag id for the current form attribute.

Parameters:
tag - the tag.
Returns:
the tag id.

getTagId

public String getTagId(String tag,
                       MBeanAttributeInfo attribute)
Gets a unique tag if for the specified form attribute.

Parameters:
tag - the tag.
attribute - the attribute.
Returns:
the tag id.

getTagId

public String getTagId(String tag,
                       int index)
Gets a unique tag id for the indexed value of the current form attribute.

Parameters:
tag - the tag.
index - the value index.
Returns:
the tag id or null.

getTagId

public String getTagId(String tag,
                       MBeanAttributeInfo attribute,
                       int index)
Gets a unique tag id for the indexed value of the specified form attribute.

Parameters:
tag - the tag.
attribute - the attribute.
index - the value index.
Returns:
the tag id.

getTagId

public String getTagId(String tag,
                       String name)
Gets a unique tag id for the named form attribute.

Parameters:
tag - the tag.
name - the attribute name.
Returns:
the tag id or null.

getTagId

public String getTagId(String tag,
                       String name,
                       int index)
Gets a unique tag id for the indexed value of the named form attribute.

Note that the current implementation applies hash codes, which doesn't guarantee full uniqueness.

Parameters:
tag - the tag.
name - the attribute name.
index - the value index.
Returns:
the tag id.

getSelectedValue

public Object getSelectedValue()
Gets the current form attribute value or element selected by the user. If the corresponding request parameter is specified, it is returned instead of the selection of the attribute. The value is returned as an object without localization or string conversion.

Returns:
the selected value or null if no selection.

getSelectedValue

public Object getSelectedValue(MBeanAttributeInfo attribute)
Gets the specified form attribute value selected by the user. If the corresponding request parameter is specified, it is returned instead of the selection of the attribute. The value is returned as an object without localization or string conversion.

Parameters:
attribute - the attribute.
Returns:
the selected value or null if no selection.

getSelectedValue

public Object getSelectedValue(MBeanAttributeInfo attribute,
                               int index)
Gets the specified form attribute element selected by the user. If the corresponding request parameter is specified, it is returned instead of the selection of the attribute. The value is returned as an object without localization or string conversion.

Parameters:
attribute - the attribute.
index - the element index.
Returns:
the selected value or null if no selection.

getSelectedValues

public Object[] getSelectedValues()
Gets the current form attribute values selected by the user. If the corresponding request parameters are specified, they are returned instead of the selections of the attribute. The values are returned as an object array without localization or string conversion.

Returns:
the selected values or an empty array if no selections.

getSelectedValues

public Object[] getSelectedValues(MBeanAttributeInfo attribute)
Gets the specified form attribute values selected by the user. If the corresponding request parameters are specified, they are returned instead of the selections of the attribute. The values are returned as an object array without localization or string conversion.

Parameters:
attribute - the attribute.
Returns:
the selected values or an empty array if no selections.

getSelectedEnum

public int getSelectedEnum()
Gets the index of the selected enumeration of the current form attribute.

Returns:
the selected index or -1 if no selection.

getSelectedEnum

public int getSelectedEnum(MBeanAttributeInfo attribute)
Gets the index of the selected enumeration of the specified form attribute.

Parameters:
attribute - the attribute.
Returns:
the selected index or -1 if no selection.

getSelectedEnum

public int getSelectedEnum(MBeanAttributeInfo attribute,
                           int index)
Gets the index of the element enumeration of the specified form attribute element.

Parameters:
attribute - the attribute.
index - the element index.
Returns:
the selected index or -1 if no selection.

getSelectedEnums

public OrderedSet<Integer> getSelectedEnums()
Gets the indices of the selected enumerations of the current form attribute.

Returns:
the selected indices in a set or null.

getSelectedEnums

public OrderedSet<Integer> getSelectedEnums(MBeanAttributeInfo attribute)
Gets the indices of the selected enumerations of the specified form attribute.

Parameters:
attribute - the attribute.
Returns:
the selected indices in a set or an empty set.

getSelectedLine

public int getSelectedLine()
Gets the selected line number of the current form attribute.

Returns:
the line number or -1 if no selection.

getSelectedLine

public int getSelectedLine(MBeanAttributeInfo attribute)
Gets the selected line number of the specified form attribute.

Parameters:
attribute - the attribute.
Returns:
the line number or -1 if no selection.

getSelectedLines

public OrderedSet<Integer> getSelectedLines()
Gets the selected line numbers of the current form attribute.

Returns:
the line numbers in a set or null.

getSelectedLines

public OrderedSet<Integer> getSelectedLines(MBeanAttributeInfo attribute)
Gets the selected line numbers of the specified form attribute.

Parameters:
attribute - the attribute.
Returns:
the line numbers in a set or an empty set.

isInvalid

public boolean isInvalid()
Checks whether the current form attribute is invalid.

Returns:
true if invalid, false otherwise.

isInvalid

public boolean isInvalid(MBeanAttributeInfo attribute,
                         int... element)
Checks whether the specified form attribute is invalid.

Parameters:
attribute - the attribute.
element - the element index.
Returns:
true if invalid, false otherwise.

getException

public Exception getException()
Gets the current form attribute validation exception.

Returns:
the validation exception or null.

getException

public Exception getException(MBeanAttributeInfo attribute,
                              int... element)
Gets the specified form attribute invalidation message.

Parameters:
attribute - the attribute.
element - the element index.
Returns:
the invalidation message or an empty string if valid.

getInvalidation

public String getInvalidation()
Gets the current form attribute invalidation message.

Returns:
the invalidation message or null.

getInvalidation

public String getInvalidation(MBeanAttributeInfo attribute,
                              int... element)
Gets the specified form attribute invalidation message.

Parameters:
attribute - the attribute.
element - the element index.
Returns:
the invalidation message or an empty string if valid.

getDescription

public String getDescription()
Gets the current form attribute description.

Returns:
the attribute description or null.

getDescription

public String getDescription(MBeanAttributeInfo attribute)
Gets the specified form attribute description.

Parameters:
attribute - the attribute.
Returns:
the attribute description or null.

getGroup

public String getGroup()
Gets the current form attribute group.

Returns:
the attribute group or null.

getGroup

public String getGroup(MBeanAttributeInfo attribute)
Gets the specified form attribute group.

Parameters:
attribute - the attribute.
Returns:
the attribute group or null.

isEqualGroup

public boolean isEqualGroup(MBeanAttributeInfo attribute)
Checks whether the specified group equals with the current one.

Parameters:
attribute - the attribute.
Returns:
true if groups are equal, otherwise false.

isSameGroup

public boolean isSameGroup(MBeanAttributeInfo attribute)
Checks whether the current group should be applied to the specified attribute. The groups are considered to be the same if they are equal or the specified one is null.

Parameters:
attribute - the attribute.
Returns:
true if groups are the same, otherwise false.

getDetail

public String getDetail()
Gets the current form attribute detail.

Returns:
the attribute detail or null.

getDetail

public String getDetail(MBeanAttributeInfo attribute)
Gets the specified form attribute detail.

Parameters:
attribute - the attribute.
Returns:
the attribute detail or null.

getDetail

public String getDetail(Object arg)
Gets the current form attribute detail with an argument.

Parameters:
arg - the argument.
Returns:
the attribute detail or null.

getDetail

public String getDetail(MBeanAttributeInfo attribute,
                        Object arg)
Gets the specified form attribute detail.

Parameters:
attribute - the attribute.
arg - the argument.
Returns:
the attribute detail or null.

getQualifier

public String getQualifier()
Gets the current form attribute qualifier.

Returns:
the attribute qualifier or null.

getQualifier

public String getQualifier(MBeanAttributeInfo attribute)
Gets the specified form attribute qualifier.

Parameters:
attribute - the attribute.
Returns:
the attribute qualifier or null.

getEnumeration

public EnumeratedList getEnumeration()
Gets the current form attribute value enumeration as a list of localized enumeration entries.

Returns:
the attribute value enumeration or null.

getEnumeration

public EnumeratedList getEnumeration(MBeanAttributeInfo attribute)
Gets the specified form attribute value enumeration as a list of localized enumeration attributes.

Parameters:
attribute - the attribute.
Returns:
the attribute value enumeration or null.

getEnumeration

public EnumeratedList getEnumeration(Variable variable,
                                     MBeanAttributeInfo attribute)
Description copied from class: Introspector
Gets the specified attribute value enumeration as a list of localized enumeration attributes.

Overrides:
getEnumeration in class BeanTool
Parameters:
variable - the variable.
attribute - the attribute.
Returns:
the attribute value enumeration or null.

isReadable

public boolean isReadable()
Checks if the current form attribute is readable.

Returns:
true if readable, otherwise false.

isWritable

public boolean isWritable()
Checks if the current form attribute is writable.

Returns:
true if writable, otherwise false.

isVisible

public boolean isVisible()
Checks if the current form attribute is visible.

Returns:
true if visible, otherwise false.

isArray

public boolean isArray()
Checks if the current form attribute is an array.

Returns:
true if an array, otherwise false.

isTrait

public boolean isTrait(String trait)
Checks the named trait of the current form attribute as a string.

Parameters:
trait - the named trait.
Returns:
true if the trait is set, otherwise false.

setTrait

public void setTrait(String trait,
                     boolean flag)
Sets the named trait of the current form attribute as a string.

Parameters:
trait - the named trait.
flag - true to set the trait, otherwise false.

containsTrait

public boolean containsTrait(String trait)
Checks whether the current form variable contains any attribute with the named trait. Recursive variables are scanned, too.

Parameters:
trait - the attribute trait.
Returns:
true if contained, false otherwise.

isTrait

public boolean isTrait(VariableAttributeInfo.Trait trait)
Checks the specified trait of the current form attribute.

Parameters:
trait - the trait.
Returns:
true if the trait is set, otherwise false.

setTrait

public void setTrait(VariableAttributeInfo.Trait trait,
                     boolean flag)
Sets the specified trait of the current form attribute.

Parameters:
trait - the trait.
flag - true to set the trait, otherwise false.

containsTrait

public boolean containsTrait(VariableAttributeInfo.Trait trait)
Checks whether the current form variable contains any attribute with the specified trait. Recursive variables are scanned, too.

Parameters:
trait - the attribute trait.
Returns:
true if contained, false otherwise.

getComparator

public <T> Comparator<T> getComparator()
Gets the comparator of the current form attribute.

Type Parameters:
T - the comparator type.
Returns:
the comparator or null.

isEnumerated

public boolean isEnumerated()
Checks if the current form attribute is an enumerated.

Returns:
true if an enumeration, otherwise false.

getPattern

public String getPattern()
Gets the pattern of the current form attribute.

Returns:
the pattern or null.

getMin

public Number getMin()
Gets the minimum value of the current form attribute.

Returns:
the minimum value or 0.

getMax

public Number getMax()
Gets the maximum value of the current form attribute.

Returns:
the maximum value or -1.

firstInfo

public VariableAttributeInfo firstInfo(String trait)
Returns the first attribute of the current form variable with the named trait set.

Parameters:
trait - the named trait.
Returns:
the info of the first attribute or null.

firstInfo

public VariableAttributeInfo firstInfo(Variable variable,
                                       String trait)
Returns the first attribute of the specified form variable with the named trait set.

Parameters:
variable - the variable.
trait - the named trait.
Returns:
the info of the first attribute or null.

lastInfo

public VariableAttributeInfo lastInfo(String trait)
Returns the last attribute of the current form variable with the named trait set.

Parameters:
trait - the named trait.
Returns:
the info of the last attribute or null.

lastInfo

public VariableAttributeInfo lastInfo(Variable variable,
                                      String trait)
Returns the last attribute of the specified form variable with the named trait set.

Parameters:
variable - the variable.
trait - the named trait.
Returns:
the info of the last attribute or null.

nextInfo

public VariableAttributeInfo nextInfo(int index,
                                      String trait)
Returns the next attribute of the current form variable with the named trait set.

Parameters:
index - the start index.
trait - the named trait.
Returns:
the info of the next attribute or null.

nextInfo

public VariableAttributeInfo nextInfo(Variable variable,
                                      int index,
                                      String trait)
Returns the next attribute of the specified form variable with the named trait set.

Parameters:
variable - the variable.
index - the start index.
trait - the named trait.
Returns:
the info of the last attribute or null.

position

public int position()
Returns the position of the attribute of the current form variable.

Returns:
true if validated, false otherwise.

position

public int position(VariableAttributeInfo attribute)
Returns the position of the attribute of the current form variable.

Parameters:
attribute - the attribute.
Returns:
the position of -1 if not found.

position

public int position(Variable variable,
                    VariableAttributeInfo attribute)
Returns the position of the attribute of the specified form variable.

Parameters:
variable - the variable.
attribute - the attribute.
Returns:
the position of -1 if not found.

isValidated

public boolean isValidated()
Checks whether the current form variable is validated.

Returns:
true if validated, false otherwise.

isValidated

public boolean isValidated(Variable variable,
                           int... index)
Checks whether the indexed form variable is validated.

Parameters:
variable - the variable.
index - the form index.
Returns:
true if validated, false otherwise.

getValidation

public SortedMap<String,Exception> getValidation()
Gets validation exceptions of the current form variable.

Returns:
the map of validation exceptions or null.

getValidation

public SortedMap<String,Exception> getValidation(Variable variable,
                                                 int... index)
Gets validation exceptions of the indexed form variable.

Parameters:
variable - the variable.
index - the form index.
Returns:
the map of validation exceptions.

validate

public boolean validate()
Validates request parameters of the current form variable.

Returns:
true for valid parameters, false otherwise.

validate

public boolean validate(Variable variable,
                        int... index)
Validates request parameters of the indexed form variable and marks it as the current one.

Parameters:
variable - the variable.
index - the form index.
Returns:
true for valid parameters, false otherwise.

update

public boolean update()
Updates the current form variable with request parameters.

Returns:
true for valid parameters, false otherwise.

update

public boolean update(Variable variable,
                      int... index)
Updates the indexed form variable with request parameters and marks it as the current one.

Parameters:
variable - the variable.
index - the form index.
Returns:
true for valid parameters, false otherwise.

update

public boolean update(ObjectName name)
Updates the current form variable with request parameters and exports the result to the specified MBean, if the update was successful.

Parameters:
name - the object of the MBean to export to.
Returns:
true for valid parameters, false otherwise.

update

public boolean update(ObjectName name,
                      AttributeFilter filter)
Updates the current form variable with request parameters and exports the result to the specified MBean by applying a filter, if the update was successful.

Parameters:
name - the object of the MBean to export to.
filter - the filter to apply.
Returns:
true for valid parameters, false otherwise.

render

public void render()
Renders the current form variable.


render

public void render(boolean readonly)
Renders the current form variable with a read-only option.

Parameters:
readonly - a forced read-only option.

render

public void render(String template)
Renders the current form variable with a template.

Parameters:
template - the template.

render

public void render(String template,
                   boolean readonly)
Renders the current form variable with a template and read-only option.

Parameters:
template - the template.
readonly - a forced read-only option.

render

public void render(Variable var,
                   int... index)
Renders the indexed form variable and marks it as the current one.

Parameters:
var - the variable.
index - the form index.

render

public void render(Variable var,
                   boolean readonly,
                   int... index)
Renders the indexed form variable and read-only option and marks it as the current one.

Parameters:
var - the variable.
index - the form index.
readonly - a forced read-only option.

render

public void render(String template,
                   Variable var,
                   int... index)
Renders the indexed form variable with a template and marks it as the current one.

Parameters:
template - the template.
var - the variable.
index - the form index.

render

public void render(String template,
                   Variable var,
                   boolean readonly,
                   int... index)
Renders the indexed form variable with a template and read-only option and marks it as the current one.

Parameters:
template - the template.
var - the variable.
index - the form index.
readonly - a forced read-only option.

render

public void render(MBeanAttributeInfo attribute,
                   int... element)
Renders a form attribute element and marks it as the current one.

Parameters:
attribute - the attribute.
element - the element index.

render

public void render(MBeanAttributeInfo attribute,
                   boolean readonly,
                   int... element)
Renders a form attribute element with a read-only option and marks it as the current one.

Parameters:
attribute - the attribute.
element - the element index.
readonly - a forced read-only option.

render

public void render(String template,
                   MBeanAttributeInfo attribute,
                   int... element)
Renders a form attribute element with a specified template and marks it as the current one.

Parameters:
template - the template.
attribute - the attribute.
element - the element index.

render

public void render(String template,
                   MBeanAttributeInfo attribute,
                   boolean readonly,
                   int... element)
Renders a form attribute element with a specified template and read-only option and marks it as the current one.

Parameters:
template - the template.
attribute - the attribute.
element - the element index.
readonly - a forced read-only option.

resolve

public ConcurrentMap<String,String> resolve()
Resolves form properties of the current form attribute.

Returns:
a read-only map of properties.

resolve

public ConcurrentMap<String,String> resolve(MBeanAttributeInfo attribute)
Resolves form properties of the specified form attribute.

Parameters:
attribute - the attribute.
Returns:
a read-only map of properties.

resolve

public ConcurrentMap<String,String> resolve(Variable variable,
                                            MBeanAttributeInfo attribute)
Resolves form properties of the specified form variable and attribute.

Parameters:
variable - the variable.
attribute - the attribute.
Returns:
a read-only map of properties.

isLocalized

public boolean isLocalized()
Description copied from class: Introspector
Checks whether variables are localized.

Overrides:
isLocalized in class BeanTool
Returns:
true if localized, false otherwise.

makePostField

public String makePostField()
Makes a post field of the current attribute or element.

Returns:
the post variable name.

makePostField

public String makePostField(int index)
Makes a post field of indexed element of the current attribute.

Parameters:
index - the element index.
Returns:
the post variable name.

makePostField

public String makePostField(String name)
Makes a post field of the named attribute.

Parameters:
name - the attribute name.
Returns:
the post variable name.

makePostField

public String makePostField(String name,
                            int index)
Makes a post field of the indexed element of the named attribute.

Parameters:
name - the attribute name.
index - the element index.
Returns:
the post variable name.

setPostField

public void setPostField(String value)
Sets a post field of the current attribute with the specified value.

Parameters:
value - the attribute value.

setPostField

public void setPostField(String name,
                         String value)
Sets a post field of the named attribute with the specified value.

Parameters:
name - the attribute name.
value - the attribute value.

getPostFields

public Map<String,String> getPostFields()
Gets post fields.

Returns:
a read-only map of post fields.

containsPostField

public boolean containsPostField(String name)
Checks a post fields.

Parameters:
name - the attribute name.
Returns:
true if defined, false otherwise.

removePostField

public void removePostField(String name)
Removes a post field.

Parameters:
name - the attribute name.

clearPostFields

public void clearPostFields()
Clears all post fields.


createVariable

protected Variable createVariable(String type)
                           throws ConstructionException
Description copied from class: Introspector
Creates a variable MBean instance.

Overrides:
createVariable in class Introspector
Parameters:
type - the variable type.
Returns:
the created variable.
Throws:
ConstructionException - if construction fails.

getFormFilter

protected FormFilter getFormFilter()
Gets the form filter from the filter stack.

Returns:
the form filter or null.

getPageFilter

protected PageFilter getPageFilter()
Gets the page filter from the filter stack.

Returns:
the page filter or null.


Copyright © 2004 The Norther Organization. All rights reserved.