org.jdesktop.html.form
Class AbstractForm

java.lang.Object
  extended by org.jdesktop.beans.AbstractBean
      extended by org.jdesktop.html.form.AbstractForm
All Implemented Interfaces:
Form

public abstract class AbstractForm
extends org.jdesktop.beans.AbstractBean
implements Form

An abstract implementation of the Form interface.


Constructor Summary
protected AbstractForm(String baseUrl, Encoding enc, Input... inputs)
          Create a new AbstractForm with the given baseUrl and array of Inputs.
protected AbstractForm(String baseUrl, Input... inputs)
          Create a new AbstractForm with the given baseUrl and array of Inputs.
protected AbstractForm(String baseUrl, Set<Input> inputs)
          Create a new AbstractForm with the given baseUrl and set of Inputs.
 
Method Summary
 String getBaseUrl()
          Returns the base url.
 Encoding getEncoding()
          Returns the Encoding used with this Form.
 Input getInput(String name)
          Gets the Input with the given name.
 Parameter[] getInputParameters()
           
 Input[] getInputs()
          Gets the array of Inputs for this Form.
 Response submit(Session session)
           
 
Methods inherited from class org.jdesktop.beans.AbstractBean
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, clone, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jdesktop.html.form.Form
getAction, getMethod
 

Constructor Detail

AbstractForm

protected AbstractForm(String baseUrl,
                       Set<Input> inputs)
Create a new AbstractForm with the given baseUrl and set of Inputs. The baseUrl is necessary for evaluating action urls that are relative.

Parameters:
baseUrl - the base url. May be null (but then relative action paths will fail).
inputs - the set of inputs. May be null.

AbstractForm

protected AbstractForm(String baseUrl,
                       Input... inputs)
Create a new AbstractForm with the given baseUrl and array of Inputs. The baseUrl is necessary for evaluating action urls that are relative.

Parameters:
baseUrl - the base url. May be null (but then relative action paths will fail).
inputs - the array of inputs. May be null.

AbstractForm

protected AbstractForm(String baseUrl,
                       Encoding enc,
                       Input... inputs)
Create a new AbstractForm with the given baseUrl and array of Inputs. The baseUrl is necessary for evaluating action urls that are relative.

Parameters:
baseUrl - the base url. May be null (but then relative action paths will fail).
encoding - the encoding to use. If null, then UrlEncoded is used
inputs - the array of inputs. May be null.
Method Detail

getInputs

public Input[] getInputs()
Description copied from interface: Form
Gets the array of Inputs for this Form.

Specified by:
getInputs in interface Form
Returns:
an array of Inputs. The ordering of elements in this array is not guaranteed.

getInput

public Input getInput(String name)
Description copied from interface: Form
Gets the Input with the given name. If more than one Input has this name, it is unspecified which will be returned.

Specified by:
getInput in interface Form
Returns:
the Input with the given name. May be null.

getInputParameters

public Parameter[] getInputParameters()

submit

public Response submit(Session session)
                throws Exception
Throws:
Exception

getBaseUrl

public String getBaseUrl()
Description copied from interface: Form
Returns the base url. The getAction() method is appended to this base url to form the target url, if the action is a relative url.

Specified by:
getBaseUrl in interface Form
Returns:
a string representing the base url, or null if there is not one.

getEncoding

public Encoding getEncoding()
Description copied from interface: Form
Returns the Encoding used with this Form. By default, this is UrlEncoded. The encoding is honored when submitting the form.

Specified by:
getEncoding in interface Form
Returns:
a non-null value for the Encoding for this Form.