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

        private void setProvider​(I18NMessageProvider provider)
                          throws I18NException
        Sets the internationalized message provider declared in the receiver's container class to the given one.
        Parameters:
        provider - The provider.
        Throws:
        I18NException - Thrown if the provider has already been set to a different one.
      • getProvider

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