I have a REST webservice with JAXB fields annotations. For example,
@XmlAccessorType(XmlAccessType.PROPERTY) public class MyClass{ private BigDecimal sum; /
You write an XmlAdapter and you annotate the getter of sum with it: @XmlJavaTypeAdapter(BigDecimalStringAdapter.class).
XmlAdapter
@XmlJavaTypeAdapter(BigDecimalStringAdapter.class)