简体   繁体   English

returnlegvaluationprice Jaxb对象创建不正确

[英]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. 我正在使用FPML 5.0 xsd的xjc命令生成JAXB对象,但是为returnLegValuationPrice生成的java对象未正确创建。

returnLegValuationPrice is defined in fpml-eq-shared-5-0.xsd and has the below definition : returnLegValuationPrice在fpml-eq-​​shared-5-0.xsd中定义,具有以下定义:

**<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. 生成的Java对象不包含元素名称“ valuationRules”的定义,其中包含一些值,我需要访问它们。

I manually modified the definition of returnLegValuationPrice as below and the generated java object has the definition of valuationRules. 我如下手动修改了returnLegValuationPrice的定义,并且生成的java对象具有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 ? 有人可以帮忙解决此奇怪行为的可能原因是什么,或者如果生成的java对象正确并且还有其他获取数据的方法?

Looks like we have the same problem on both sides of the fence ;-) Hello from TRS GUI! 看起来我们在篱笆的两侧都有相同的问题;-) TRS GUI您好!

Try putting this in your bindings.jxb file, xjc:simple is the answer... 尝试将其放在您的bindings.jxb文件中,xjc:simple是答案...

<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 希望对Calypso也有帮助:)-请让我知道它是否有效

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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