1 Reply Latest reply: Aug 31, 2011 1:03 AM by 661027 RSS

    How can I make it with jaxb note?

    661027
      <customer>
      <name id="123">Bill</name>
      <age>10</age>
      </customer>

      How to map <name id="123">Bill</name> to java object with note?
        • 1. Re: How can I make it with jaxb note?
          661027
          public class Customer {
          Name name;
          String age;
          ......
          }

          @XmlAccessorType(XmlAccessType.FIELD)
          public class Name {
          @XmlAttribute
          private String id;
               @XmlValue
               private String value = "";
               
               public String getId() {
                    return id;
               }
               public void setId(String id) {
                    this.id = id;
               }
               public String getValue() {
                    return value;
               }
               public void setValue(String value) {
                    this.value = value;
               }
          }