public class SpelAwareProxyProjectionFactory extends Object implements org.springframework.beans.factory.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(org.springframework.beans.factory.BeanFactory beanFactory) |
void |
setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
Deprecated.
rather set the
ClassLoader directly via setBeanClassLoader(ClassLoader) . |
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException
setBeanFactory
in interface org.springframework.beans.factory.BeanFactoryAware
org.springframework.beans.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(org.springframework.core.io.ResourceLoader resourceLoader)
ClassLoader
directly via setBeanClassLoader(ClassLoader)
.setResourceLoader
in interface org.springframework.context.ResourceLoaderAware
ResourceLoaderAware.setResourceLoader(org.springframework.core.io.ResourceLoader)
public void setBeanClassLoader(ClassLoader classLoader)
setBeanClassLoader
in interface org.springframework.beans.factory.BeanClassLoaderAware
public 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)
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–2017 Pivotal Software, Inc.. All rights reserved.