- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我使用以下带注释的类通过 MOXy 2.4.0 进行解码。解码到该对象中效果很好
@XmlElementRefs({
@XmlElementRef(name = "a", namespace = "http://mynamespace", type = JAXBElement.class),
@XmlElementRef(name = "b", namespace = "http://mynamespace", type = JAXBElement.class)
})
protected List<JAXBElement<?>> elements;
我现在想允许此列表中的任意元素,因此我附加了@XmlAnyElement
@XmlAnyElement(lax=true)
@XmlElementRefs({
@XmlElementRef(name = "a", namespace = "http://mynamespace", type = JAXBElement.class),
@XmlElementRef(name = "b", namespace = "http://mynamespace", type = JAXBElement.class)
})
protected List<Object> elements;
现在整个列表仅包含 com.sun.org.apache.xerces.internal.dom.ElementNSImpl
类型的类,但不应 lax=true
启用在这种情况下,DOM 元素和 JAXBElement 的异构列表?
最佳答案
这是 EclipseLink JAXB (MOXy) 中的一个已知问题。您可以使用以下错误来跟踪我们在此问题上的进展:
关于java - @XmlAnyElement 和 @XmlElementRefs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15618820/
有人可以给我解释一下吗 @XmlElementRefs 和 @XmlElementRef 注解在 Java 中的含义及其用途.. EDIT: @skaffman 好吧,假设我有一个这样的 Collec
当我尝试在 SpringToolSuite 中进行调试时。它有时会引发异常 Invalid XmlElementRef on property expression on class org.open
我正在为来自 xsd 模式的 JAXB 注释类使用 XJC 实用程序,我有点惊讶并且不明白为什么会生成 @XmlElementRefs。一切都发生在以下 xsd 片段中(此处省略命名空间)
我使用以下带注释的类通过 MOXy 2.4.0 进行解码。解码到该对象中效果很好 @XmlElementRefs({ @XmlElementRef(name = "a", namesp
我有以下类(class) @XmlRootElement(name = "entity") public class Entity { @XmlElementRef protected
您好,有人可以解释一下如何解决以下问题吗?我有这样的类结构.. public class RequestWrapper implements Seriallizable { private
我有一些类(class),例如... @XmlRootElement(name="Predicate") @XmlAccessorType(XmlAccessType.FIELD) public ab
我对 Web 服务请求和响应 XML 使用相同的 @XmlElementRef 元素,例如: 请求: @XmlElementRef(name = "elementId", namespace = "b
我没有将名称作为 @XmlElementRef 的标记名称。 父elemnet中的元素声明: @XmlElementRef(name = "Agents", type = JAXBElement.c
是否可以在使用@XmlElementRef 注释的引用对象上使用@XmlValue 注释?目标是生成以下 XML 输出: Blah 给定以下示例 JAXBContex
这个问题已经以不同的方式被问过多次,但我在这里从不同的角度提出疑问。那么让我们来看下面的例子: 对于 XSD 中的上一行,JAXB 生成以下代码: @XmlElementRef(name = "Ri
我在使用 jdk 1.6 时遇到以下错误,但它在 1.7 中工作 cannot find symbol method required() javax.xml.bind.annotation.XmlE
我有 4 个类(class)。 Person 类,以及抽象的 ContactInformation,Phone 和 Address 类对其进行扩展。 @XmlRootElement @XmlAcces
我正在尝试使用 maven-jaxb2-plugin 编译位于 http://www.aptatcip.com/APTA-TCIP-S-01%204.0_files/Schema%20Set.zip
我是一名优秀的程序员,十分优秀!