Class XMLUTF8OutputterWriter

java.lang.Object
com.highdeal.hci.XMLUTF8OutputterWriter
All Implemented Interfaces:
XMLOutputter

public class XMLUTF8OutputterWriter extends Object implements XMLOutputter
Implementation of an XMLOutputter using a writer.
  • Constructor Details

    • XMLUTF8OutputterWriter

      public XMLUTF8OutputterWriter(OutputStream outputStream)
    • XMLUTF8OutputterWriter

      public XMLUTF8OutputterWriter(OutputStream outputStream, boolean withXMLDeclaration)
  • Method Details

    • setIndent

      public void setIndent(boolean indent)
      Sets to false if the result cannot be indented otherwise set to true.
      Parameters:
      indent - Sets to false if the result cannot be indented otherwise set to true
    • marshal

      public void marshal(String tagName, IXMLMarshallable child)
      Description copied from interface: XMLOutputter
      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.

      Specified by:
      marshal in interface XMLOutputter
      Parameters:
      tagName - The name of child XML tag
      child - The child itself, that must be marshalled
    • startTag

      public void startTag(String tag)
      Description copied from interface: XMLOutputter
      Starts a XML tag.
      Specified by:
      startTag in interface XMLOutputter
      Parameters:
      tag - The name of the XML tag to start with
    • addAttribute

      public void addAttribute(String name, String value)
      Description copied from interface: XMLOutputter
      Adds an attribute of type string to the current XML tag.
      Specified by:
      addAttribute in interface XMLOutputter
      Parameters:
      name - The name of the attribute
      value - The text value of the attribute
    • addDecimalAttribute

      public void addDecimalAttribute(String name, BigDecimal value)
      Description copied from interface: XMLOutputter
      Adds an attribute of type decimal to the current XML tag.
      Specified by:
      addDecimalAttribute in interface XMLOutputter
      Parameters:
      name - The name of the attribute
      value - The numerical value of the attribute
    • addDateTimeAttribute

      public void addDateTimeAttribute(String name, Date value)
      Description copied from interface: XMLOutputter
      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'.
      Specified by:
      addDateTimeAttribute in interface XMLOutputter
      Parameters:
      name - The name of the attribute
      value - The value of the attribute
    • addDateAttribute

      public void addDateAttribute(String name, Date value)
      Description copied from interface: XMLOutputter
      Adds an attribute of type date to the current XML tag; Dates are encoded using ISO 8601 format, that is: 'YYYY-MM-DD'.
      Specified by:
      addDateAttribute in interface XMLOutputter
      Parameters:
      name - The name of the attribute
      value - The date value of the attribute
    • addBooleanAttribute

      public void addBooleanAttribute(String name, boolean value)
      Description copied from interface: XMLOutputter
      Adds an attribute of type boolean to the current XML tag.
      Specified by:
      addBooleanAttribute in interface XMLOutputter
      Parameters:
      name - The name of the attribute
      value - The value of the attribute
    • addCharacterData

      public void addCharacterData(String data)
      Description copied from interface: XMLOutputter
      Adds character data for the current XML tag.
      Specified by:
      addCharacterData in interface XMLOutputter
      Parameters:
      data - The character data to add for the current tag
    • addCharacterData

      public void addCharacterData(Reader readerData)
      Description copied from interface: XMLOutputter
      Adds character data for the current XML tag.
      Specified by:
      addCharacterData in interface XMLOutputter
      Parameters:
      readerData - The character data to add for the current tag as a Reader
    • addComment

      public void addComment(String... lines)
    • endTag

      public void endTag(String tag)
      Description copied from interface: XMLOutputter
      Ends the XML tag.
      Specified by:
      endTag in interface XMLOutputter
      Parameters:
      tag - The name of the XML tag to close
    • addIntegerAttribute

      public void addIntegerAttribute(String name, Integer value)
      Description copied from interface: XMLOutputter
      Adds an attribute of type integer to the current XML tag.
      Specified by:
      addIntegerAttribute in interface XMLOutputter
      Parameters:
      name - The name of the attribute
      value - The integer value of the attribute
    • addLongAttribute

      public void addLongAttribute(String name, Long value)
      Description copied from interface: XMLOutputter
      Adds an attribute of type long to the current XML tag.
      Specified by:
      addLongAttribute in interface XMLOutputter
      Parameters:
      name - The name of the attribute
      value - The value of the attribute
    • addBigIntegerAttribute

      public void addBigIntegerAttribute(String name, BigInteger value)
      Description copied from interface: XMLOutputter
      Adds an attribute of type big integer to the current XML tag.
      Specified by:
      addBigIntegerAttribute in interface XMLOutputter
      Parameters:
      name - The name of the attribute
      value - The value of the attribute
    • flush

      public void flush() throws IOException
      Throws:
      IOException