Class Pcdata

  • All Implemented Interfaces:
    CharSequence
    Direct Known Subclasses:
    Base64Data, IntArrayData, IntData

    public abstract class Pcdata
    extends Object
    implements CharSequence
    Text data in XML.

    This class is used inside the marshaller/unmarshaller to send/receive text data.

    On top of CharSequence, this class has an ability to write itself to the XmlOutput. This allows the implementation to choose the most efficient way possible when writing to XML (for example, it can skip the escaping of buffer copying.) TODO: visitor pattern support?

    Author:
    Kohsuke Kawaguchi
    • Constructor Detail

      • Pcdata

        public Pcdata()
    • Method Detail

      • writeTo

        public void writeTo​(char[] buf,
                            int start)
        Writes itself to the character array.

        This method is used by most other XmlOutput. The default implementation involves in one extra char[] copying.

        The caller must provide a big enough buffer that can hold enough characters returned by the CharSequence.length() method.