com.pushtotest.tool.parser.html
Class FormElementWrapper

java.lang.Object
  extended by com.pushtotest.tool.parser.html.FormElementWrapper
All Implemented Interfaces:
FormElement
Direct Known Subclasses:
ButtonElement, CheckElement, HiddenElement, OptionElement, RadioElement, SelectElement, TextAreaElement, TextElement

public abstract class FormElementWrapper
extends java.lang.Object
implements FormElement

An adapter class that implements the basics of the FormElement interface to make implementing FormElements easier.


Constructor Summary
FormElementWrapper()
           
 
Method Summary
 java.lang.String getId()
          Gets the id parameter of this form element.
 java.lang.String getLabel()
          Gets the label value for this element.
 java.lang.String getName()
          Gets the name parameter of this form element if there is one.
 HTMLForm getParentForm()
          Returns the Form object that this element is a part of.
abstract  java.lang.String getType()
          The type of this element.
abstract  java.lang.String getValueAsString()
          The value parameter as a string.
 void isXhtml(boolean xhtml)
          Is this an XHTML form?
 void setId(java.lang.String id)
          Gets the id parameter of this form element.
 void setLabel(java.lang.String label)
          Sets the label value for this element.
 void setName(java.lang.String name)
          Sets the name of this form.
 void setParentForm(HTMLForm parent)
          Sets the parent HTMLFrom of this element.
abstract  void setValueAsString(java.lang.String value)
          Sets the value of this element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormElementWrapper

public FormElementWrapper()
Method Detail

getType

public abstract java.lang.String getType()
The type of this element.

Specified by:
getType in interface FormElement
Returns:
The type of this element.

getValueAsString

public abstract java.lang.String getValueAsString()
The value parameter as a string.

Specified by:
getValueAsString in interface FormElement
Returns:
The value of this element as a string.

setValueAsString

public abstract void setValueAsString(java.lang.String value)
Sets the value of this element.

Specified by:
setValueAsString in interface FormElement
Parameters:
value - The value of the form element as a string.

getId

public java.lang.String getId()
Gets the id parameter of this form element.

Specified by:
getId in interface FormElement
Returns:
The id parameter.

getLabel

public java.lang.String getLabel()
Gets the label value for this element.

Specified by:
getLabel in interface FormElement
Returns:
The label on this form element.

getName

public java.lang.String getName()
Gets the name parameter of this form element if there is one.

Specified by:
getName in interface FormElement
Returns:
The name parameter or null if none exists.

getParentForm

public HTMLForm getParentForm()
Returns the Form object that this element is a part of.

Specified by:
getParentForm in interface FormElement
Returns:
The Parent {#link com.pushtotest.tool.protocolhandler.html.HTMLForm HTMLForm}

isXhtml

public void isXhtml(boolean xhtml)
Is this an XHTML form?

Specified by:
isXhtml in interface FormElement
Parameters:
xhtml - Whether this is XHTML or not.

setId

public void setId(java.lang.String id)
Gets the id parameter of this form element.

Specified by:
setId in interface FormElement
Parameters:
id - The id parameter or null if none exists.

setLabel

public void setLabel(java.lang.String label)
Sets the label value for this element.

Specified by:
setLabel in interface FormElement
Parameters:
label - The label to set.

setName

public void setName(java.lang.String name)
Sets the name of this form.

Specified by:
setName in interface FormElement
Parameters:
name - The name parameter.

setParentForm

public void setParentForm(HTMLForm parent)
Sets the parent HTMLFrom of this element.

Specified by:
setParentForm in interface FormElement
Parameters:
parent - The Parent {#link com.pushtotest.tool.protocolhandler.html.HTMLForm HTMLForm}