org.marketcetera.util.ws.wrappers
Class LocaleWrapper

java.lang.Object
  extended by org.marketcetera.util.ws.wrappers.BaseWrapper<R>
      extended by org.marketcetera.util.ws.wrappers.DualWrapper<Locale,MarshalledLocale>
          extended by org.marketcetera.util.ws.wrappers.LocaleWrapper
All Implemented Interfaces:
Externalizable, Serializable

public class LocaleWrapper
extends DualWrapper<Locale,MarshalledLocale>

A dual-form wrapper for marshalling a locale. The raw form is Locale, and the marshalled form is MarshalledLocale.

Since:
1.0.0
Version:
$Id: LocaleWrapper.java 16154 2012-07-14 16:34:05Z colin $
Author:
tlerios@marketcetera.com
See Also:
Serialized Form

Constructor Summary
LocaleWrapper()
          Creates a new wrapper.
LocaleWrapper(Locale locale)
          Creates a new wrapper for the given locale.
 
Method Summary
protected  void toMarshalled()
          Sets the marshalled form of the receiver's value so that it corresponds to its raw form.
protected  void toRaw()
          Sets the raw form of the receiver's value so that it corresponds to its marshalled form.
 
Methods inherited from class org.marketcetera.util.ws.wrappers.DualWrapper
getMarshalled, getRaw, readExternal, setMarshalled, setMarshalledOnly, setRaw, setRawOnly, writeExternal
 
Methods inherited from class org.marketcetera.util.ws.wrappers.BaseWrapper
equals, getValue, hashCode, setValue, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LocaleWrapper

public LocaleWrapper(Locale locale)
Creates a new wrapper for the given locale. It also sets the internal marshalled form to match.

Parameters:
locale - The locale, which may be null.

LocaleWrapper

public LocaleWrapper()
Creates a new wrapper. This empty constructor is intended for use by JAXB and Java serialization.

Method Detail

toRaw

protected void toRaw()
Description copied from class: DualWrapper
Sets the raw form of the receiver's value so that it corresponds to its marshalled form. The subclass implementation can assume that the latter form is non-null. The subclass may modify both the former and latter forms (for example, if the latter form is invalid). Only DualWrapper.setRawOnly(Object) and DualWrapper.setMarshalledOnly(Object) should be used in setting either form, to prevent infinite recursion. The raw form is null if and only if the marshalled one is null; the caller of this method will enforce this invariant, so the subclass implementation can set just the raw form to null.

Specified by:
toRaw in class DualWrapper<Locale,MarshalledLocale>

toMarshalled

protected void toMarshalled()
Description copied from class: DualWrapper
Sets the marshalled form of the receiver's value so that it corresponds to its raw form. The subclass implementation can assume that the latter form is non-null. The subclass may modify both the former and latter forms (for example, if the latter form is invalid). Only DualWrapper.setRawOnly(Object) and DualWrapper.setMarshalledOnly(Object) should be used in setting either form, to prevent infinite recursion. The raw form is null if and only if the marshalled one is null; the caller of this method will enforce this invariant, so the subclass implementation can set just the marshalled form to null.

Specified by:
toMarshalled in class DualWrapper<Locale,MarshalledLocale>


Copyright © 2012. All Rights Reserved.