FileDocCategorySizeDatePackage
MailingBeanImpl.javaAPI DocExample1870Sat Nov 22 13:12:40 GMT 2003fcexample.model

MailingBeanImpl

public class MailingBeanImpl extends Object implements MailingBean
An implmentation of the mailing bean interface, using local variables as storage. Real implementations should use a real persistence mechanism.

Fields Summary
private String
first
private String
last
private String
email
private String
errorString
Constructors Summary
public MailingBeanImpl()
Create a new MailingBeanImpl

    
Methods Summary
public booleandoSubscribe()
Process a subscription to the mailing list. The doesn't actually do anything other than verify the address has an '@' character in it. Real implementations would talk to the mailing list server here

        if (getEmail().indexOf('@") == -1) {
            errorString = "invalid email address";
            return false;
        } else {
            errorString = null;
            return true;
        }
    
public java.lang.StringgetEmail()
Get the email address

        return email;
    
public java.lang.StringgetErrorString()
Get the error string for the most recent attempt to subscribe.

        return errorString;
    
public java.lang.StringgetFirst()
Get the first name

        return first;
    
public java.lang.StringgetLast()
Get the last name

        return last;
    
public voidsetEmail(java.lang.String email)
Set the email address

        this.email = email;
    
public voidsetFirst(java.lang.String first)
Set the first name

        this.first = first;
    
public voidsetLast(java.lang.String last)
Set the last name

        this.last = last;