How to bind a xml element into an object member variable?

后端 未结 2 1628
误落风尘
误落风尘 2021-01-13 19:39

I\'m trying to unmarshal an xml to an object using moxy.Below is the sample of the xml.


    
        value         


        
2条回答
  •  梦毁少年i
    2021-01-13 20:38

    You need to use the @XmlValue annotation on the addressline property.

    @XmlAccessorType(XmlAccessType.FIELD)
    class Address {
        @XmlValue
        String addressline;
    }
    

提交回复
热议问题