I am getting a long string as attribute and I want to unmarshal a part of it.
Here is what element look like:
<Party id="PARTYID_1341592540748_ed044bd3-b8b2-40f9-a679-4daa411ecc45">
But I want just 1341592540748 to be set as id.
Is it possible to edit @XmlAttribute string on the fly ?
I would recommend implementing an instance of
XmlAdapterto contain this logic. The advantage of this approach is that the XML conversion logic is kept separate from your domain model. AnXmlAdapteris set on a field/property using the@XmlJavaTypeAdapterannotation.For More Information