org.marketcetera.util.l10n
Class ContainerClassInfo

java.lang.Object
  extended by org.marketcetera.util.l10n.ContainerClassInfo
All Implemented Interfaces:
MessageInfoProvider

public class ContainerClassInfo
extends Object
implements MessageInfoProvider

Holder of meta-information about a message container class, such as Messages. Note that only static, non-null fields are introspected.

Since:
0.6.0
Version:
$Id: ContainerClassInfo.java 16154 2012-07-14 16:34:05Z colin $
Author:
tlerios@marketcetera.com
See Also:
org.marketcetera.util.log

Constructor Summary
ContainerClassInfo(Class<?> container)
          Creates a new meta-information holder for the given message container class.
 
Method Summary
protected  void addMessage(I18NMessage message)
          Adds the given message to the receiver's meta-information.
 Class<?> getContainer()
          Returns the receiver's container class.
 List<MessageInfo> getMessageInfo()
          Returns the receiver's meta-information.
 I18NMessageProvider getProvider()
          Returns the internationalized message provider declared in the receiver's container class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContainerClassInfo

public ContainerClassInfo(Class<?> container)
                   throws I18NException
Creates a new meta-information holder for the given message container class.

Parameters:
container - The class.
Throws:
I18NException - Thrown if introspection of the given class fails, or the class does not contain a message provider.
Method Detail

addMessage

protected void addMessage(I18NMessage message)
                   throws I18NException
Adds the given message to the receiver's meta-information.

Parameters:
message - The message.
Throws:
I18NException - Thrown if addition of the message fails due to the message having a different message provider than other messages in the receiver's container class.

getContainer

public Class<?> getContainer()
Returns the receiver's container class.

Returns:
The class.

getProvider

public I18NMessageProvider getProvider()
Returns the internationalized message provider declared in the receiver's container class.

Returns:
The provider.

getMessageInfo

public List<MessageInfo> getMessageInfo()
Description copied from interface: MessageInfoProvider
Returns the receiver's meta-information.

Specified by:
getMessageInfo in interface MessageInfoProvider
Returns:
The meta-information.


Copyright © 2012. All Rights Reserved.