简体   繁体   中英

returnlegvaluationprice Jaxb object not created correctly

I am generating JAXB objects using the xjc command for the FPML 5.0 xsd's but the generated java object for returnLegValuationPrice is not created correctly.

returnLegValuationPrice is defined in fpml-eq-shared-5-0.xsd and has the below definition :

**<xsd:complexType name="ReturnLegValuationPrice">
    <xsd:complexContent>
      <xsd:extension base="Price">
        <xsd:sequence>
          <xsd:element name="valuationRules" type="EquityValuation" minOccurs="0">
            <xsd:annotation>
              <xsd:documentation xml:lang="en">Specifies valuation.</xsd:documentation>
            </xsd:annotation>
          </xsd:element>
        </xsd:sequence>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>**

Generated java object does not contain the definition for element name "valuationRules" which contains some values and i need to access them.

I manually modified the definition of returnLegValuationPrice as below and the generated java object has the definition of valuationRules.

**<xsd:complexType name="ReturnLegValuationPrice">
    <xsd:complexContent>
      <xsd:extension base="DirectionalLegUnderlyer">
        <xsd:sequence>
          <xsd:element name="valuationRules" type="EquityValuation" minOccurs="0">
            <xsd:annotation>
              <xsd:documentation xml:lang="en">Specifies valuation.</xsd:documentation>
            </xsd:annotation>
          </xsd:element>
        </xsd:sequence>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>**

Can someone please help on what could be the possible reason of this strange behaviour or if the generated java object is correct and there is some other way to fetch the data ?

Looks like we have the same problem on both sides of the fence ;-) Hello from TRS GUI!

Try putting this in your bindings.jxb file, xjc:simple is the answer...

<jxb:globalBindings >
    <xjc:simple/>
</jxb:globalBindings>

You will get some name conflicts that you need to resolve manually, so add this as well and customize the parameter names:

<jxb:bindings schemaLocation="../xsd/fpml-com-5-0.xsd">
        <jxb:bindings node="//xsd:complexType[@name='CommodityMarketDisruption']//xsd:element[@name='marketDisruptionEvents']">
            <jxb:property name="mde"/>
        </jxb:bindings>
        <jxb:bindings node="//xsd:complexType[@name='CommodityMarketDisruption']//xsd:element[@name='disruptionFallbacks']">
            <jxb:property name="df"/>
        </jxb:bindings>
</jxb:bindings>

Hope that helps on the Calypso side as well :) - please let me know if it worked

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM