Example usage for org.springframework.beans.factory.config PropertyPathFactoryBean setTargetBeanName

List of usage examples for org.springframework.beans.factory.config PropertyPathFactoryBean setTargetBeanName

Introduction

In this page you can find the example usage for org.springframework.beans.factory.config PropertyPathFactoryBean setTargetBeanName.

Prototype

public void setTargetBeanName(String targetBeanName) 

Source Link

Document

Specify the name of a target bean to apply the property path to.

Usage

From source file:marshalsec.gadgets.SpringPropertyPathFactory.java

@Primary
@Args(minArgs = 1, args = { "jndiUrl" }, defaultArgs = { MarshallerBase.defaultJNDIUrl })
default Object makePropertyPathFactory(UtilFactory uf, String[] args) throws Exception {
    String jndiUrl = args[0];/*from   ww  w  .  j a v a 2  s .c  o  m*/
    BeanFactory bf = SpringUtil.makeJNDITrigger(jndiUrl);

    PropertyPathFactoryBean ppf = new PropertyPathFactoryBean();
    ppf.setTargetBeanName(jndiUrl);
    ppf.setPropertyPath("foo");

    Reflections.setFieldValue(ppf, "beanFactory", bf);
    return ppf;
}