Class 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 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.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object