FpML 5.3 JAXB绑定 [英] FpML 5.3 JAXB Bindings

查看:77
本文介绍了FpML 5.3 JAXB绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用jaxb绑定修复架构中的多个组引用?

How do I use jaxb bindings to fix multiple group references in a schema?

部分fpml 5.3在架构中具有以下内容

Part of fpml 5.3 has the following in the schema

  <xsd:complexType name="Price">
<xsd:annotation>
  <xsd:documentation xml:lang="en">A type describing the strike price.</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
  <xsd:element name="commission" type="Commission" minOccurs="0">
    <xsd:annotation>
      <xsd:documentation xml:lang="en">This optional component specifies the commission to be charged for executing the hedge transactions.</xsd:documentation>
    </xsd:annotation>
  </xsd:element>
  <xsd:choice minOccurs="0">
    <xsd:sequence>
      <xsd:element name="determinationMethod" type="DeterminationMethod">
        <xsd:annotation>
          <xsd:documentation xml:lang="en">Specifies the method according to which an amount or a date is determined.</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:group ref="EquityPrice.model" minOccurs="0"></xsd:group>
    </xsd:sequence>
    <xsd:element name="amountRelativeTo" type="AmountReference">
      <xsd:annotation>
        <xsd:documentation xml:lang="en">The href attribute value will be a pointer style reference to the element or component elsewhere in the document where the anchor amount is defined.</xsd:documentation>
      </xsd:annotation>
    </xsd:element>
    <xsd:group ref="EquityPrice.model"></xsd:group>
  </xsd:choice>
  <xsd:element name="cleanNetPrice" type="xsd:decimal" minOccurs="0">
    <xsd:annotation>
      <xsd:documentation xml:lang="en">The net price excluding accrued interest. The "Dirty Price" for bonds is put in the "netPrice" element, which includes accrued interest. Thus netPrice - cleanNetPrice = accruedInterest. The currency and price expression for this field are the same as those for the (dirty) netPrice.</xsd:documentation>
    </xsd:annotation>
  </xsd:element>
  <xsd:element name="quotationCharacteristics" type="QuotationCharacteristics" minOccurs="0">
    <xsd:annotation>
      <xsd:documentation>Allows information about how the price was quoted to be provided.</xsd:documentation>
    </xsd:annotation>
  </xsd:element>
</xsd:sequence>
  </xsd:complexType>

这导致

     * <p>
 * You are getting this "catch-all" property because of the following reason: 
 * The field name "GrossPrice" is used by two different parts of a schema. See: 
 * line 1361 of file:/C:/fpml-jaxb/src/main/xsd/fpml-asset-5-3.xsd
 * line 1361 of file:/C:/fpml-jaxb/src/main/xsd/fpml-asset-5-3.xsd
 * <p>

该错误具有误导性。 EquityPrice.model以此开头,第1361行是grossPrice。该问题源自上面的价格复杂类型中有2个对EquityPrice.model的组引用。

The error is misleading. EquityPrice.model starts with this and line 1361 is the grossPrice. The issue stems from above where there are 2 group references to EquityPrice.model in the Price complex type.

  <xsd:group name="EquityPrice.model">
<xsd:sequence>
  <xsd:element name="grossPrice" type="ActualPrice" minOccurs="0">
    <xsd:annotation>
      <xsd:documentation xml:lang="en">Specifies the price of the underlyer, before commissions.</xsd:documentation>
    </xsd:annotation>
  </xsd:element>

同样适用于TradeNovationContent,它有多个对NewTrade.model的引用。

The same thing applies for TradeNovationContent where it has multiple references to NewTrade.model.

推荐答案

我也有同样的问题,解决方法是启用简单的绑定模式。
将以下内容添加到外部绑定文件中。

I also had this same problem, the solution was to enable simple binding mode. Add the following into your external bindings file.

xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
...
<jxb:globalBindings>
    <xjc:simple />
</jxb:globalBindings>

错误是由JAXB处理组的方式引起的,正如您所见。

Error is caused by the way JAXB is handling groups, as you've seen yourself.

这篇关于FpML 5.3 JAXB绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆