org.marketcetera.util.log
Class I18NMessage

java.lang.Object
  extended by org.marketcetera.util.log.I18NMessage
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
I18NMessage0P, I18NMessage1P, I18NMessage2P, I18NMessage3P, I18NMessage4P, I18NMessage5P, I18NMessage6P, I18NMessageNP

public abstract class I18NMessage
extends Object
implements Serializable

An internationalized message, represented using a pair of textual keys referencing the message text; keys-text maps are stored outside the source code. This key pair comprises a message ID and an entry ID: the entry ID selects a specific variant of the message and can be omitted (in which case it defaults to UNKNOWN_ENTRY_ID).

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

Field Summary
static String UNKNOWN_ENTRY_ID
          The default entry ID.
 
Constructor Summary
I18NMessage(I18NLoggerProxy loggerProxy, String messageId)
          Creates a new internationalized message with the given message ID and the default entry ID.
I18NMessage(I18NLoggerProxy loggerProxy, String messageId, String entryId)
          Creates a new internationalized message with the given message and entry IDs.
 
Method Summary
 boolean equals(Object other)
           
 String getEntryId()
          Returns the receiver's entry ID.
 I18NLoggerProxy getLoggerProxy()
          Returns the logger proxy that can log the receiver.
 String getMessageId()
          Returns the receiver's message ID.
 I18NMessageProvider getMessageProvider()
          Returns the message provider that can map the receiver.
abstract  int getParamCount()
          Returns the number of parameters the receiver expects.
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNKNOWN_ENTRY_ID

public static final String UNKNOWN_ENTRY_ID
The default entry ID.

See Also:
Constant Field Values
Constructor Detail

I18NMessage

public I18NMessage(I18NLoggerProxy loggerProxy,
                   String messageId,
                   String entryId)
Creates a new internationalized message with the given message and entry IDs. The logger proxy that can log the receiver is also supplied.

Parameters:
loggerProxy - The logger proxy.
messageId - The message ID.
entryId - The entry ID.

I18NMessage

public I18NMessage(I18NLoggerProxy loggerProxy,
                   String messageId)
Creates a new internationalized message with the given message ID and the default entry ID. The logger proxy that can log the receiver is also supplied.

Parameters:
loggerProxy - The logger proxy.
messageId - The message ID.
Method Detail

getLoggerProxy

public I18NLoggerProxy getLoggerProxy()
Returns the logger proxy that can log the receiver.

Returns:
The proxy.

getMessageProvider

public I18NMessageProvider getMessageProvider()
Returns the message provider that can map the receiver.

Returns:
The message provider.

getMessageId

public String getMessageId()
Returns the receiver's message ID.

Returns:
The ID.

getEntryId

public String getEntryId()
Returns the receiver's entry ID.

Returns:
The ID.

getParamCount

public abstract int getParamCount()
Returns the number of parameters the receiver expects.

Returns:
The number of parameters; -1 indicates a variable number.

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.