Class TrimStringAdapter


  • public class TrimStringAdapter
    extends javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,​java.lang.String>
    An XmlAdapter that removes leading and trailing whitespace, and converts internal strings of whitespace to a single space. Newlines are also removed, except when it looks like they've been added to improve readability (specifically, when there's more than one newline in a row. In other words, blank lines are preserved). Also interns the cached strings in our own pool.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String marshal​(java.lang.String s)  
      java.lang.String unmarshal​(java.lang.String v)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TrimStringAdapter

        public TrimStringAdapter()
    • Method Detail

      • unmarshal

        public java.lang.String unmarshal​(java.lang.String v)
        Specified by:
        unmarshal in class javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,​java.lang.String>
      • marshal

        public java.lang.String marshal​(java.lang.String s)
        Specified by:
        marshal in class javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,​java.lang.String>