Results 1 to 4 of 4

Thread: beanNames datatype in BeanNameAutoProxyCreator

  1. #1

    Default beanNames datatype in BeanNameAutoProxyCreator

    How come the injection below work? xml there is list type but in class there is String[] type. So which one is correct?

    //spring reference there is
    In Spring reference there is
    <bean id="autoProxyCreator"
    class="org.springframework.aop.framework.autoproxy .BeanNameAutoProxyCreator">
    <property name="beanNames"><value>jdk*,onlyJdk</value></property>

    //i am using this
    <bean id="autoProxyCreator"
    class="org.springframework.aop.framework.autoproxy .BeanNameAutoProxyCreator">
    <property name="beanNames">
    <list>
    <idref bean="userImpl"/>


    public class BeanNameAutoProxyCreator extends AbstractAutoProxyCreator
    {
    private List beanNames;

    public void setBeanNames(String[] beanNames) {
    this.beanNames = Arrays.asList(beanNames);
    }

  2. #2
    Join Date
    Feb 2005
    Location
    Boston, MA
    Posts
    1,142

    Default

    One of the big features of the core container is to be able to map one type of value into another. Mostly strings into other objects. In this case its mapping a list of strings into an array of strings. But it can do all sorts of things like strings into Class objects. Using custom editors that you register with the ApplicationContext you can convert strings into Date or Timestamp using a particular format.

    What the container does is examine the type of the input data and using reflection and introspection be able to figure out which methods to call, including ones that use overloading. Although at times when there is an ambiguous match, you need to give more detail. This is why you'll see constructor-args often use the index or type attribute.
    Bill

  3. #3

    Default

    Do you know which page of spring reference can learn this thing? I want to know more clear those types of method?

  4. #4
    Join Date
    Aug 2004
    Location
    New York, NY, USA
    Posts
    33

    Default

    Quote Originally Posted by jimmy6
    Do you know which page of spring reference can learn this thing? I want to know more clear those types of method?
    Take a look here:

    http://static.springframework.org/sp...-customeditors
    http://static.springframework.org/sp...-customeditors
    Regards,
    Dmitriy.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •