Class RemoteI18NBoundMessage
- java.lang.Object
-
- org.marketcetera.util.ws.wrappers.RemoteI18NBoundMessage
-
- All Implemented Interfaces:
Serializable
public class RemoteI18NBoundMessage extends Object implements Serializable
A wrapper for anI18NBoundMessage. The message is marshalled using JAXB or Java serialization as both a bound internationalized message and a server-localized string. If the message can be serialized on the server side and recreated on the client side (which requires all necessary message files and parameter classes to be available, though no check is made to ensure the message handle is present in these message files), thengetText()localizes the message on the client; otherwise, it returns the server-localized string.Equality and hash code generation rely only upon the result of
getText().- Since:
- 2.0.0
- Version:
- $Id: RemoteI18NBoundMessage.java 16154 2012-07-14 16:34:05Z colin $
- Author:
- tlerios@marketcetera.com
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private I18NBoundMessagemMessageprivate StringmStringprivate SerWrapper<I18NBoundMessage>mWrapperprivate static longserialVersionUID
-
Constructor Summary
Constructors Modifier Constructor Description privateRemoteI18NBoundMessage()Creates a new message wrapper.RemoteI18NBoundMessage(I18NBoundMessage message)Creates a new message wrapper that wraps the given message.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object other)StringgetString()Returns the receiver's (server-localized) message.StringgetText()Returns the receiver's message text.private I18NBoundMessagegetTransientMessage()Returns the receiver's message.SerWrapper<I18NBoundMessage>getWrapper()Returns the receiver's message (wrapper).inthashCode()voidsetString(String string)Sets the receiver's (server-localized) message to the given one.private voidsetTransientMessage(I18NBoundMessage message)Sets the receiver's message to the given one.voidsetWrapper(SerWrapper<I18NBoundMessage> wrapper)Sets the receiver's message (wrapper) to the given one.StringtoString()
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
mMessage
private transient I18NBoundMessage mMessage
-
mWrapper
private SerWrapper<I18NBoundMessage> mWrapper
-
mString
private String mString
-
-
Constructor Detail
-
RemoteI18NBoundMessage
public RemoteI18NBoundMessage(I18NBoundMessage message)
Creates a new message wrapper that wraps the given message.- Parameters:
message- The message, which may be null.
-
RemoteI18NBoundMessage
private RemoteI18NBoundMessage()
Creates a new message wrapper. This empty constructor is intended for use by JAXB.
-
-
Method Detail
-
setTransientMessage
private void setTransientMessage(I18NBoundMessage message)
Sets the receiver's message to the given one.- Parameters:
message- The message, which may be null.
-
getTransientMessage
private I18NBoundMessage getTransientMessage()
Returns the receiver's message.- Returns:
- The message, which may be null.
-
setWrapper
public void setWrapper(SerWrapper<I18NBoundMessage> wrapper)
Sets the receiver's message (wrapper) to the given one.- Parameters:
wrapper- The message (wrapper), which may be null.
-
getWrapper
public SerWrapper<I18NBoundMessage> getWrapper()
Returns the receiver's message (wrapper).- Returns:
- The message (wrapper), which may be null.
-
setString
public void setString(String string)
Sets the receiver's (server-localized) message to the given one.- Parameters:
string- The (server-localized) message, which may be null.
-
getString
public String getString()
Returns the receiver's (server-localized) message.- Returns:
- The (server-localized) message, which may be null.
-
getText
public String getText()
Returns the receiver's message text. Preference is given to localizing the given message on the server; then localizing the message wrapper on the client, if successfully unmarshalled/deserialized; otherwise, the server-localized message is returned.- Returns:
- The text, which may be null.
-
-