pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.component.shop.model
Class ShopSettings

java.lang.Object
  extended by org.torweg.pulse.util.entity.AbstractBasicEntity
      extended by org.torweg.pulse.component.shop.model.ShopSettings
All Implemented Interfaces:
java.io.Serializable, JDOMable

@Entity
public class ShopSettings
extends AbstractBasicEntity
implements JDOMable

is an entity to store the basic settings of a shop.

Version:
$Revision: 2043 $
Author:
Thomas Weber, Christian Schatt, Daniel Dietz
See Also:
Serialized Form

Constructor Summary
protected ShopSettings()
          Deprecated. 
  ShopSettings(Bundle b, java.util.Locale l)
          creates a new ShopSettings for the given Bundle and Locale.
 
Method Summary
 boolean addTaxGroup(TaxGroup group)
          Adds a TaxGroup to the ShopSettings and sets the ShopSettings for the TaxGroup.
 org.jdom.Element deserializeToJDOM()
          returns an Element representing the settings.
 Bundle getBundle()
          returns the bundle.
 java.util.Currency getCurrency()
          returns the currency.
 java.util.Locale getLocale()
          returns the locale.
static ShopSettings getSettings(Bundle bundle, ServiceRequest request)
          Returns the ShopSettings for the current Bundle and ServiceRequest.
 java.util.Set<TaxGroup> getTaxGroups()
          returns the tax groups.
 boolean isNetBased()
          Tells whether the shop is net based or gross based.
 boolean removeTaxGroup(TaxGroup group)
          Removes a TaxGroup from the ShopSettings.
 void setBundle(Bundle b)
          sets the bundle.
 void setCurrency(java.util.Currency c)
          sets the currency.
 void setLocale(java.util.Locale l)
          sets the locale.
 void setNetBased(boolean nb)
          Sets the netBased flag of the shop.
 void setTaxGroups(java.util.Set<TaxGroup> tg)
          sets the tax groups.
 net.sf.json.JSONObject toJSON()
          Returns a JSON-representation of the ShopSettings.
 java.lang.String toString()
          returns a string representation of the shop settings.
 
Methods inherited from class org.torweg.pulse.util.entity.AbstractBasicEntity
compareTo, equals, getFullQualifiedClassNameJAXB, getId, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ShopSettings

@Deprecated
protected ShopSettings()
Deprecated. 

used by HibernateTM.


ShopSettings

public ShopSettings(Bundle b,
                    java.util.Locale l)
creates a new ShopSettings for the given Bundle and Locale.

Parameters:
b - the bundle
l - the locale
Method Detail

getBundle

public final Bundle getBundle()
returns the bundle.

Returns:
the bundle

setBundle

public final void setBundle(Bundle b)
sets the bundle.

Parameters:
b - the bundle to set

getLocale

public final java.util.Locale getLocale()
returns the locale.

Returns:
the locale

setLocale

public final void setLocale(java.util.Locale l)
sets the locale.

Parameters:
l - the locale to set

getCurrency

public final java.util.Currency getCurrency()
returns the currency.

Returns:
the currency

setCurrency

public final void setCurrency(java.util.Currency c)
sets the currency.

Parameters:
c - the currency to set

isNetBased

public final boolean isNetBased()
Tells whether the shop is net based or gross based.

Returns:
true if the shop is net based, or false if the shop is gross based.

setNetBased

public final void setNetBased(boolean nb)
Sets the netBased flag of the shop.

Parameters:
nb - the netBased flag to be set.

getTaxGroups

public final java.util.Set<TaxGroup> getTaxGroups()
returns the tax groups.

Returns:
the tax groups

setTaxGroups

public final void setTaxGroups(java.util.Set<TaxGroup> tg)
sets the tax groups.

Parameters:
tg - the tax groups to set

addTaxGroup

public final boolean addTaxGroup(TaxGroup group)
Adds a TaxGroup to the ShopSettings and sets the ShopSettings for the TaxGroup.

Parameters:
group - the TaxGroup to add
Returns:
true, if the tax group has been added

removeTaxGroup

public final boolean removeTaxGroup(TaxGroup group)
Removes a TaxGroup from the ShopSettings.

Parameters:
group - the TaxGroup to add
Returns:
true, if the tax group has been removed

toString

public java.lang.String toString()
returns a string representation of the shop settings.

Overrides:
toString in class java.lang.Object
Returns:
a string representation

getSettings

public static final ShopSettings getSettings(Bundle bundle, ServiceRequest request)
Returns the ShopSettings for the current Bundle and ServiceRequest.

Parameters:
bundle - the current Bundle
request - the current ServiceRequest
Returns:
the ShopSettings

deserializeToJDOM

public final org.jdom.Element deserializeToJDOM()
returns an Element representing the settings.

Specified by:
deserializeToJDOM in interface JDOMable
Returns:
an Element representing the settings

toJSON

public final net.sf.json.JSONObject toJSON()
Returns a JSON-representation of the ShopSettings.

Returns:
a JSON-representation of the ShopSettings