使用“xs:any”获取“编译器无法遵守此javaType自定义”
我有以下xsd:
以及以下绑定:
但是当我运行xjc时……
xjc -p leif -b bindings.xml format.xsd
我收到以下错误:
parsing a schema... [ERROR] compiler was unable to honor this javaType customization. It is attached to a wrong place, or its inconsistent with other bindings. line 9 of file:/C:/Users/leif/workspace/doughan/src/main/resources/bindings.xml [ERROR] (the above customization is attached to the following location in the schema) line 7 of file:/C:/Users/leif/workspace/doughan/src/main/resources/format.xsd Failed to parse a schema.
它仅在为xs:any
定义javaType
时发生,当我将其更改为xs:element
它才起作用。 但我真的需要它是xs:any
。
我的目标是获得这样的课程:
@XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) public class Root { @XmlJavaTypeAdapter(Adapter1.class) @XmlAnyElement String any; }