Package google.registry.model.adapters
Class CurrencyUnitAdapter
java.lang.Object
jakarta.xml.bind.annotation.adapters.XmlAdapter<String,org.joda.money.CurrencyUnit>
google.registry.model.adapters.CurrencyUnitAdapter
public class CurrencyUnitAdapter
extends jakarta.xml.bind.annotation.adapters.XmlAdapter<String,org.joda.money.CurrencyUnit>
Adapter to use Joda
CurrencyUnit
when marshalling strings.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Exception to throw when failing to parse a currency. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
convertFromCurrency
(org.joda.money.CurrencyUnit currency) static org.joda.money.CurrencyUnit
convertFromString
(String currency) marshal
(org.joda.money.CurrencyUnit currency) ConvertsCurrencyUnit
to a string.org.joda.money.CurrencyUnit
Parses a string into aCurrencyUnit
object.
-
Constructor Details
-
CurrencyUnitAdapter
public CurrencyUnitAdapter()
-
-
Method Details
-
convertFromString
public static org.joda.money.CurrencyUnit convertFromString(String currency) throws CurrencyUnitAdapter.UnknownCurrencyException -
convertFromCurrency
-
unmarshal
public org.joda.money.CurrencyUnit unmarshal(String currency) throws CurrencyUnitAdapter.UnknownCurrencyException Parses a string into aCurrencyUnit
object.- Specified by:
unmarshal
in classjakarta.xml.bind.annotation.adapters.XmlAdapter<String,
org.joda.money.CurrencyUnit> - Throws:
CurrencyUnitAdapter.UnknownCurrencyException
-
marshal
ConvertsCurrencyUnit
to a string.- Specified by:
marshal
in classjakarta.xml.bind.annotation.adapters.XmlAdapter<String,
org.joda.money.CurrencyUnit>
-