Interface XMLOutputter

All Known Implementing Classes:
XMLOutputterWriter, XMLUTF8OutputterWriter

public interface XMLOutputter
This Java interface provides the necessary methods to output XML documents in an event-based manner; Consider the Java classes that implement this interface.

Use the following customizing sequence when outputting XML:

Caution

Your implementation must apply the sequence order.

  • Method Details

    • startTag

      void startTag(String tag)
      Starts a XML tag.
      Parameters:
      tag - The name of the XML tag to start with
    • addAttribute

      void addAttribute(String name, String value)
      Adds an attribute of type string to the current XML tag.
      Parameters:
      name - The name of the attribute
      value - The text value of the attribute
    • addDecimalAttribute

      void addDecimalAttribute(String name, BigDecimal value)
      Adds an attribute of type decimal to the current XML tag.
      Parameters:
      name - The name of the attribute
      value - The numerical value of the attribute
    • addDateAttribute

      void addDateAttribute(String name, Date value)
      Adds an attribute of type date to the current XML tag; Dates are encoded using ISO 8601 format, that is: 'YYYY-MM-DD'.
      Parameters:
      name - The name of the attribute
      value - The date value of the attribute
    • addDateTimeAttribute

      void addDateTimeAttribute(String name, Date value)
      Adds an attribute of type date and time to the current XML tag; Date and times are encoded using ISO 8601 format, that is: 'YYYY-MM-DDTHH:MM:SS.mmm'.
      Parameters:
      name - The name of the attribute
      value - The value of the attribute
    • addBooleanAttribute

      void addBooleanAttribute(String name, boolean value)
      Adds an attribute of type boolean to the current XML tag.
      Parameters:
      name - The name of the attribute
      value - The value of the attribute
    • addIntegerAttribute

      void addIntegerAttribute(String name, Integer value)
      Adds an attribute of type integer to the current XML tag.
      Parameters:
      name - The name of the attribute
      value - The integer value of the attribute
    • addLongAttribute

      void addLongAttribute(String name, Long value)
      Adds an attribute of type long to the current XML tag.
      Parameters:
      name - The name of the attribute
      value - The value of the attribute
    • addBigIntegerAttribute

      void addBigIntegerAttribute(String name, BigInteger value)
      Adds an attribute of type big integer to the current XML tag.
      Parameters:
      name - The name of the attribute
      value - The value of the attribute
    • addCharacterData

      void addCharacterData(String data)
      Adds character data for the current XML tag.
      Parameters:
      data - The character data to add for the current tag
    • addCharacterData

      void addCharacterData(Reader data)
      Adds character data for the current XML tag.
      Parameters:
      data - The character data to add for the current tag as a Reader
    • endTag

      void endTag(String tag)
      Ends the XML tag.
      Parameters:
      tag - The name of the XML tag to close
    • marshal

      void marshal(String tagName, IXMLMarshallable child)
      Marshals a node into this writer.

      The sequence is:

      1. Writing the start XML tag
      2. Writing the attributes IXMLMarshallable.marshalAttributes(XMLOutputter)
      3. Calling recursively IXMLMarshallable.marshalChildren(XMLOutputter)
      4. Writing the end XML tag

      Note

      This method is taking care of handling a null child.

      Parameters:
      tagName - The name of child XML tag
      child - The child itself, that must be marshalled