public class TrimWhitespaceAdapter
extends jakarta.xml.bind.annotation.adapters.XmlAdapter<String,String>
XmlAdapter
which trims all whitespace surrounding a String.
This is primarily useful for @XmlValue
-annotated fields in JAXB objects, as XML
values can commonly be formatted like so:
<ns:tag>
XML value here.
</ns:tag>
-
Constructor Summary
Constructors
-
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
TrimWhitespaceAdapter
public TrimWhitespaceAdapter()
-
Method Details
-
unmarshal
- Specified by:
unmarshal
in class jakarta.xml.bind.annotation.adapters.XmlAdapter<String,String>
-
marshal
- Specified by:
marshal
in class jakarta.xml.bind.annotation.adapters.XmlAdapter<String,String>