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 LocaleXmlAdapter

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

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

an adapter for marshaling and unmarshaling a Locale using the locale's string representation ( @XmlJavaTypeAdapter(LocaleXmlAdapter.class) ).

Version:
$Revision: 1426 $
Author:
Thomas Weber

Constructor Summary
LocaleXmlAdapter()
           
 
Method Summary
 java.lang.String marshal(java.util.Locale locale)
          marshals the locale to its string representation.
 java.util.Locale unmarshal(java.lang.String string)
          unmarshals the locale from its string representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocaleXmlAdapter

public LocaleXmlAdapter()
Method Detail

marshal

public java.lang.String marshal(java.util.Locale locale)
marshals the locale to its string representation.

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

unmarshal

public java.util.Locale unmarshal(java.lang.String string)
unmarshals the locale from its string representation.

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