Is JAXB Bug? please help me

Posted by wd-shuang on Stack Overflow See other posts from Stack Overflow or by wd-shuang
Published on 2010-05-24T05:08:15Z Indexed on 2010/05/24 5:10 UTC
Read the original article Hit count: 182

Filed under:

I take a scheme,its element definition as follow: I use xjb to export java file,xjb as follow:

Java as: @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "OriginalMessageContents1", propOrder = { "anyOne", "anyTwo" }) public class OriginalMessageContents1 {

@XmlAnyElement
protected Element anyOne;
@XmlAnyElement
protected Element anyTwo;


public Element getAnyOne() {
    return anyOne;
}


public void setAnyOne(Element value) {
    this.anyOne = value;
}


public Element getAnyTwo() {
    return anyTwo;
}

public void setAnyTwo(Element value) {
    this.anyTwo = value;
}

When I unmashaller this object by using getAnyOne,I got the second element content;I got null by using getAnyTwo.

It is a bug? Anybody can help me ?

thanks all.

© Stack Overflow or respective owner

Related posts about jaxb