org.cruxframework.crux.core.i18n
Class MessagesFactory

java.lang.Object
  extended by org.cruxframework.crux.core.config.AbstractPropertiesFactory
      extended by org.cruxframework.crux.core.i18n.MessagesFactory

public class MessagesFactory
extends AbstractPropertiesFactory

Factory for messages. Receive an Interface and use it's name to look for resource bundles in the classpath. Each interface's method is used as key in that property file.

Author:
Thiago da Rosa de Bustamante, Gesse S. F. Dafe

Field Summary
protected static MessagesFactory instance
           
 
Method Summary
protected  ConstantsInvocationHandler getInvocationHandler(Class<?> targetInterface)
           
static
<T> T
getMessages(Class<T> targetInterface)
          Create a message helper class that access a resource bundle using the methods present in the given interface.
 
Methods inherited from class org.cruxframework.crux.core.config.AbstractPropertiesFactory
getConstantsFromProperties, initProxy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

protected static final MessagesFactory instance
Method Detail

getMessages

public static <T> T getMessages(Class<T> targetInterface)
                     throws MessageException
Create a message helper class that access a resource bundle using the methods present in the given interface.

Parameters:
targetInterface -
Returns:
Throws:
MessageException

getInvocationHandler

protected ConstantsInvocationHandler getInvocationHandler(Class<?> targetInterface)
Specified by:
getInvocationHandler in class AbstractPropertiesFactory


Copyright © 2015. All rights reserved.