public class PlaceholderTargetSource
extends org.springframework.aop.target.SimpleBeanTargetSource
implements org.springframework.beans.factory.InitializingBean
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).Constructor and Description |
---|
PlaceholderTargetSource() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
protected String |
convertToString(Object value,
org.springframework.beans.TypeConverter typeConverter) |
Object |
getTarget() |
void |
setContextFactory(ContextFactory contextFactory)
Public setter for the context factory.
|
public void setContextFactory(ContextFactory contextFactory)
contextFactory
- the ContextFactory
public void afterPropertiesSet()
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
public Object getTarget() throws org.springframework.beans.BeansException
getTarget
in interface org.springframework.aop.TargetSource
getTarget
in class org.springframework.aop.target.SimpleBeanTargetSource
org.springframework.beans.BeansException
Copyright © 2013 SpringSource. All rights reserved.