protected class AbstractNlsBundleFactory.NlsBundleInvocationHandler extends Object implements InvocationHandler, AbstractNlsBundleFactory.NlsBundleDescriptor
InvocationHandler for the dynamic NlsBundle instance.| Modifier and Type | Field and Description |
|---|---|
private Class<? extends NlsBundle> |
bundleInterface |
private String |
bundleName |
private Map<String,AbstractNlsBundleFactory.NlsBundleMethodInfo> |
method2BundleInfoMap
The cache for the
AbstractNlsBundleFactory.NlsBundleMethodInfos. |
private NlsBundleOptions |
options
The
NlsBundleOptions. |
| Constructor and Description |
|---|
NlsBundleInvocationHandler(Class<? extends NlsBundle> bundleInterface,
String bundleName,
NlsBundleOptions options)
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected Map<String,Object> |
createArgumentMap(Method method,
AbstractNlsBundleFactory.NlsBundleMethodInfo methodInfo,
Object[] arguments)
|
private AbstractNlsBundleFactory.NlsBundleMethodInfo |
createMethodInfo(Method method,
Object[] args,
String methodName,
Object proxy) |
protected NlsTemplate |
createTemplate(Method method)
|
protected String[] |
getArgumentNames(Method method)
|
private AbstractNlsBundleFactory.NlsBundleMethodInfo |
getOrCreateMethodInfo(Method method,
Object[] args,
String methodName,
Object proxy)
Gets
AbstractNlsBundleFactory.NlsBundleMethodInfo for methodName from cache or creates it and puts it into the cache. |
Iterable<? extends javax.inject.Provider<NlsTemplate>> |
getTemplateContainers() |
private Object |
handleObjectMethod(Object proxy,
Method method,
Object[] args) |
Object |
invoke(Object proxy,
Method method,
Object[] args) |
private void |
populate() |
private final String bundleName
invoke(Object, Method, Object[])private final NlsBundleOptions options
NlsBundleOptions.private final Map<String,AbstractNlsBundleFactory.NlsBundleMethodInfo> method2BundleInfoMap
AbstractNlsBundleFactory.NlsBundleMethodInfos.public NlsBundleInvocationHandler(Class<? extends NlsBundle> bundleInterface, String bundleName, NlsBundleOptions options)
bundleInterface - the NlsBundle interface.bundleName - is the qualified name of the ResourceBundle.options - are the NlsBundleOptions.protected Map<String,Object> createArgumentMap(Method method, AbstractNlsBundleFactory.NlsBundleMethodInfo methodInfo, Object[] arguments)
protected String[] getArgumentNames(Method method)
method - is the NlsBundle-Method that has been invoked.argument-names.public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
invoke in interface InvocationHandlerThrowableprivate Object handleObjectMethod(Object proxy, Method method, Object[] args) throws IllegalAccessException, InvocationTargetException
private AbstractNlsBundleFactory.NlsBundleMethodInfo getOrCreateMethodInfo(Method method, Object[] args, String methodName, Object proxy)
AbstractNlsBundleFactory.NlsBundleMethodInfo for methodName from cache or creates it and puts it into the cache.method - is the Method or null for generic invocation (lookup).args - are the method arguments or null for generic invocation (lookup).methodName - is the name of the Method.proxy - is the proxy object used for generic invocation to find the Method by methodName if
not given.AbstractNlsBundleFactory.NlsBundleMethodInfo. May be null for generic invocation if method for
methodName was not found (does not exist).private AbstractNlsBundleFactory.NlsBundleMethodInfo createMethodInfo(Method method, Object[] args, String methodName, Object proxy)
protected NlsTemplate createTemplate(Method method)
method - is the Method of an NlsBundle.NlsTemplate.public Iterable<? extends javax.inject.Provider<NlsTemplate>> getTemplateContainers()
getTemplateContainers in interface AbstractNlsBundleFactory.NlsBundleDescriptorIterable with the containers providing the contained
NlsTemplates.private void populate()
Copyright © 2001–2016 mmm-Team. All rights reserved.