FileDocCategorySizeDatePackage
Customers.javaAPI DocGlassfish v2 API4118Sat May 05 19:17:10 BST 2007org.apache.taglibs.standard.examples.beans

Customers

public class Customers extends Object
Customers Datastore.
author
Pierre Delisle
version
$Revision: 1.3 $ $Date: 2007/05/06 02:17:10 $

Fields Summary
private static Vector
customers
private static int
nextSeqNo
Constructors Summary
Methods Summary
public static voidcreate(java.lang.String lastName, java.lang.String firstName, java.lang.String birthDate, java.lang.String line1, java.lang.String line2, java.lang.String city, java.lang.String state, java.lang.String zip, java.lang.String country)

    
    //*********************************************************************
    // Datastore operations
    
       
     
     
     
     
     
     
     
     
      
        create(lastName, firstName, birthDate, line1, line2, city, state, zip,
        country, null, null);
    
public static voidcreate(java.lang.String lastName, java.lang.String firstName, java.lang.String birthDate, java.lang.String line1, java.lang.String line2, java.lang.String city, java.lang.String state, java.lang.String zip, java.lang.String country, java.lang.String phoneHome, java.lang.String phoneCell)
Create new customer

        Customer customer =
        new Customer(++nextSeqNo, lastName, firstName,
        genDate(birthDate), genAddress(line1, line2, city, state, zip, country),
        phoneHome, phoneCell);
        customers.add(customer);
    
public static java.util.CollectionfindAll()
Find all customers

        return customers;
    
private static AddressgenAddress(java.lang.String line1, java.lang.String line2, java.lang.String city, java.lang.String state, java.lang.String zip, java.lang.String country)

        return new Address(line1, line2, city, state, zip, country);
    
private static java.util.DategenDate(java.lang.String dateString)

        DateFormat df = new SimpleDateFormat("M/d/y");
        Date date;
        try {
            date = df.parse(dateString);
        } catch (Exception ex) {
            date = null;
        }
        return date;