1 Reply Latest reply on Mar 4, 2006 3:13 PM by aloubyansky

    Adding fixed value support to mapEntryKey

    starksm64

      Consider a map type of element that has a set of well known subelements along with support for custom elements. Can something like this work?

       <xs:element name="descriptors">
       <xs:annotation>
       <xs:documentation>
       The descriptors element contains all the descriptors for a containing element, as subelements.
       The descriptors suggested in the jmx spec have predefined elements, whereas custom descriptors have
       a generic element.
       </xs:documentation>
       <xs:appinfo>
       <jbxb:class impl="javax.management.modelmbean.DescriptorSupport"/>
       </xs:appinfo>
       </xs:annotation>
       <xs:complexType>
       <xs:sequence>
       <xs:element minOccurs="0" ref="xmbean:interceptors">
       <xs:annotation>
       <xs:appinfo>
       <putMethod name="setField"
       keyType="java.lang.String" valueType="java.lang.Object" />
       <mapEntry />
       <mapEntryKey key="interceptors" />
       <mapEntryValue />
       </xs:appinfo>
       </xs:annotation>
       </xs:element>
       <xs:element minOccurs="0" ref="xmbean:persistence">
       <xs:annotation>
       <xs:appinfo>
       <putMethod name="setField"
       keyType="java.lang.String" valueType="java.lang.Object" />
       <mapEntry />
       <mapEntryKey key="persistence" />
       <mapEntryValue />
       </xs:appinfo>
       </xs:annotation>
       </xs:element>
      ...
      
      
      


      This says the descriptors/interceptors element value should be added to the javax.management.modelmbean.DescriptorSupport corresponding to the descriptors element using the setField(String, Object) method with a fixed key of "interceptors" and the value being the binding for the interceptors element.