|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.paneris.jammyjoes.shopping.ShoppingTrolley
public abstract class ShoppingTrolley
A Shopping Trolley stored information in the user's Shopping Trolley.
It does this by storing itself in the session.
For this reason, the constructors are private, and you will be expected to always get the Shopping Trolley using getInstance();
usage example: ShoppingTrolley trolley = ShoppingTrolley.getInstance(Melati melati); context.put("trolley", trolley);
Field Summary | |
---|---|
protected java.lang.String |
address
|
MelatiShoppingConfig |
config
|
protected java.lang.String |
country
|
protected java.lang.String |
county
|
protected java.lang.String |
email
|
protected boolean |
hasDetails
|
protected java.util.Locale |
locale
|
org.melati.Melati |
melati
|
protected java.lang.String |
message
|
protected java.lang.String |
name
|
protected java.lang.String |
postcode
|
protected java.lang.String |
tel
|
protected java.lang.String |
town
|
Constructor Summary | |
---|---|
ShoppingTrolley()
|
Method Summary | |
---|---|
java.lang.String |
abandonURL()
|
void |
addItem(ShoppingTrolleyItem item)
|
void |
assertLogin(org.melati.Melati melati)
|
java.lang.String |
baseURL()
|
java.lang.String |
catalogueURL()
|
void |
configureRequest(org.melati.Melati melati)
|
abstract void |
confirmPayment(org.melati.Melati melati)
|
java.lang.String |
confirmURL()
|
java.lang.String |
detailsURL()
|
java.lang.String |
displayCurrency(double value)
|
java.lang.String |
displayCurrency(java.lang.Double value)
|
java.lang.String |
getCountry()
|
java.lang.String |
getCounty()
|
java.lang.String |
getDeliveryAddress()
|
java.lang.String |
getDeliveryDisplay()
|
abstract double |
getDeliveryValue()
|
abstract double |
getDiscountRate()
|
java.lang.String |
getDiscountRateDisplay()
|
double |
getDiscountValue()
|
java.lang.String |
getDiscountValueDisplay()
|
java.lang.String |
getEmail()
|
static ShoppingTrolley |
getInstance(org.melati.Melati melati,
MelatiShoppingConfig config)
Returns the single instance, creating one if it can't be found. |
ShoppingTrolleyItem |
getItem(java.lang.Integer id)
|
java.util.Enumeration |
getItems()
|
abstract java.util.Locale |
getLocale()
|
java.lang.String |
getMessage()
|
java.lang.String |
getName()
|
java.lang.String |
getPostcode()
|
java.lang.String |
getTel()
|
double |
getTotalDeliveryValue()
|
double |
getTotalValue()
|
java.lang.String |
getTotalValueDisplay()
|
java.lang.String |
getTotalValuePence()
|
java.lang.String |
getTown()
|
double |
getValue()
|
java.lang.String |
getValueDisplay()
|
static java.lang.String |
getValuePence(double totalValue)
|
java.lang.String |
getVATDisplay()
|
double |
getVATValue()
|
abstract boolean |
hasDelivery()
|
boolean |
hasDetails()
|
abstract boolean |
hasDiscount()
|
abstract boolean |
hasVAT()
|
protected void |
initialise(org.melati.Melati melati,
MelatiShoppingConfig config)
private Constructor to build an empty ShoppingTrolley |
void |
initialise(org.melati.Melati melati,
MelatiShoppingConfig config,
java.lang.Integer id)
public Constructor to build a trolley from some id |
boolean |
isEmpty()
|
abstract void |
load(java.lang.Integer id)
|
static java.lang.String |
name()
|
ShoppingTrolleyItem |
newItem(java.lang.Integer id,
java.lang.String description,
java.lang.Double price)
|
static ShoppingTrolley |
newTrolley(MelatiShoppingConfig config)
|
java.lang.String |
paidURL()
|
void |
remove(org.melati.Melati melati)
remove any trolley from the session |
void |
removeItem(ShoppingTrolleyItem item)
|
static double |
roundTo2dp(double num)
|
abstract void |
save()
|
void |
setCountry(java.lang.String a)
|
void |
setCounty(java.lang.String a)
|
abstract void |
setDefaultDetails(org.melati.Melati melati)
|
void |
setDeliveryAddress(java.lang.String a)
|
void |
setEmail(java.lang.String a)
|
void |
setLocale(java.util.Locale locale)
|
void |
setMessage(java.lang.String a)
|
void |
setName(java.lang.String a)
|
void |
setPostcode(java.lang.String a)
|
void |
setTel(java.lang.String a)
|
void |
setTown(java.lang.String a)
|
java.lang.String |
updateURL()
|
java.lang.String |
viewURL()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Locale locale
protected java.lang.String address
protected java.lang.String name
protected java.lang.String tel
protected java.lang.String town
protected java.lang.String county
protected java.lang.String country
protected java.lang.String postcode
protected java.lang.String message
protected java.lang.String email
protected boolean hasDetails
public MelatiShoppingConfig config
public org.melati.Melati melati
Constructor Detail |
---|
public ShoppingTrolley()
Method Detail |
---|
protected void initialise(org.melati.Melati melati, MelatiShoppingConfig config)
public void initialise(org.melati.Melati melati, MelatiShoppingConfig config, java.lang.Integer id) throws org.melati.util.InstantiationPropertyException
org.melati.util.InstantiationPropertyException
public void remove(org.melati.Melati melati)
public static ShoppingTrolley getInstance(org.melati.Melati melati, MelatiShoppingConfig config) throws org.melati.util.InstantiationPropertyException
org.melati.util.InstantiationPropertyException
public static ShoppingTrolley newTrolley(MelatiShoppingConfig config) throws org.melati.util.InstantiationPropertyException
org.melati.util.InstantiationPropertyException
public abstract java.util.Locale getLocale()
public void setLocale(java.util.Locale locale)
public abstract void confirmPayment(org.melati.Melati melati)
public abstract void load(java.lang.Integer id) throws org.melati.util.InstantiationPropertyException
org.melati.util.InstantiationPropertyException
public abstract void save()
public void configureRequest(org.melati.Melati melati)
public void assertLogin(org.melati.Melati melati)
public abstract void setDefaultDetails(org.melati.Melati melati)
public static java.lang.String name()
public java.util.Enumeration getItems()
public boolean isEmpty()
public boolean hasDetails()
public ShoppingTrolleyItem getItem(java.lang.Integer id)
public void removeItem(ShoppingTrolleyItem item)
public void addItem(ShoppingTrolleyItem item)
public ShoppingTrolleyItem newItem(java.lang.Integer id, java.lang.String description, java.lang.Double price) throws org.melati.util.InstantiationPropertyException
org.melati.util.InstantiationPropertyException
public double getValue()
public java.lang.String getValueDisplay()
public double getTotalValue()
public java.lang.String getTotalValueDisplay()
public java.lang.String getTotalValuePence()
public static java.lang.String getValuePence(double totalValue)
public abstract boolean hasDelivery()
public abstract double getDeliveryValue()
public double getTotalDeliveryValue()
public java.lang.String getDeliveryDisplay()
public abstract boolean hasDiscount()
public abstract double getDiscountRate()
public double getDiscountValue()
public java.lang.String getDiscountRateDisplay()
public java.lang.String getDiscountValueDisplay() throws java.lang.Exception
java.lang.Exception
public abstract boolean hasVAT()
public double getVATValue()
public java.lang.String getVATDisplay()
public void setDeliveryAddress(java.lang.String a)
public java.lang.String getDeliveryAddress()
public void setName(java.lang.String a)
public java.lang.String getName()
public void setEmail(java.lang.String a)
public java.lang.String getEmail()
public void setPostcode(java.lang.String a)
public java.lang.String getPostcode()
public void setTel(java.lang.String a)
public java.lang.String getTel()
public void setTown(java.lang.String a)
public java.lang.String getTown()
public void setCounty(java.lang.String a)
public java.lang.String getCounty()
public void setCountry(java.lang.String a)
public java.lang.String getCountry()
public void setMessage(java.lang.String a)
public java.lang.String getMessage()
public java.lang.String displayCurrency(double value)
public java.lang.String displayCurrency(java.lang.Double value)
public java.lang.String baseURL()
public java.lang.String viewURL()
public java.lang.String detailsURL()
public java.lang.String confirmURL()
public java.lang.String abandonURL()
public java.lang.String updateURL()
public java.lang.String paidURL()
public java.lang.String catalogueURL()
public static double roundTo2dp(double num)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |