com.bankframe.localization
Class BankFrameMessage

java.lang.Object
  extended by com.bankframe.localization.BankFrameMessage
All Implemented Interfaces:
Serializable

public class BankFrameMessage
extends Object
implements Serializable

This class represents a localizable String.

See Also:
Serialized Form

Field Summary
static String ARGUMENT_PREFIX
           
static String ARGUMENTS_SIZE
           
static String MESSAGE_KEY
           
static String NULL_MESSAGE_FILE
           
static String NULL_MESSAGE_KEY_ERROR
           
static String UNDEFINED_MESSAGE_KEY
           
 
Constructor Summary
BankFrameMessage()
          Constructor.
BankFrameMessage(DataPacket bankframeMessageDataPacket)
          Constructor.
BankFrameMessage(String messageKey)
          Constructor.
BankFrameMessage(String messageKey, String[] arguments)
          Constructor.
 
Method Summary
 void fromDataPacket(DataPacket data)
          This method initialises a BankFrameMessage from the information in the supplied DataPacket.
 String[] getMessageArguments()
          This method returns the message arguments for this message.
 String getMessageKey()
          This method returns the message key for this message.
 void setMessageArguments(String[] arguments)
          This method sets the message arguments for this message.
 void setMessageKey(String messageKey)
          This method sets the message key for this message.
 DataPacket toDataPacket(DataPacket data)
          This method converts a BankFrameMessage to a DataPacket.
 String toString()
          This method converts the messsage to a String in the default locale.
 String toString(Locale locale)
          This method converts the message to a localized String.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NULL_MESSAGE_FILE

public static final String NULL_MESSAGE_FILE
See Also:
Constant Field Values

NULL_MESSAGE_KEY_ERROR

public static final String NULL_MESSAGE_KEY_ERROR
See Also:
Constant Field Values

UNDEFINED_MESSAGE_KEY

public static final String UNDEFINED_MESSAGE_KEY
See Also:
Constant Field Values

MESSAGE_KEY

public static final String MESSAGE_KEY
See Also:
Constant Field Values

ARGUMENTS_SIZE

public static final String ARGUMENTS_SIZE
See Also:
Constant Field Values

ARGUMENT_PREFIX

public static final String ARGUMENT_PREFIX
See Also:
Constant Field Values
Constructor Detail

BankFrameMessage

public BankFrameMessage()
Constructor.


BankFrameMessage

public BankFrameMessage(DataPacket bankframeMessageDataPacket)
Constructor.

Parameters:
bankframeMessageDataPacket - a DataPacket containing the key and arguments for a message

BankFrameMessage

public BankFrameMessage(String messageKey)
Constructor.

Parameters:
messageKey - the key of the message.

BankFrameMessage

public BankFrameMessage(String messageKey,
                        String[] arguments)
Constructor.

Parameters:
messageKey - the key of the message
arguments - the arguments to the message
Method Detail

fromDataPacket

public void fromDataPacket(DataPacket data)
This method initialises a BankFrameMessage from the information in the supplied DataPacket.

Parameters:
data - The supplied DataPackets

getMessageArguments

public String[] getMessageArguments()
This method returns the message arguments for this message.

Returns:
an array of message arguments or null if the message has no arguments

getMessageKey

public String getMessageKey()
This method returns the message key for this message.

Returns:
the message key

setMessageArguments

public void setMessageArguments(String[] arguments)
This method sets the message arguments for this message.

Parameters:
arguments -

setMessageKey

public void setMessageKey(String messageKey)
This method sets the message key for this message.

Parameters:
messageKey - the new message key

toDataPacket

public DataPacket toDataPacket(DataPacket data)
This method converts a BankFrameMessage to a DataPacket.

Parameters:
data - The DataPacket to place the BankFrameMessage information in
Returns:
the modified DataPacket

toString

public String toString()
This method converts the messsage to a String in the default locale. Use this method for debugging purposes only.

Overrides:
toString in class Object
Returns:
a string instance containing the message

toString

public String toString(Locale locale)
This method converts the message to a localized String.

Parameters:
locale - The locale to localize the message to.
Returns:
The localized string


Copyright © 2005, 2007, Oracle. All rights reserved.