如何摆脱生成类中org.w3c。*包的导入?

时间:2019-02-22 14:13:31

标签: java jaxb schemabinding

我有一个复杂的类型,它的属性是对象序列。 JAXB在此属性的获取器中添加了一个Javadoc,如下所示:

/**
     * Gets the value of the content property.
     * 

     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link Element }
     * {@link Object }
     * {@link java.lang.String }
     * 
     * 
     */
    public List<Object> getContent() {
        if (content == null) {
            content = new ArrayList<Object>();
        }
        return this.content;
    }.

在javadoc中添加到Element类的链接导致将导入添加到该类,而该导入不能再与生成的类一起使用。

我试图像下面那样修改绑定,但是出现了错误

<jxb:bindings node="//xs:complexType[@name='Data']">
            <jxb:bindings node="xs:sequence">
                <jxb:bindings node="xs:any">
                    <jxb:javaType name="java.lang.Object"/>
                </jxb:bindings>
            </jxb:bindings>
</jxb:bindings>


com.sun.istack.SAXParseException2; systemId: file:/C:/bBindings.xjb; lineNumber: 68; columnNumber: 60; compiler was unable to honor this javaType customization. It is attached to a wrong place, or its inconsistent with other bindings.

有人知道如何解决这个问题并摆脱对org.w3c。*的所有导入吗?

0 个答案:

没有答案