org.jpos.iso
Class ISOCurrency

java.lang.Object
  extended by org.jpos.iso.ISOCurrency

public class ISOCurrency
extends Object

ISO Currency Conversion package

Version:
$Id$
Author:
vsalaman@gmail.com, Jonathan.O'Connor@xcom.de
See Also:
"http://www.evertype.com/standards/iso4217/iso4217-en.html" "http://www.iso.org/iso/en/prods-services/popstds/currencycodeslist.html"

Method Summary
static void addBundle(ResourceBundle r)
           
static void addBundle(String bundleName)
           
static double convertFromIsoMsg(String isoamount, String currency)
          Converts from an ISO Amount (12 digit string) to a double taking in consideration the number of decimal digits according to currency
static String convertToIsoMsg(double amount, String currency)
          Converts an amount to an ISO Amount taking in consideration the number of decimal digits according to currency
static Object[] decomposeComposedCurrency(String incurr)
           
static Currency getCurrency(int code)
           
static Currency getCurrency(String code)
           
static String getIsoCodeFromAlphaCode(String alphacode)
           
static void loadPropertiesFromClasspath(String base)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

loadPropertiesFromClasspath

public static void loadPropertiesFromClasspath(String base)

convertFromIsoMsg

public static double convertFromIsoMsg(String isoamount,
                                       String currency)
                                throws IllegalArgumentException
Converts 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:
IllegalArgumentException - if we fail to convert the amount

addBundle

public static void addBundle(ResourceBundle r)

addBundle

public static void addBundle(String bundleName)

convertToIsoMsg

public static String convertToIsoMsg(double amount,
                                     String currency)
                              throws 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 converted
currency - - The ISO currency to be converted (eg. ISOField 49)
Returns:
result - An iso amount representing the converted field
Throws:
IllegalArgumentException - if we fail to convert the amount

decomposeComposedCurrency

public static Object[] decomposeComposedCurrency(String incurr)
                                          throws IllegalArgumentException
Throws:
IllegalArgumentException

getIsoCodeFromAlphaCode

public static String getIsoCodeFromAlphaCode(String alphacode)
                                      throws IllegalArgumentException
Throws:
IllegalArgumentException

getCurrency

public static Currency getCurrency(int code)
                            throws ISOException
Throws:
ISOException

getCurrency

public static Currency getCurrency(String code)
                            throws ISOException
Throws:
ISOException


Copyright © 1998-2012 jPOS.org. All Rights Reserved.