ch3.defaultValidate
Class RequestDataDefault

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

public class RequestDataDefault
extends java.lang.Object

The bean that implements default validation.

The accessors will perform default validation. If the value that is entered by the user does not pass a validation test, then a default value will be supplied.


Field Summary
protected  java.lang.String aversion
          The variable to store the aversion.
protected  java.lang.String hobby
          The variable to store the hobby.
 
Constructor Summary
RequestDataDefault()
           
 
Method Summary
 java.lang.String getAversion()
          The accessor for the aversion property.
 java.lang.String getHobby()
          The accessor for the hobby property.
 boolean isValidAversion()
          A helper method to test if the aversion is valid.
 boolean isValidHobby()
          A helper method to test if the hobby is valid.
 void setAversion(java.lang.String aversion)
          The mutator for the aversion property.
 void setHobby(java.lang.String hobby)
          The mutator for the hobby property.
 
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
The variable to store the hobby.

The variable is hidden from other classes, so it doesn't matter what name it has.


aversion

protected java.lang.String aversion
The variable to store the aversion.

The variable is hidden from other classes, so it doesn't matter what name it has.

Constructor Detail

RequestDataDefault

public RequestDataDefault()
Method Detail

setHobby

public void setHobby(java.lang.String hobby)
The mutator for the hobby property.

This name must agree with the name of the input element from the HTML page where the user enters data.

The name of the input element should be hobby.

Parameters:
hobby - The hobby from the request data

getHobby

public java.lang.String getHobby()
The accessor for the hobby property. It implements default validation.

This name must agree with the name of the input element from the HTML page where the user enters data.

The name of the input element should be hobby.

Returns:
The hobby that was entered or "No Hobby" if the value is invalid.

setAversion

public void setAversion(java.lang.String aversion)
The mutator for the aversion property.

This name must agree with the name of the input element from the HTML page where the user enters data.

The name of the input element should be aversion.

Parameters:
aversion - The aversion from the request data

getAversion

public java.lang.String getAversion()
The accessor for the aversion property. It implements default validation.

This name must agree with the name of the input element from the HTML page where the user enters data.

The name of the input element should be aversion.

Returns:
The aversion that was entered or "No Aversion" if the value is invalid.

isValidHobby

public boolean isValidHobby()
A helper method to test if the hobby is valid.

Returns:
true if valid, false if not valid.

isValidAversion

public boolean isValidAversion()
A helper method to test if the aversion is valid.

Returns:
true if valid, false if not valid.