ch6.complexInit
Class RequestDataInit

java.lang.Object
  extended by ch6.complexInit.RequestDataInit

public class RequestDataInit
extends java.lang.Object

Use annotations to indicate how checkbox, radio and select elements are initialised.


Field Summary
protected  java.lang.String comments
          Variable for the textarea element.
protected  java.lang.String[] extra
          Array for the checkbox group.
protected  double grade
          Variable for the single-select list.
protected  int happiness
          Variable for the radio group.
protected  java.lang.String secretCode
          Variable for the password element.
protected  java.lang.String[] team
          Array for the multiple-select list.
 
Constructor Summary
RequestDataInit()
          Creates a new instance of RequestData
 
Method Summary
 java.lang.String getComments()
          Accessor for the textarea element.
 java.lang.String[] getExtra()
          Accessor for the textarea element.
 double getGrade()
          Mutator for the single-select list.
 int getHappiness()
          Accessor for the radio group.
 java.lang.String getSecretCode()
          Accessor for the password field.
 java.lang.String[] getTeam()
          Accessor for the multiple-select list.
 void setComments(java.lang.String comments)
          Mutator for the textarea element.
 void setExtra(java.lang.String[] extra)
          Mutator for the textarea element.
 void setGrade(double grade)
          Mutator for the single-select list.
 void setHappiness(int happiness)
          Mutator for the radio group.
 void setSecretCode(java.lang.String code)
          Mutator for the password field.
 void setTeam(java.lang.String[] team)
          Mutator for the multiple-select list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

secretCode

protected java.lang.String secretCode
Variable for the password element.


happiness

protected int happiness
Variable for the radio group. It is single-valued, since only one of the radio buttons can be selected. It can also be null.


extra

protected java.lang.String[] extra
Array for the checkbox group. It is multiple-valued since the checkbox group can have more than one box selected. It can also be null.


comments

protected java.lang.String comments
Variable for the textarea element. It is single-valued since it only contains one string.


grade

protected double grade
Variable for the single-select list. It is single-valued since only one option in the list can be selected. It cannot be null, since the first element in the list is the default selected element.


team

protected java.lang.String[] team
Array for the multiple-select list. It is multiple-valued since the list can have more than one option selected. It can also be null.

Constructor Detail

RequestDataInit

public RequestDataInit()
Creates a new instance of RequestData

Method Detail

setSecretCode

public void setSecretCode(java.lang.String code)
Mutator for the password field. It is single-valued, since only one of the radio buttons can be selected. It can also be null.

Parameters:
code - The code from the request data

getSecretCode

public java.lang.String getSecretCode()
Accessor for the password field. It is single-valued, since only one of the radio buttons can be selected. It can also be null.

Returns:
The secret code

setHappiness

public void setHappiness(int happiness)
Mutator for the radio group. It is single-valued, since only one of the radio buttons can be selected. It can also be null.

Parameters:
happiness - The happiness from the request data

setExtra

public void setExtra(java.lang.String[] extra)
Mutator for the textarea element. It is single-valued since it only contains one string.

Parameters:
extra - The list of extras from the request data

setComments

public void setComments(java.lang.String comments)
Mutator for the textarea element. It is single-valued since it only contains one string.

Parameters:
comments - The comments from the request data.

getComments

public java.lang.String getComments()
Accessor for the textarea element. It is single-valued since it only contains one string.

Returns:
The comments

setGrade

public void setGrade(double grade)
Mutator for the single-select list. It is single-valued since only one option in the list can be selected. It cannot be null, since the first element in the list is the default selected element.

Parameters:
grade - The grade from the request data.

setTeam

public void setTeam(java.lang.String[] team)
Mutator for the multiple-select list. It is multiple-valued since the list can have more than one option selected. It can also be null.

Parameters:
team - The list of teams from the request data

getHappiness

public int getHappiness()
Accessor for the radio group. It is single-valued, since only one of the radio buttons can be selected. It can also be null. Use the SetByAttribute annotation with AttributeType.CHECKED to indicate that the HTML form element is initialised with the attribute Checked.

Returns:
The level of happines

getGrade

public double getGrade()
Mutator for the single-select list. It is single-valued since only one option in the list can be selected. It cannot be null, since the first element in the list is the default selected element. Use the SetByAttribute annotation with AttributeType.SELECTED to indicate that the HTML form element is initialised with the attribute Selected.

Returns:
The grade

getExtra

public java.lang.String[] getExtra()
Accessor for the textarea element. It is single-valued since it only contains one string. Use the SetByAttribute annotation with AttributeType.CHECKED to indicate that the HTML form element is initialised with the attribute Checked.

Returns:
The list of extras

getTeam

public java.lang.String[] getTeam()
Accessor for the multiple-select list. It is multiple-valued since the list can have more than one option selected. It can also be null. Use the SetByAttribute annotation with AttributeType.SELECTED to indicate that the HTML form element is initialised with the attribute Selected.

Returns:
The values for the team