public class CurrencyManager extends UnitManager
Modifier | Constructor and Description |
---|---|
protected | CurrencyManager()
CurrencyManager constructor.
|
Modifier and Type | Method and Description |
---|---|
MonetaryAmount | convert(MonetaryAmount aMonetaryAmount, StoreAccessBean aStoreAccessBean, java.lang.String toCurrency)
Convert a monetary amount to a new currency.
|
protected java.lang.String | getClassName()
Returns the class name.
|
protected java.lang.String | getConverionRelationshipType()
Gets the currency conversion relationship type.
|
java.lang.String[] | getCounterCurrencies(StoreAccessBean aStoreAccessBean, java.lang.String aCurrency)
Get the counter currencies that apply, to a particular currency, in the correct order.
|
java.lang.String[] | getCounterCurrenciesForStore(StoreAccessBean aStoreAccessBean, java.lang.String aCurrency)
Get the counter currencies that apply, to a particular currency, in the correct order.
|
MonetaryAmount[] | getCounterValues(StoreAccessBean aStoreAccessBean, MonetaryAmount aMonetaryAmount)
Get the list of counter values in the appropriate order.
|
java.lang.String | getCurrency(StoreAccessBean aStoreAccessBean, java.lang.String aPreferredCurrency, java.lang.Integer aLanguageId)
Calculate the negotiated shopping currency for the specified store based on the user's preferred currency.
|
java.math.BigDecimal | getCustomizedRoundingMultiple(StoreAccessBean aStoreAccessBean, java.lang.String aUnit)
Gets the unit to which rounding occurs.
|
java.math.BigDecimal | getCustomizedRoundingMultiple(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.String aNumberUsage)
Gets the unit to which rounding occurs.
|
int | getCustomizedRoundMethod(StoreAccessBean aStoreAccessBean, java.lang.String aUnit)
Returns 1 if the round method is 'T' (Truncate), returns 2 if the round method is 'R' (Round) or returns 3 if the round method is 'F' (Floor).
|
int | getCustomizedRoundMethod(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.String astrNumberUsage)
Returns 1 if the round method is 'T' (Truncate), returns 2 if the round method is 'R' (Round) or returns 3 if the round method is 'F' (Floor).
|
java.lang.String | getCustomizedString(StoreAccessBean aStoreAccessBean, java.lang.String aCurrency, java.lang.Integer aLanguageId)
Get the customized string from the format table.
|
java.lang.String | getDefaultCurrency(StoreAccessBean aStoreAccessBean)
Get the store level default currency for a particular store.
|
java.lang.String | getDefaultCurrency(StoreAccessBean aStoreAccessBean, java.lang.Integer aLanguageId)
Get the default currency for a particular store and language Id.
|
java.lang.String | getDescription(StoreAccessBean aStoreAccessBean, java.lang.String aCurrency, java.lang.Integer aLanguageId)
Get the description of the specified currency.
|
protected java.lang.String | getFormatRelationshipType()
Gets the currency format relationship type.
|
FormattedMonetaryAmount | getFormattedMonetaryAmount(MonetaryAmount aMonetaryAmount, StoreAccessBean aStoreAccessBean, java.lang.Integer aLanguageId)
Get a formatted monetary amount for display purposes based on the formatting rules defined in the database.
|
FormattedMonetaryAmount | getFormattedMonetaryAmount(MonetaryAmount aMonetaryAmount, StoreAccessBean aStoreAccessBean, java.lang.Integer aLanguageId, java.lang.String aNumberUsage)
Get a formatted monetary amount for display purposes based on the formatting rules defined in the database.
|
static CurrencyManager | getInstance()
Get the instance of the currency manager.
|
java.math.BigDecimal | getMinApproveAmount(StoreAccessBean aStoreAB, java.lang.String aCurrency)
Get the minimum approved amount.
|
java.math.BigDecimal | getMinApproveAmount(StoreAccessBean aStoreAB, java.lang.String aCurrency, java.lang.String aNumberUsage)
Get the minimum approved amount.
|
java.math.BigDecimal | getRoundingMultiple(StoreAccessBean aStoreAccessBean, java.lang.String aUnit)
Gets the unit to which rounding occurs.
|
java.math.BigDecimal | getRoundingMultiple(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.String aNumberUsage)
Gets the unit to which rounding occurs.
|
protected java.lang.Integer | getStoreIdForConverter(StoreAccessBean aStoreAccessBean)
Get the store Id to use for converters.
|
java.lang.String[] | getSupportedCurrencies(StoreAccessBean aStoreAB)
Get a list of the currencies supported by a store.
|
java.lang.String | getSymbol(StoreAccessBean aStoreAccessBean, java.lang.String aCurrency, java.lang.Integer aLanguageId)
Get the currency symbol information from the currency format table.
|
void | initialize()
Used by the registry manager to initialize the currency manager.
|
boolean | isSupportedCurrency(StoreAccessBean aStoreAccessBean, java.lang.String aCurrency)
Checks to see if a currency is supported in a store.
|
java.math.BigDecimal | parsePositiveAmount(java.lang.String anAmount, java.lang.String theUnit, StoreAccessBean aStoreAccessBean, java.lang.Integer aLanguageId, java.lang.String aNumberUsage)
Parses a string (representing a positive number) based on the formatting rules defined in the database.
|
protected void | refreshExtension(com.ibm.commerce.price.utils.Formatters theTempFormatters)
Pass all NumberFormat objects to the tools runtime.
|
protected void | refreshOthers(com.ibm.commerce.price.utils.Converters aConverters)
Refresh other containers not handles by the parent class.
|
void | round(MonetaryAmount aMonetaryAmount, StoreAccessBean aStoreAccessBean)
Round the monetary amount to the appropriate number of decimal places.
|
void | round(MonetaryAmount aMonetaryAmount, StoreAccessBean aStoreAccessBean, java.lang.String aNumberUsage)
Round the monetary amount to the appropriate number of decimal places.
|
void | roundCustomized(MonetaryAmount aMonetaryAmount, StoreAccessBean aStoreAccessBean)
Perform customized rounding to the correct number of decimal places.
|
void | roundCustomized(MonetaryAmount aMonetaryAmount, StoreAccessBean aStoreAccessBean, java.lang.String aNumberUsage)
Perform customized rounding to the correct number of decimal places.
|
protected CurrencyManager() throws ECSystemException
protected java.lang.String getConverionRelationshipType()
protected java.lang.String getFormatRelationshipType()
public MonetaryAmount convert(MonetaryAmount aMonetaryAmount, StoreAccessBean aStoreAccessBean, java.lang.String toCurrency) throws ECSystemException
protected java.lang.String getClassName()
public java.lang.String[] getCounterCurrenciesForStore(StoreAccessBean aStoreAccessBean, java.lang.String aCurrency) throws ECSystemException
public java.lang.String[] getCounterCurrencies(StoreAccessBean aStoreAccessBean, java.lang.String aCurrency) throws ECSystemException
public MonetaryAmount[] getCounterValues(StoreAccessBean aStoreAccessBean, MonetaryAmount aMonetaryAmount) throws ECSystemException
public java.lang.String getCurrency(StoreAccessBean aStoreAccessBean, java.lang.String aPreferredCurrency, java.lang.Integer aLanguageId) throws ECSystemException
public java.math.BigDecimal getCustomizedRoundingMultiple(StoreAccessBean aStoreAccessBean, java.lang.String aUnit) throws ECSystemException
public java.math.BigDecimal getCustomizedRoundingMultiple(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.String aNumberUsage) throws ECSystemException
public java.lang.String getCustomizedString(StoreAccessBean aStoreAccessBean, java.lang.String aCurrency, java.lang.Integer aLanguageId) throws ECSystemException
public java.lang.String getDefaultCurrency(StoreAccessBean aStoreAccessBean) throws ECSystemException
public java.lang.String getDefaultCurrency(StoreAccessBean aStoreAccessBean, java.lang.Integer aLanguageId) throws ECSystemException
public java.lang.String getDescription(StoreAccessBean aStoreAccessBean, java.lang.String aCurrency, java.lang.Integer aLanguageId) throws ECSystemException
public FormattedMonetaryAmount getFormattedMonetaryAmount(MonetaryAmount aMonetaryAmount, StoreAccessBean aStoreAccessBean, java.lang.Integer aLanguageId) throws ECSystemException
public FormattedMonetaryAmount getFormattedMonetaryAmount(MonetaryAmount aMonetaryAmount, StoreAccessBean aStoreAccessBean, java.lang.Integer aLanguageId, java.lang.String aNumberUsage) throws ECSystemException
public static CurrencyManager getInstance() throws ECSystemException
public java.math.BigDecimal getMinApproveAmount(StoreAccessBean aStoreAB, java.lang.String aCurrency) throws ECSystemException
public java.math.BigDecimal getMinApproveAmount(StoreAccessBean aStoreAB, java.lang.String aCurrency, java.lang.String aNumberUsage) throws ECSystemException
public java.math.BigDecimal getRoundingMultiple(StoreAccessBean aStoreAccessBean, java.lang.String aUnit) throws ECSystemException
public java.math.BigDecimal getRoundingMultiple(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.String aNumberUsage) throws ECSystemException
protected java.lang.Integer getStoreIdForConverter(StoreAccessBean aStoreAccessBean) throws ECSystemException
public java.lang.String[] getSupportedCurrencies(StoreAccessBean aStoreAB) throws ECSystemException
public java.lang.String getSymbol(StoreAccessBean aStoreAccessBean, java.lang.String aCurrency, java.lang.Integer aLanguageId) throws ECSystemException
public void initialize() throws java.lang.Exception
public boolean isSupportedCurrency(StoreAccessBean aStoreAccessBean, java.lang.String aCurrency) throws ECSystemException
protected void refreshExtension(com.ibm.commerce.price.utils.Formatters theTempFormatters) throws ECSystemException
protected void refreshOthers(com.ibm.commerce.price.utils.Converters aConverters) throws ECSystemException
public void round(MonetaryAmount aMonetaryAmount, StoreAccessBean aStoreAccessBean) throws ECSystemException
public void round(MonetaryAmount aMonetaryAmount, StoreAccessBean aStoreAccessBean, java.lang.String aNumberUsage) throws ECSystemException
public void roundCustomized(MonetaryAmount aMonetaryAmount, StoreAccessBean aStoreAccessBean) throws ECSystemException
public void roundCustomized(MonetaryAmount aMonetaryAmount, StoreAccessBean aStoreAccessBean, java.lang.String aNumberUsage) throws ECSystemException
public java.math.BigDecimal parsePositiveAmount(java.lang.String anAmount, java.lang.String theUnit, StoreAccessBean aStoreAccessBean, java.lang.Integer aLanguageId, java.lang.String aNumberUsage) throws ECSystemException, java.text.ParseException
public int getCustomizedRoundMethod(StoreAccessBean aStoreAccessBean, java.lang.String aUnit) throws ECSystemException
public int getCustomizedRoundMethod(StoreAccessBean aStoreAccessBean, java.lang.String aUnit, java.lang.String astrNumberUsage) throws ECSystemException