org.torweg.pulse.util.xml.bind
Class LocaleXmlAdapter
java.lang.Object
javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,java.util.Locale>
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
|
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 |
LocaleXmlAdapter
public LocaleXmlAdapter()
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)