package com.mrjw.guestbook; import java.util.Properties; import java.sql.*; import java.util.*; import java.io.*; public class Select { private String email; private String comments; private String howdouknow; private String name; private String website; private String school; private String city; private String jwdates; private String jwshows; public Select() { email=""; comments=""; howdouknow=""; name=""; website=""; school=""; city=""; jwdates=""; jwshows=""; } public String getEmail() {return email;} public String getComments() {return comments;} public String getHowdouknow() {return howdouknow;} public String getName() {return name;} public String getWebsite() {return website;} public String getSchool() {return school; } public String getCity() {return city; } public String getJwdates() { return jwdates; } public String getJwshows() { return jwshows; } public void setJwshows(String jwshows) { this.jwshows = jwshows; } public void setJwdates(String jwdates) { this.jwdates = jwdates; } public void setCity( String city) { this.city = city; } public void setSchool( String school) { this.school = school; } public void setEmail( String email) { this.email = email;} public void setComments( String comments) { this.comments = comments;} public void setHowdouknow( String howdouknow) { this.howdouknow = howdouknow;} public void setName( String name ) { this.name = name;} public void setWebsite( String website ) { this.website = website;} public String isValid() { if ((email+comments+howdouknow+name+website+school+city).equals("")) { return ""; } if (isInvalidEmail()) { return "Email address must contain '@' character"; } if (name.equals(" ")) { return "Name cannot be blank"; } return "Valid"; } public boolean isInvalidEmail() { if (this.email.indexOf("@") == -1 ) { return true; } else return false; } }