Class XMLSerializer

All Implemented Interfaces:
Closeable, AutoCloseable

public class XMLSerializer extends StandardSerializer
This class serializes items as XML.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Method Details

    • doctype

      protected void doctype(byte[] type) throws IOException
      Prints the document type declaration.
      Parameters:
      type - document type
      Throws:
      IOException - I/O exception
    • namespace

      protected void namespace(byte[] prefix, byte[] uri, boolean standalone) throws IOException
      Description copied from class: Serializer
      Serializes a namespace.
      Overrides:
      namespace in class Serializer
      Parameters:
      prefix - prefix
      uri - namespace URI
      standalone - standalone flag
      Throws:
      IOException - I/O exception
    • attribute

      protected void attribute(byte[] name, byte[] value, boolean standalone) throws IOException
      Description copied from class: Serializer
      Serializes an attribute.
      Overrides:
      attribute in class Serializer
      Parameters:
      name - name
      value - value
      standalone - standalone flag
      Throws:
      IOException - I/O exception
    • text

      protected void text(byte[] value, FTPos ftp) throws IOException
      Description copied from class: Serializer
      Serializes a text.
      Overrides:
      text in class Serializer
      Parameters:
      value - value
      ftp - full-text positions, used for visualization highlighting
      Throws:
      IOException - I/O exception
    • comment

      protected void comment(byte[] value) throws IOException
      Description copied from class: Serializer
      Serializes a comment.
      Overrides:
      comment in class Serializer
      Parameters:
      value - value
      Throws:
      IOException - I/O exception
    • pi

      protected void pi(byte[] name, byte[] value) throws IOException
      Description copied from class: Serializer
      Serializes a processing instruction.
      Overrides:
      pi in class Serializer
      Parameters:
      name - name
      value - value
      Throws:
      IOException - I/O exception
    • openDoc

      protected void openDoc(byte[] name)
      Description copied from class: Serializer
      Opens a document.
      Overrides:
      openDoc in class Serializer
      Parameters:
      name - name
    • startOpen

      protected void startOpen(QNm name) throws IOException
      Description copied from class: Serializer
      Starts an element.
      Overrides:
      startOpen in class Serializer
      Parameters:
      name - element name
      Throws:
      IOException - I/O exception
    • finishOpen

      protected void finishOpen() throws IOException
      Description copied from class: Serializer
      Finishes an opening element node.
      Overrides:
      finishOpen in class Serializer
      Throws:
      IOException - I/O exception
    • finishEmpty

      protected void finishEmpty() throws IOException
      Description copied from class: Serializer
      Closes an empty element.
      Overrides:
      finishEmpty in class Serializer
      Throws:
      IOException - I/O exception
    • finishClose

      protected void finishClose() throws IOException
      Description copied from class: Serializer
      Closes an element.
      Overrides:
      finishClose in class Serializer
      Throws:
      IOException - I/O exception
    • atomic

      protected void atomic(Item item) throws IOException
      Description copied from class: Serializer
      Serializes an atomic value.
      Overrides:
      atomic in class StandardSerializer
      Parameters:
      item - item
      Throws:
      IOException - I/O exception
    • print

      protected void print(int cp) throws IOException
      Description copied from class: StandardSerializer
      Prints a single character.
      Overrides:
      print in class StandardSerializer
      Parameters:
      cp - codepoint
      Throws:
      IOException - I/O exception
    • skipElement

      protected boolean skipElement(ANode node)
      Description copied from class: Serializer
      Checks if an element should be skipped.
      Overrides:
      skipElement in class Serializer
      Parameters:
      node - node to be serialized
      Returns:
      result of check
    • printDoctype

      protected final void printDoctype(byte[] type, String pub, String sys) throws IOException
      Prints the document type declaration.
      Parameters:
      type - document type
      pub - doctype-public parameter
      sys - doctype-system parameter
      Throws:
      IOException - I/O exception
    • indent

      protected void indent() throws IOException
      Description copied from class: OutputSerializer
      Prints indentation whitespaces.
      Overrides:
      indent in class OutputSerializer
      Throws:
      IOException - I/O exception
    • printCT

      protected final boolean printCT(boolean empty, boolean html) throws IOException
      Prints the content type declaration.
      Parameters:
      empty - empty flag
      html - method
      Returns:
      true if declaration was printed
      Throws:
      IOException - I/O exception