public class CurrencyMgr extends BaseMgr implements CurrencyMgrIf
Modifier and Type | Class and Description |
---|---|
protected class |
CurrencyMgr.StaticData
Used to store the static data of this manager
|
Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
log
the log
|
protected static java.lang.String |
mutex
Mutex for the Manager
|
protected static java.util.Map<java.lang.String,CurrencyMgr.StaticData> |
staticDataHM
Hash Map that contains the static data
|
templateBaseDir
Constructor and Description |
---|
CurrencyMgr(KKEngIf eng)
Constructor
|
Modifier and Type | Method and Description |
---|---|
Currency |
fetchDefaultCurrency()
The default currency is referenced by a configuration variable called DEFAULT_CURRENCY.
|
java.lang.String |
formatPrice(java.math.BigDecimal number,
java.lang.String currencyCode)
Used to create a string in order to visualise a price.
|
Currency[] |
getCurrencies()
This returns an array of currencies for all of the currencies in the currency table.
|
Currency |
getCurrency(java.lang.String currencyCode)
Returns the currency referenced by the currencyCode.
|
Currency |
getDefaultCurrency()
Returns the default currency from the cache.
|
java.text.DecimalFormat |
getDefaultCurrencyFormatter()
Gets the formatter for the default currency
|
int |
getDefaultCurrencyScale()
A utility method to return the scale of the default currency used in price calculations
|
protected java.text.DecimalFormat |
getFormatter(Currency currency)
Get a DecimalFormat object for a currency
|
void |
refreshConfigs()
Refresh the configuration of the currency manager
|
acquireLock, addInsertAttr, addInsertAttr, addStringRuleConstraint, addStringRuleConstraint, checkRequired, escapeHTML, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, getAdminEngMgr, getBasketMgr, getBillingMgr, getBookableProductMgr, getCacheMgr, getCatMgr, getConfigMgr, getCookieMgr, getCurrMgr, getCustMgr, getCustomerIdFromSession, getCustomerStatsMgr, getCustomerTagMgr, getEmailMgr, getEng, getEventMgr, getExportMgr, getHTMLEscaper, getKonaKartConfig, getKonaKartConfig, getKonaKartConfig, getLangMgr, getManuMgr, getMiscItemMgr, getMiscPriceMgr, getMode, getModeString, getMqMgr, getMultiStoreMgr, getNewCriteria, getNewCriteria, getOrderIntegrationMgr, getOrderMgr, getOrderTotalMgr, getPaymentMgr, getProdMgr, getProductsToCategoresCriteria, getPromMgr, getPunchOutMgr, getRewardPointMgr, getSecMgr, getShippingMgr, getSolrMgr, getStoreId, getStoreMgr, getStoreTime, getSuggestionMgr, getTaxMgr, getTemplate, getTemplateRoot, getVelocityContextMgr, getWishListMgr, init, insertKKEvent, insertKKEvent, isBusiness, isBusinessOrEnterprise, isClassPresent, isCommunity, isDeadlockException, isEnterprise, isMultiStoreShareCategories, isMultiStoreShareCustomers, isMultiStoreShareCustomersOrProducts, isMultiStoreSharedDb, isMultiStoreShareProducts, isMultiVendor, isUnix, manageThrowable, releaseLock, updateStaticVariablesNow
protected static org.apache.commons.logging.Log log
protected static java.lang.String mutex
protected static java.util.Map<java.lang.String,CurrencyMgr.StaticData> staticDataHM
public CurrencyMgr(KKEngIf eng) throws java.lang.Exception
eng
- the engjava.lang.Exception
- an unexpected exceptionpublic Currency getDefaultCurrency() throws org.apache.torque.TorqueException, com.konakart.app.KKException, com.workingdogs.village.DataSetException
CurrencyMgrIf
getDefaultCurrency
in interface CurrencyMgrIf
com.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)com.konakart.app.KKException
- an unexpected KKException exceptionorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)public int getDefaultCurrencyScale() throws com.konakart.app.KKException, org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
CurrencyMgrIf
getDefaultCurrencyScale
in interface CurrencyMgrIf
com.konakart.app.KKException
- an unexpected KKException exceptionorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)com.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)public Currency fetchDefaultCurrency() throws java.lang.Exception
fetchDefaultCurrency
in interface CurrencyMgrIf
java.lang.Exception
- an unexpected exceptionpublic java.text.DecimalFormat getDefaultCurrencyFormatter() throws org.apache.torque.TorqueException, com.konakart.app.KKException, com.workingdogs.village.DataSetException
getDefaultCurrencyFormatter
in interface CurrencyMgrIf
com.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)com.konakart.app.KKException
- an unexpected KKException exceptionorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)public Currency getCurrency(java.lang.String currencyCode) throws com.konakart.app.KKException, org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
getCurrency
in interface CurrencyMgrIf
currencyCode
- the currencyCodecom.konakart.app.KKException
- an unexpected KKException exceptionorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)com.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)public Currency[] getCurrencies() throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
getCurrencies
in interface CurrencyMgrIf
org.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)com.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)public java.lang.String formatPrice(java.math.BigDecimal number, java.lang.String currencyCode) throws com.konakart.app.KKException, org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
formatPrice
in interface CurrencyMgrIf
number
- the numbercurrencyCode
- the currencyCodecom.konakart.app.KKException
- an unexpected KKException exceptioncom.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)org.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)protected java.text.DecimalFormat getFormatter(Currency currency)
currency
- the currencypublic void refreshConfigs() throws java.lang.Exception
refreshConfigs
in interface CurrencyMgrIf
java.lang.Exception
- an unexpected exceptionCopyright © 2018 DS Data Systems UK Ltd.