Class XmlWriterDelegate

java.lang.Object
com.aquima.interactions.foundation.xml.writer.XmlWriterDelegate
All Implemented Interfaces:
IXmlWriter

public class XmlWriterDelegate extends Object implements IXmlWriter
Class for easy xml writer delegation.
Since:
7.4
Author:
Jon van Leuven
  • Constructor Details

    • XmlWriterDelegate

      public XmlWriterDelegate(IXmlWriter writer)
  • Method Details

    • writeAttribute

      public void writeAttribute(String name, String attrValue) throws IOException
      Description copied from interface: IXmlWriter
      Writes an attribute value to the stream.
      Specified by:
      writeAttribute in interface IXmlWriter
      Parameters:
      name - The name of the attribute, may not be null.
      attrValue - The value of the attribute, when null no attribute will be written to the stream.
      Throws:
      IOException - If an I/O error occurs.
    • writeAttribute

      public void writeAttribute(String name, int attrValue) throws IOException
      Specified by:
      writeAttribute in interface IXmlWriter
      Throws:
      IOException
    • writeAttribute

      public void writeAttribute(String name, boolean attrValue) throws IOException
      Specified by:
      writeAttribute in interface IXmlWriter
      Throws:
      IOException
    • writeCDataValue

      public void writeCDataValue(String elementValue) throws IOException
      Description copied from interface: IXmlWriter

      This writes a value for the current element.

      This method will NOT escape xml sensitive characters before writing to the stream, but will use <![CDATA[ ]]> generate valid xml

      Specified by:
      writeCDataValue in interface IXmlWriter
      Parameters:
      elementValue - The value for the element, may not be null.
      Throws:
      IOException - If an I/O error occurs.
    • writeCDataElement

      public void writeCDataElement(String elementName, String elementValue) throws IOException
      Description copied from interface: IXmlWriter

      This writes a new element with a single value as a child of the current element.

      This method will NOT escape xml sensitive characters before writing to the stream, but will use <![CDATA[ ]]> generate valid xml

      Specified by:
      writeCDataElement in interface IXmlWriter
      Parameters:
      elementName - The value for the element, may not be null.
      elementValue - The value for the element, may not be null.
      Throws:
      IOException - If an I/O error occurs.
    • writeComment

      public void writeComment(String comment) throws IOException
      Description copied from interface: IXmlWriter
      Writes a comment element to the stream.
      Specified by:
      writeComment in interface IXmlWriter
      Parameters:
      comment - The comment, may be null.
      Throws:
      IOException - If an I/O error occurs.
    • writeXmlDecleration

      public void writeXmlDecleration() throws IOException
      Description copied from interface: IXmlWriter
      Writes the xml document declaration. For example: <?xml version="1.0" encoding="UTF-8" ?>
      Specified by:
      writeXmlDecleration in interface IXmlWriter
      Throws:
      IOException - If an I/O error occurs.
    • writeTagEnd

      public void writeTagEnd() throws IOException
      Description copied from interface: IXmlWriter
      Writes an end tag for the current element.
      Specified by:
      writeTagEnd in interface IXmlWriter
      Throws:
      IOException - If an I/O error occurs.
    • writeTagStart

      public void writeTagStart(String tagName) throws IOException
      Description copied from interface: IXmlWriter
      Write a start tag element to the stream.
      Specified by:
      writeTagStart in interface IXmlWriter
      Parameters:
      tagName - The name of the tag, may not be null.
      Throws:
      IOException - If an I/O error occurs.
    • writeValue

      public void writeValue(String elementValue) throws IOException
      Description copied from interface: IXmlWriter

      This writes a value for the current element.

      This method will escape xml sensitive characters before writing to the stream.

      Specified by:
      writeValue in interface IXmlWriter
      Parameters:
      elementValue - The value for the element, may not be null.
      Throws:
      IOException - If an I/O error occurs.