org.marketcetera.util.ws.wrappers
Class RemoteI18NBoundMessage

java.lang.Object
  extended by org.marketcetera.util.ws.wrappers.RemoteI18NBoundMessage
All Implemented Interfaces:
Serializable

public class RemoteI18NBoundMessage
extends Object
implements Serializable

A wrapper for an I18NBoundMessage. 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), then getText() 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

Constructor Summary
RemoteI18NBoundMessage(I18NBoundMessage message)
          Creates a new message wrapper that wraps the given message.
 
Method Summary
 boolean equals(Object other)
           
 String getString()
          Returns the receiver's (server-localized) message.
 String getText()
          Returns the receiver's message text.
 SerWrapper<I18NBoundMessage> getWrapper()
          Returns the receiver's message (wrapper).
 int hashCode()
           
 void setString(String string)
          Sets the receiver's (server-localized) message to the given one.
 void setWrapper(SerWrapper<I18NBoundMessage> wrapper)
          Sets the receiver's message (wrapper) to the given one.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

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.
Method Detail

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.

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object other)
Overrides:
equals in class Object


Copyright © 2012. All Rights Reserved.