com.ora.jsp.beans.shopping
Class CatalogBean

java.lang.Object
  |
  +--com.ora.jsp.beans.shopping.CatalogBean
All Implemented Interfaces:
java.io.Serializable

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

This class represents a product catalog. It holds a list of products available for sale.

This is just a demo so the product list is hardcoded, created at instantiation. A real version would get the information from an external data source.

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

Field Summary
private  java.util.Vector catalog
           
 
Constructor Summary
CatalogBean()
          Constructor.
 
Method Summary
 ProductBean getProduct(java.lang.String id)
          Returns one product, or throws an exception if not found
 java.util.Enumeration getProductList()
          Returns a list of all products.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

catalog

private java.util.Vector catalog
Constructor Detail

CatalogBean

public CatalogBean()
Constructor. Creates all ProductBean objects and adds them to the catalog.
Method Detail

getProductList

public java.util.Enumeration getProductList()
Returns a list of all products.
Returns:
a Enumeration with ProductBean elements

getProduct

public ProductBean getProduct(java.lang.String id)
                       throws java.lang.Exception
Returns one product, or throws an exception if not found
Parameters:
id - the product id. The String version is to be able to use the useProperty action
Returns:
a ProductBean
Throws:
java.lang.Exception - if the id doesn't match a product