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.
|
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 |
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 BeanFactoryAware
BeansException
protected 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)
ProjectionFactory
ProjectionInformation
for the given projection type.getProjectionInformation
in interface ProjectionFactory
projectionType
- must not be null.@Deprecated public void setResourceLoader(ResourceLoader resourceLoader)
ClassLoader
directly via setBeanClassLoader(ClassLoader)
.setResourceLoader
in interface ResourceLoaderAware
ResourceLoaderAware.setResourceLoader(org.springframework.core.io.ResourceLoader)
public void setBeanClassLoader(ClassLoader classLoader)
setBeanClassLoader
in interface BeanClassLoaderAware
public <T> T createProjection(Class<T> projectionType, Object source)
ProjectionFactory
createProjection
in interface ProjectionFactory
projectionType
- 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)
ProjectionFactory
createProjection
in interface ProjectionFactory
projectionType
- the type to create, must not be null.public List<String> getInputProperties(Class<?> projectionType)
ProjectionFactory
getInputProperties
in interface ProjectionFactory
projectionType
- must not be null.Copyright © 2011-2015–2017 Pivotal Software, Inc.. All rights reserved.