在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)
})
答案 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)
})