com.townleyenterprises.validator
Interface Form


public interface Form

This interface represents a generalized form. The form can be anything from an HTML web page form to a set of controls displayed on a Swing JPanel. The abstraction works in both cases and also supports field values as indexed properties.

Since:
3.0
Version:
$Id: Form.java,v 1.2 2004/07/29 18:36:38 atownley Exp $
Author:
Andrew S. Townley

Method Summary
 java.lang.Object getValue(java.lang.String name)
          This overloaded method is used to optimize the retrieval of the first value in forms which don't have indexed field values.
 java.lang.Object getValue(java.lang.String name, int idx)
          This method returns the field value at the specified index.
 java.lang.Object[] getValues(java.lang.String name)
          This method returns all of the field values of the named field.
 void setValue(java.lang.String name, int idx, java.lang.Object value)
          This method sets the field value at the specified index.
 void setValue(java.lang.String name, java.lang.Object value)
          This overloaded method is used to optimize the setting of the first value in forms which don't have indexed field values.
 void setValues(java.lang.String name, java.lang.Object[] values)
          This method allows the setting of all of the field values for the named field at once.
 

Method Detail

getValues

public java.lang.Object[] getValues(java.lang.String name)
This method returns all of the field values of the named field.

Parameters:
name - the name of the field
Returns:
the values as a object array

setValues

public void setValues(java.lang.String name,
                      java.lang.Object[] values)
This method allows the setting of all of the field values for the named field at once.

Parameters:
name - the name of the field
values - the values array

getValue

public java.lang.Object getValue(java.lang.String name,
                                 int idx)
                          throws java.lang.IndexOutOfBoundsException
This method returns the field value at the specified index.

Parameters:
name - the name of the field
idx - the index to retrieve
Returns:
the value of the field at the specified index
Throws:
java.lang.IndexOutOfBoundsException - if the index is not within the bounds of the field values.

getValue

public java.lang.Object getValue(java.lang.String name)
This overloaded method is used to optimize the retrieval of the first value in forms which don't have indexed field values.

Parameters:
name - the field name
Returns:
the field value

setValue

public void setValue(java.lang.String name,
                     int idx,
                     java.lang.Object value)
              throws java.lang.IndexOutOfBoundsException
This method sets the field value at the specified index.

Parameters:
name - the name of the field
idx - the index to retrieve
value - the value of the field at the specified index
Throws:
java.lang.IndexOutOfBoundsException - if the index is not within the bounds of the field values.

setValue

public void setValue(java.lang.String name,
                     java.lang.Object value)
This overloaded method is used to optimize the setting of the first value in forms which don't have indexed field values.

Parameters:
name - the field name
value - the field value


Copyright © 2002-2004, Andrew S. Townley and Townley Enterprises. All Rights Reserved.
This project is hosted on http://te-code.sourceforge.net.