org.marketcetera.util.l10n
Class MessageInfo

java.lang.Object
  extended by org.marketcetera.util.l10n.MessageInfo
Direct Known Subclasses:
I18NMessageInfo, PropertyMessageInfo

public abstract class MessageInfo
extends Object

Holder of meta-information about a generic message.

Since:
0.6.0
Version:
$Id: MessageInfo.java 16154 2012-07-14 16:34:05Z colin $
Author:
tlerios@marketcetera.com

Field Summary
static MessageInfo[] EMPTY_ARRAY
          An empty array of class instances.
 
Constructor Summary
MessageInfo(String key, int paramCount)
          Creates a new meta-information holder with the given message key and parameter count.
 
Method Summary
 boolean equals(Object other)
           
 String getKey()
          Returns the receiver's message key.
static Properties getList(MessageInfo[] info)
          Returns the given collection of message information as a properties object.
 int getParamCount()
          Returns the receiver's parameter count.
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_ARRAY

public static final MessageInfo[] EMPTY_ARRAY
An empty array of class instances.

Constructor Detail

MessageInfo

public MessageInfo(String key,
                   int paramCount)
Creates a new meta-information holder with the given message key and parameter count.

Parameters:
key - The key.
paramCount - The parameter count; -1 signifies an unknown count.
Method Detail

getList

public static Properties getList(MessageInfo[] info)
Returns the given collection of message information as a properties object. For each message in order, one property is created (or overwritten, if there is a name conflict): its name is the message key, and its value is the key alongside all argument placeholders.

Parameters:
info - The collection of message information.
Returns:
The properties object.

getKey

public String getKey()
Returns the receiver's message key.

Returns:
The key.

getParamCount

public int getParamCount()
Returns the receiver's parameter count.

Returns:
The count; -1 signifies an unknown count.

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.