org.springframework.batch.core.scope.util
Class PlaceholderTargetSource
java.lang.Object
org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
org.springframework.aop.target.SimpleBeanTargetSource
org.springframework.batch.core.scope.util.PlaceholderTargetSource
- All Implemented Interfaces:
- java.io.Serializable, org.springframework.aop.TargetClassAware, org.springframework.aop.TargetSource, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean
public class PlaceholderTargetSource
- extends org.springframework.aop.target.SimpleBeanTargetSource
- implements org.springframework.beans.factory.InitializingBean
A TargetSource that lazily initializes its target, replacing bean
definition properties dynamically if they are marked as placeholders. String
values with embedded %{key} patterns will be replaced with the
corresponding value from the injected context (which must also be a String).
This includes dynamically locating a bean reference (e.g.
ref="%{foo}"), and partial replacement of patterns (e.g.
value="%{foo}-bar-%{spam}"). These replacements work for context
values that are primitive (String, Long, Integer). You can also replace
non-primitive values directly by making the whole bean property value into a
placeholder (e.g. value="%{foo}" where foo is a
property in the context).
- Author:
- Dave Syer
- See Also:
- Serialized Form
| Fields inherited from class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource |
logger |
| Methods inherited from class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource |
copyFrom, equals, getBeanFactory, getTargetBeanName, getTargetClass, hashCode, isStatic, releaseTarget, setBeanFactory, setTargetBeanName, setTargetClass, toString, writeReplace |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
PlaceholderTargetSource
public PlaceholderTargetSource()
setContextFactory
public void setContextFactory(ContextFactory contextFactory)
- Public setter for the context factory. Used to construct the context root
whenever placeholders are replaced in a bean definition.
- Parameters:
contextFactory - the ContextFactory
afterPropertiesSet
public void afterPropertiesSet()
- Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
getTarget
public java.lang.Object getTarget()
throws org.springframework.beans.BeansException
- Specified by:
getTarget in interface org.springframework.aop.TargetSource- Overrides:
getTarget in class org.springframework.aop.target.SimpleBeanTargetSource
- Throws:
org.springframework.beans.BeansException
convertToString
protected java.lang.String convertToString(java.lang.Object value,
org.springframework.beans.TypeConverter typeConverter)
- Parameters:
value - typeConverter -
- Returns:
- a String representation of the input if possible
Copyright © 2009. All Rights Reserved.