2012-08-23 84 views
1

在Simple XML框架中用什麼替換JAXB註釋@XmlElementsSimple中的@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) 
}) 

回答

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) 
}) 
相關問題