public class ReflectionResolver extends AbstractResolver implements com.google.common.cache.RemovalListener<org.trimou.engine.resolver.MemberKey,com.google.common.base.Optional<org.trimou.engine.resolver.MemberWrapper>>
Reflections.findField(Class, String),
Reflections.findMethod(Class, String)| Modifier and Type | Field and Description |
|---|---|
static ConfigurationKey |
MEMBER_CACHE_MAX_SIZE_KEY
Limit the size of the cache (e.g. to avoid problems when dynamic class
compilation is involved).
|
static int |
REFLECTION_RESOLVER_PRIORITY |
BUILTIN_RESOLVERS_DEFAULT_PRIORITY, BUILTIN_TEMPLATE_LOCATORS_DEFAULT_PRIORITY, EXTENSION_RESOLVERS_DEFAULT_PRIORITY| Constructor and Description |
|---|
ReflectionResolver() |
ReflectionResolver(int priority) |
| Modifier and Type | Method and Description |
|---|---|
java.util.Set<ConfigurationKey> |
getConfigurationKeys() |
void |
init(Configuration configuration)
Initialize the component.
|
void |
onRemoval(com.google.common.cache.RemovalNotification<org.trimou.engine.resolver.MemberKey,com.google.common.base.Optional<org.trimou.engine.resolver.MemberWrapper>> notification) |
java.lang.Object |
resolve(java.lang.Object contextObject,
java.lang.String name,
ResolutionContext context)
Resolve the value from specified context object and name.
|
getPriority, toStringpublic static final int REFLECTION_RESOLVER_PRIORITY
public static final ConfigurationKey MEMBER_CACHE_MAX_SIZE_KEY
CacheBuilder.maximumSize(long)public ReflectionResolver()
public ReflectionResolver(int priority)
public java.lang.Object resolve(java.lang.Object contextObject,
java.lang.String name,
ResolutionContext context)
Resolvernull in case of the resolver is not capable
of resolving it.
ResolutionContext allows to register a callback to release all
the relevant resources after the resolved value is used.public void init(Configuration configuration)
ConfigurationAwareinit in interface ConfigurationAwareinit in class AbstractResolverpublic java.util.Set<ConfigurationKey> getConfigurationKeys()
getConfigurationKeys in interface ConfigurationAwaregetConfigurationKeys in class AbstractResolverpublic void onRemoval(com.google.common.cache.RemovalNotification<org.trimou.engine.resolver.MemberKey,com.google.common.base.Optional<org.trimou.engine.resolver.MemberWrapper>> notification)
onRemoval in interface com.google.common.cache.RemovalListener<org.trimou.engine.resolver.MemberKey,com.google.common.base.Optional<org.trimou.engine.resolver.MemberWrapper>>Copyright © 2013. All Rights Reserved.