Package org.jpos.iso
Class ISOCurrency
- java.lang.Object
-
- org.jpos.iso.ISOCurrency
-
public class ISOCurrency extends java.lang.Object
ISO Currency Conversion package
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static void
addBundle(java.lang.String bundleName)
static double
convertFromIsoMsg(java.lang.String isoamount, java.lang.String currency)
Deprecated.You should never use doublesstatic java.lang.String
convertToIsoMsg(double amount, java.lang.String currency)
Converts an amount to an ISO Amount taking in consideration the number of decimal digits according to currencystatic java.lang.Object[]
decomposeComposedCurrency(java.lang.String incurr)
static Currency
getCurrency(int code)
static Currency
getCurrency(java.lang.String code)
static java.lang.String
getIsoCodeFromAlphaCode(java.lang.String alphacode)
static void
loadPropertiesFromClasspath(java.lang.String base)
static java.math.BigDecimal
parseFromISO87String(java.lang.String isoamount, java.lang.String currency)
static java.lang.String
toISO87String(java.math.BigDecimal amount, java.lang.String currency)
-
-
-
Method Detail
-
loadPropertiesFromClasspath
public static void loadPropertiesFromClasspath(java.lang.String base)
-
convertFromIsoMsg
public static double convertFromIsoMsg(java.lang.String isoamount, java.lang.String currency) throws java.lang.IllegalArgumentException
Deprecated.You should never use doublesConverts from an ISO Amount (12 digit string) to a double taking in consideration the number of decimal digits according to currency- Parameters:
isoamount
- - The ISO amount to be converted (eg. ISOField 4)currency
- - The ISO currency to be converted (eg. ISOField 49)- Returns:
- result - A double representing the converted field
- Throws:
java.lang.IllegalArgumentException
- if we fail to convert the amount
-
toISO87String
public static java.lang.String toISO87String(java.math.BigDecimal amount, java.lang.String currency)
-
parseFromISO87String
public static java.math.BigDecimal parseFromISO87String(java.lang.String isoamount, java.lang.String currency)
-
addBundle
public static void addBundle(java.lang.String bundleName)
-
convertToIsoMsg
public static java.lang.String convertToIsoMsg(double amount, java.lang.String currency) throws java.lang.IllegalArgumentException
Converts an amount to an ISO Amount taking in consideration the number of decimal digits according to currency- Parameters:
amount
- - The amount to be convertedcurrency
- - The ISO currency to be converted (eg. ISOField 49)- Returns:
- result - An iso amount representing the converted field
- Throws:
java.lang.IllegalArgumentException
- if we fail to convert the amount
-
decomposeComposedCurrency
public static java.lang.Object[] decomposeComposedCurrency(java.lang.String incurr) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
getIsoCodeFromAlphaCode
public static java.lang.String getIsoCodeFromAlphaCode(java.lang.String alphacode) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
getCurrency
public static Currency getCurrency(int code) throws ISOException
- Throws:
ISOException
-
getCurrency
public static Currency getCurrency(java.lang.String code) throws ISOException
- Throws:
ISOException
-
-