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 pojection 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.
|
protected boolean |
isInputProperty(PropertyDescriptor descriptor)
Returns whether the given
PropertyDescriptor describes an input property for the projection, i.e. a
property that needs to be present on the source to be able to create reasonable projections for the type the
descriptor was looked up on. |
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 |
setBeanFactory(BeanFactory beanFactory) |
void |
setResourceLoader(ResourceLoader resourceLoader) |
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.protected boolean isInputProperty(PropertyDescriptor descriptor)
PropertyDescriptor describes an input property for the projection, i.e. a
property that needs to be present on the source to be able to create reasonable projections for the type the
descriptor was looked up on.descriptor - will never be null.public void setResourceLoader(ResourceLoader resourceLoader)
setResourceLoader in interface ResourceLoaderAwarepublic <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-2015–2015 Pivotal Software, Inc.. All rights reserved.