com.ora.jsp.beans.userinfo
Class UserInfoBean

java.lang.Object
  extended bycom.ora.jsp.beans.userinfo.UserInfoBean
All Implemented Interfaces:
java.io.Serializable

public class UserInfoBean
extends java.lang.Object
implements java.io.Serializable

This class contains information about a user. It's used to show how a bean can be used to capture and validate user input.

Version:
2.0
Author:
Hans Bergsten, Gefion software
See Also:
Serialized Form

Field Summary
private  java.lang.String birthDate
           
private static java.lang.String DATE_FORMAT_PATTERN
           
private  java.lang.String emailAddr
           
private  java.lang.String[] food
           
private static java.lang.String[] FOOD_LIST
           
private  java.lang.String gender
           
private static java.lang.String[] GENDER_LIST
           
private  java.lang.String luckyNumber
           
private static int MAX_LUCKY_NUMBER
           
private static int MIN_LUCKY_NUMBER
           
private  java.lang.String userName
           
 
Constructor Summary
UserInfoBean()
           
 
Method Summary
 java.lang.String getBirthDate()
          Returns the birthDate property value
 java.lang.String getEmailAddr()
          Returns the emailAddr property value
 java.lang.String[] getFood()
          Returns the food property value
 java.lang.String getGender()
          Returns the gender property value
 java.lang.String getLuckyNumber()
          Returns the luckyNumber property value
 java.lang.String getUserName()
          Returns the userName property value
 boolean isBirthDateValid()
          Validates the birthDate property
 boolean isChineseSelected()
          Returns true if the food property includes the marker for Chinese
 boolean isEmailAddrValid()
          Validates the emailAddr property
private  boolean isFoodTypeSelected(java.lang.String foodType)
          Returns true if the food property includes the specified food type
 boolean isFoodValid()
          Validates the food property
 boolean isGenderValid()
          Validates the gender property
 boolean isLuckyNumberValid()
          Validates the luckyNumber property
 boolean isPastaSelected()
          Returns true if the food property includes the marker for pasta
 boolean isPizzaSelected()
          Returns true if the food property includes the marker for pizza
 boolean isUserNameValid()
          Validates the gender property
 boolean isValid()
          Returns true if all property values have valid values (they are only set if the value is valid).
 void setBirthDate(java.lang.String birthDate)
          Sets the birthDate property value
 void setEmailAddr(java.lang.String emailAddr)
          Sets the emailAddr property value
 void setFood(java.lang.String[] food)
          Sets the food property value
 void setGender(java.lang.String gender)
          Sets the gender property value
 void setLuckyNumber(java.lang.String luckyNumber)
          Sets the luckyNumber property value
 void setUserName(java.lang.String userName)
          Sets the userName property value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATE_FORMAT_PATTERN

private static java.lang.String DATE_FORMAT_PATTERN

GENDER_LIST

private static java.lang.String[] GENDER_LIST

FOOD_LIST

private static java.lang.String[] FOOD_LIST

MIN_LUCKY_NUMBER

private static int MIN_LUCKY_NUMBER

MAX_LUCKY_NUMBER

private static int MAX_LUCKY_NUMBER

birthDate

private java.lang.String birthDate

emailAddr

private java.lang.String emailAddr

food

private java.lang.String[] food

luckyNumber

private java.lang.String luckyNumber

gender

private java.lang.String gender

userName

private java.lang.String userName
Constructor Detail

UserInfoBean

public UserInfoBean()
Method Detail

getBirthDate

public java.lang.String getBirthDate()
Returns the birthDate property value


setBirthDate

public void setBirthDate(java.lang.String birthDate)
Sets the birthDate property value


isBirthDateValid

public boolean isBirthDateValid()
Validates the birthDate property

Returns:
true if the property is set to a valid value, false otherwise.

getEmailAddr

public java.lang.String getEmailAddr()
Returns the emailAddr property value


setEmailAddr

public void setEmailAddr(java.lang.String emailAddr)
Sets the emailAddr property value


isEmailAddrValid

public boolean isEmailAddrValid()
Validates the emailAddr property

Returns:
true if the property is set to a valid value, false otherwise.

getFood

public java.lang.String[] getFood()
Returns the food property value


setFood

public void setFood(java.lang.String[] food)
Sets the food property value


isFoodValid

public boolean isFoodValid()
Validates the food property

Returns:
true if the property is set to a valid value, false otherwise.

isPizzaSelected

public boolean isPizzaSelected()
Returns true if the food property includes the marker for pizza


isPastaSelected

public boolean isPastaSelected()
Returns true if the food property includes the marker for pasta


isChineseSelected

public boolean isChineseSelected()
Returns true if the food property includes the marker for Chinese


getLuckyNumber

public java.lang.String getLuckyNumber()
Returns the luckyNumber property value


setLuckyNumber

public void setLuckyNumber(java.lang.String luckyNumber)
Sets the luckyNumber property value


isLuckyNumberValid

public boolean isLuckyNumberValid()
Validates the luckyNumber property

Returns:
true if the property is set to a valid value, false otherwise.

getGender

public java.lang.String getGender()
Returns the gender property value


setGender

public void setGender(java.lang.String gender)
Sets the gender property value


isGenderValid

public boolean isGenderValid()
Validates the gender property

Returns:
true if the property is set to a valid value, false otherwise.

getUserName

public java.lang.String getUserName()
Returns the userName property value


setUserName

public void setUserName(java.lang.String userName)
Sets the userName property value


isUserNameValid

public boolean isUserNameValid()
Validates the gender property

Returns:
true if the property is set to a valid value, false otherwise.

isValid

public boolean isValid()
Returns true if all property values have valid values (they are only set if the value is valid).


isFoodTypeSelected

private boolean isFoodTypeSelected(java.lang.String foodType)
Returns true if the food property includes the specified food type