Announcement Announcement Module
Collapse
No announcement yet.
noob: How to wire property with underlying Vector Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • noob: How to wire property with underlying Vector

    Pretty new to this... Using XML bean configuration and wiring a property that expect a Vector input. I have tried the list, but it seems the default implementation class is ArrayList. Is there anyway to indicate the implementation class; such as the class attribute that the bean element supports?

  • #2
    Hey dcook,

    Using the Spring 2.0 XML Schema-based configuration:

    Code:
    <util:list id="myList" list-class="java.util.Vector">
        <value>valueOne</value>
        <value>valueTwo</value>
    </util:list>
    Otherwise, see the ListFactoryBean.setTargetListClass method (which can be set via injection, of course).

    -Arthur Loder

    Comment


    • #3
      Thanks Arthur,

      I am limit here to production level software. Any info available on when 2.0 will graduate from RC status?

      Dennis

      Comment


      • #4
        Duh, never mind. countdown is on home page

        Comment


        • #5
          Still works in 1.2

          Hi Dennis,

          Even if you are restricted to Spring 1.2, you can use the targetListClass property of the ListFactoryBean class to set the actual List implementation you desire. The 2.0 XML schema-based approach is just a more succinct way of expressing the same concept.

          -Arthur Loder
          Last edited by Arthur Loder; Oct 2nd, 2006, 05:30 PM.

          Comment


          • #6
            But wouldn't use of the ListFactoryBean.targetListClass approach change the implemenation class for all use of list element, where the 2.0 approach can be instance specific?

            I think I can wait for the 2.0 release

            Comment

            Working...
            X