您可以利用
@XmlValue注释执行以下操作。
oo
@XmlRootElementclass Foo { @XmlElement(name="string") public Bar getBar() {...}}酒吧
class Bar { @XmlValue public String getString() {return "hello";}}想要查询更多的信息
- http://blog.bdoughan.com/2011/06/jaxb-and-complex-types-with-simple.html



