public class SpelAwareProxyProjectionFactory extends Object implements BeanFactoryAware
ProxyProjectionFactory that adds support to use Value-annotated methods on a projection interface
to evaluate the contained SpEL expression to define the outcome of the method call.| Constructor and Description |
|---|
SpelAwareProxyProjectionFactory() |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
createProjection(Class<T> projectionType)
Creates a projection instance for the given type.
|
<T> T |
createProjection(Class<T> projectionType,
Object source)
Creates a projection of the given type for the given source object.
|
List<String> |
getInputProperties(Class<?> projectionType)
Returns the properties that will be consumed by the given projection type.
|
ProjectionInformation |
getProjectionInformation(Class<?> projectionType)
Returns the
ProjectionInformation for the given projection type. |
protected org.aopalliance.intercept.MethodInterceptor |
postProcessAccessorInterceptor(org.aopalliance.intercept.MethodInterceptor interceptor,
Object source,
Class<?> projectionType)
Inspects the given target type for methods with
Value annotations and caches the result. |
void |
registerMethodInvokerFactory(MethodInterceptorFactory factory)
Registers the given
MethodInterceptorFactory to be used with the factory. |
void |
setBeanClassLoader(ClassLoader classLoader) |
void |
setBeanFactory(BeanFactory beanFactory) |
void |
setResourceLoader(ResourceLoader resourceLoader)
Deprecated.
rather set the
ClassLoader directly via setBeanClassLoader(ClassLoader). |
public void setBeanFactory(BeanFactory beanFactory) throws BeansException
setBeanFactory in interface BeanFactoryAwareBeansExceptionprotected org.aopalliance.intercept.MethodInterceptor postProcessAccessorInterceptor(org.aopalliance.intercept.MethodInterceptor interceptor,
Object source,
Class<?> projectionType)
Value annotations and caches the result. Will create a
SpelEvaluatingMethodInterceptor if an annotation was found or return the delegate as is if not.interceptor - the root MethodInterceptor.source - The backing source object.projectionType - the proxy target type.public ProjectionInformation getProjectionInformation(Class<?> projectionType)
ProjectionFactoryProjectionInformation for the given projection type.getProjectionInformation in interface ProjectionFactoryprojectionType - must not be null.@Deprecated public void setResourceLoader(ResourceLoader resourceLoader)
ClassLoader directly via setBeanClassLoader(ClassLoader).setResourceLoader in interface ResourceLoaderAwareResourceLoaderAware.setResourceLoader(org.springframework.core.io.ResourceLoader)public void setBeanClassLoader(ClassLoader classLoader)
setBeanClassLoader in interface BeanClassLoaderAwarepublic void registerMethodInvokerFactory(MethodInterceptorFactory factory)
MethodInterceptorFactory to be used with the factory. Factories registered later enjoy
precedence over previously registered ones.factory - must not be null.public <T> T createProjection(Class<T> projectionType, Object source)
ProjectionFactorycreateProjection in interface ProjectionFactoryprojectionType - the type to create, must not be null.source - the object to create a projection for, can be nullpublic <T> T createProjection(Class<T> projectionType)
ProjectionFactorycreateProjection in interface ProjectionFactoryprojectionType - the type to create, must not be null.public List<String> getInputProperties(Class<?> projectionType)
ProjectionFactorygetInputProperties in interface ProjectionFactoryprojectionType - must not be null.Copyright © 2011-2016–2016 Pivotal Software, Inc.. All rights reserved.