Uploaded image for project: 'XBean'
  1. XBean
  2. XBEAN-69

Support for maps of objects

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.8
    • 3.0
    • spring
    • None
    • Linux JDK 1.4.2

    Description

      The current syntax supports defining a map of values for a property. This only works if the value is a string.

      <beans:beans
      xmlns="http://ns.com/app/1.0"
      xmlns:beans="http://www.springframework.org/schema/beans"
      xmlns:util="http://www.springframework.org/schema/util"
      >
      <MyObject>
      <mapProperty>
      <property key="sideBar">hello</property>
      </mapProperty>
      </MyObject>
      </beans:beans>

      For my application I would like the value of the map to be another XBean

      <beans:beans
      xmlns="http://ns.com/app/1.0"
      xmlns:beans="http://www.springframework.org/schema/beans"
      xmlns:util="http://www.springframework.org/schema/util"
      >
      <MyObject>
      <mapProperty>
      <entry key="sideBar">
      <ChildObject>
      <name>Test</name>
      </ChildObject>
      </entry>
      </mapProperty>
      </MyObject>
      </beans:beans>

      I tried to use the spring map object but all this does is set an empty map.

      <beans:beans
      xmlns="http://ns.com/app/1.0"
      xmlns:beans="http://www.springframework.org/schema/beans"
      xmlns:util="http://www.springframework.org/schema/util"
      >
      <MyObject>
      <mapProperty>
      <util:map>
      <!-- Use the spring namespace for entry -->
      <beans:entry key="sideBar">
      <ChildObject>
      <name>Test</name>
      </ChildObject>
      </beans:entry>
      </util:map>
      </mapProperty>
      </MyObject>
      </beans:beans>

      Attachments

        Issue Links

          Activity

            People

              gnodet Guillaume Nodet
              p_d_austin Paul Austin
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: