org.cruxframework.crux.core.config
Class ConstantsInvocationHandler
java.lang.Object
org.cruxframework.crux.core.config.ConstantsInvocationHandler
- All Implemented Interfaces:
- InvocationHandler
- Direct Known Subclasses:
- ConfigurationInvocationHandler
public abstract class ConstantsInvocationHandler
- extends Object
- implements InvocationHandler
Dynamic proxy for message resources.
- Author:
- Thiago da Rosa de Bustamante, Gesse S. F. Dafe
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ConstantsInvocationHandler
public ConstantsInvocationHandler(Class<?> targetInterface,
boolean isCacheable)
- Parameters:
targetInterface -
ConstantsInvocationHandler
public ConstantsInvocationHandler(Class<?> targetInterface)
- Parameters:
targetInterface -
invoke
public Object invoke(Object proxy,
Method method,
Object[] args)
throws Throwable
- Specified by:
invoke in interface InvocationHandler
- Throws:
Throwable
getMessageFromProperties
protected String getMessageFromProperties(Object[] args,
String name)
- Parameters:
args - name -
- Returns:
getMessageFromAnnotation
protected String getMessageFromAnnotation(Method method,
Object[] args,
String name)
- Parameters:
method - args - name -
- Returns:
isValidPropertySetter
protected boolean isValidPropertySetter(Method method)
- Parameters:
method -
- Returns:
invokeSetter
protected void invokeSetter(Method method,
Object[] args)
- Parameters:
properties - method - args -
loadProperties
protected static PropertyResourceBundle loadProperties(Class<?> targetInterface,
Locale locale)
- Parameters:
targetInterface - locale -
- Returns:
getPropertiesForLocale
protected abstract <T> PropertyResourceBundle getPropertiesForLocale(Class<T> targetInterface)
- Type Parameters:
T - - Parameters:
targetInterface -
- Returns:
Copyright © 2014. All rights reserved.