There's a java.util.Currency class. Unfortunately for you, it will only let you convert from the three letter code to the currency symbol, not the numeric code. It delegates most of its work to the class com.ibm.icu.util.Currency, but that also doesn't seem to have any interface to return the numeric code. Probably they didn't consider it to be a useful piece of information.
If you really need that conversion, you're probably stuck with downloading the ISO 4217 data, and writing your own converter. You might even try extending Currency to do it.