pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.util.xml.bind
Class CurrencyXmlAdapter

java.lang.Object
  extended by javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,java.util.Currency>
      extended by org.torweg.pulse.util.xml.bind.CurrencyXmlAdapter

public class CurrencyXmlAdapter
extends javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,java.util.Currency>

an adapter for marshaling and unmarshaling a Currency using the ISO 4217 currency code ( @XmlJavaTypeAdapter(CurrencyXmlAdapter.class) ).

Version:
$Revision: 1426 $
Author:
Daniel Dietz

Constructor Summary
CurrencyXmlAdapter()
           
 
Method Summary
 java.lang.String marshal(java.util.Currency currency)
          marshals the currency to its ISO 4217 code.
 java.util.Currency unmarshal(java.lang.String currencyCode)
          unmarshals the currecy from its ISO 4217 code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CurrencyXmlAdapter

public CurrencyXmlAdapter()
Method Detail

marshal

public java.lang.String marshal(java.util.Currency currency)
marshals the currency to its ISO 4217 code.

Specified by:
marshal in class javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,java.util.Currency>
Parameters:
currency - the Currency
Returns:
the currency-code
See Also:
XmlAdapter.marshal(java.lang.Object)

unmarshal

public java.util.Currency unmarshal(java.lang.String currencyCode)
unmarshals the currecy from its ISO 4217 code.

Specified by:
unmarshal in class javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,java.util.Currency>
Parameters:
currencyCode - the currency code
Returns:
the Currency
See Also:
XmlAdapter.unmarshal(java.lang.Object)