net.sf.colle.forms
Class FormList

java.lang.Object
  extended bynet.sf.colle.forms.FormList
All Implemented Interfaces:
FormElement

public class FormList
extends Object
implements FormElement

This class allows form elements to repeat. Created: 08 Oct 2001

Version:
$Revision: 1.4 $, $Date: 2004/12/01 06:57:05 $
Author:
Dwayne Schultz

Field Summary
 
Fields inherited from interface net.sf.colle.forms.FormElement
ERROR_INVALID, ERROR_REQUIRED, UNKNOWN, VALID
 
Constructor Summary
FormList(String psName, Object pxApplicationElement, FormElement pxParent, Class pxContainedClass)
          Creates a new FormList that will contain form structures.
 
Method Summary
 Object getApplicationElement()
          Returns the application object that corresponds to this form object.
 String getErrorCode()
          Returns the error code of the element.
 List getList()
          Returns the list of repeating form structures.
 String getName()
          Returns the name of the the form element.
 String getPath()
          Returns the path to the form element.
 void map(org.jdom.Element pxElement)
          Write out the the element into the DOM tree.
 void service(HttpServletRequest pxRequest, org.jdom.Element pxOldValue)
          Process the returning HTTP request.
 void setErrorCode(String psCode)
          Sets the error code.
 void setToDefault(boolean pbRecursive)
          Return value to the default settings.
 int validate(boolean pbRecursive)
          validate the element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormList

public FormList(String psName,
                Object pxApplicationElement,
                FormElement pxParent,
                Class pxContainedClass)
Creates a new FormList that will contain form structures.

Parameters:
pxContainedClass - application class this form list will contain
Method Detail

map

public void map(org.jdom.Element pxElement)
Description copied from interface: FormElement
Write out the the element into the DOM tree. Care must be taken to *NOT* validate the form element in this method and to only report validation errors if validate has been called.

Specified by:
map in interface FormElement
Parameters:
pxElement - parent element to add new elements onto
See Also:
FormElement

getErrorCode

public String getErrorCode()
Description copied from interface: FormElement
Returns the error code of the element. Validation must be performed before calling this method or no error codes will be returned.

Specified by:
getErrorCode in interface FormElement
Returns:
error code
See Also:
FormElement

getName

public String getName()
Description copied from interface: FormElement
Returns the name of the the form element.

Specified by:
getName in interface FormElement
Returns:
the name
See Also:
FormElement

getPath

public String getPath()
Description copied from interface: FormElement
Returns the path to the form element. This path uniquely identifies the data object in the DOM tree and when the object is returned through the form.

Specified by:
getPath in interface FormElement
Returns:
the name
See Also:
FormElement

getApplicationElement

public Object getApplicationElement()
Description copied from interface: FormElement
Returns the application object that corresponds to this form object.

Specified by:
getApplicationElement in interface FormElement
See Also:
FormElement

service

public void service(HttpServletRequest pxRequest,
                    org.jdom.Element pxOldValue)
Description copied from interface: FormElement
Process the returning HTTP request.

Specified by:
service in interface FormElement
Parameters:
pxRequest - http request to fetch data from
pxOldValue - form element details when the form was sent to the user
See Also:
FormElement

setErrorCode

public void setErrorCode(String psCode)
Description copied from interface: FormElement
Sets the error code. JSP's may do this to display an error found outside of built-in validation.

Specified by:
setErrorCode in interface FormElement
Parameters:
psCode - error code
See Also:
FormElement

setToDefault

public void setToDefault(boolean pbRecursive)
Description copied from interface: FormElement
Return value to the default settings.

Specified by:
setToDefault in interface FormElement
Parameters:
pbRecursive - on true set child elements
See Also:
FormElement

validate

public int validate(boolean pbRecursive)
Description copied from interface: FormElement
validate the element.

Specified by:
validate in interface FormElement
Parameters:
pbRecursive - on true check child elements
Returns:
error count
See Also:
FormElement

getList

public List getList()
Returns the list of repeating form structures. Care must be used when modifying the list. If structures of the wrong type are added an error will be thrown when the form is mapped.