ch3.defaultValidate
Class RequestDataDefault

java.lang.Object
  extended by ch3.defaultValidate.RequestDataDefault

public class RequestDataDefault
extends java.lang.Object

The bean encapsulates the data for the application.

This bean has helper methods for testing if the hobby and aversion are valid. If they are not valid, then a default value will be used instead.

The validation could be performed in the accessor or the mutator. By placing the validation in the accessor, the original value that the user entered is stored in the bean and the validation will be performed every time the value is retrieved.


Field Summary
protected  java.lang.String aversion
          Stores the value of the aversion element.
protected  java.lang.String hobby
          Stores the value of the hobby element.
 
Constructor Summary
RequestDataDefault()
          Creates a new instance of RequestDataDefault
 
Method Summary
 java.lang.String getAversion()
          Accessor for the aversion element.
 java.lang.String getHobby()
          Accessor for the hobby element.
 boolean isValidAversion()
          Helper method that tests if the aversion is valid.
 boolean isValidHobby()
          Helper method that tests if the hobby is valid.
 void setAversion(java.lang.String aversion)
          Mutator for the aversion element.
 void setHobby(java.lang.String hobby)
          Mutator for the hobby element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hobby

protected java.lang.String hobby
Stores the value of the hobby element.


aversion

protected java.lang.String aversion
Stores the value of the aversion element.

Constructor Detail

RequestDataDefault

public RequestDataDefault()
Creates a new instance of RequestDataDefault

Method Detail

setHobby

public void setHobby(java.lang.String hobby)
Mutator for the hobby element.

Parameters:
hobby - The new value to store in the hobby.

getHobby

public java.lang.String getHobby()
Accessor for the hobby element.

Returns:
The current value of the hobby.

setAversion

public void setAversion(java.lang.String aversion)
Mutator for the aversion element.

Parameters:
aversion - The new value to store in the aversion.

getAversion

public java.lang.String getAversion()
Accessor for the aversion element.

Returns:
The current value of the aversion.

isValidHobby

public boolean isValidHobby()
Helper method that tests if the hobby is valid.

Returns:
True if the hobby is valid, false otherwise.

isValidAversion

public boolean isValidAversion()
Helper method that tests if the aversion is valid.

Returns:
True if the aversion is valid, false otherwise.