什么相当于Simple中的@XmlElements?

时间:2012-08-23 16:24:48

标签: jaxb annotations simple-framework

在Simple XML框架中用什么替换JAXB注释@XmlElements

@XmlElements({ 
    @XmlElement(name = "distance", type = DistanceCheck.class), 
    @XmlElement(name = "pattern", type = PatternCheck.class), 
    @XmlElement(name = "compare", type = ComparisonCheck.class),
    @XmlElement(name = "check", type = CustomCheck.class), 
    @XmlElement(name = "unique", type = UniquenessCheck.class) 
 })

1 个答案:

答案 0 :(得分:2)

等效于:

@ElementUnion({
    @Element(name="distance", type=DistanceCheck.class),
    @Element(name="pattern", type=PatternCheck.class),
    @Element(name="compare", type=ComparisonCheck.class),
    @Element(name="check", type=CustomCheck.class),
    @Element(name="unique", type=UniquenessCheck.class)
})