Class PrettyPrintXMLWriter

java.lang.Object
org.apache.maven.shared.utils.xml.PrettyPrintXMLWriter
All Implemented Interfaces:
XMLWriter

@Deprecated public class PrettyPrintXMLWriter extends Object implements XMLWriter
Deprecated.
this class swallows and ignores IOExceptions. It is dangerous to use when writing to anything other than a StringWriter.
XMLWriter with nice indentation.
Author:
kama
  • Constructor Details

    • PrettyPrintXMLWriter

      public PrettyPrintXMLWriter(PrintWriter writer, String lineIndent)
      Deprecated.
      Parameters:
      writer - not null
      lineIndent - can be null, but the normal way is some spaces
    • PrettyPrintXMLWriter

      public PrettyPrintXMLWriter(Writer writer, String lineIndent)
      Deprecated.
      Parameters:
      writer - not null
      lineIndent - can be null, but the normal way is some spaces
    • PrettyPrintXMLWriter

      public PrettyPrintXMLWriter(PrintWriter writer)
      Deprecated.
      Parameters:
      writer - not null
    • PrettyPrintXMLWriter

      public PrettyPrintXMLWriter(Writer writer)
      Deprecated.
      Parameters:
      writer - not null
    • PrettyPrintXMLWriter

      public PrettyPrintXMLWriter(PrintWriter writer, String lineIndent, String encoding, String doctype)
      Deprecated.
      Parameters:
      writer - not null
      lineIndent - can be null, but the normal way is some spaces
      encoding - can be null or invalid
      doctype - can be null
    • PrettyPrintXMLWriter

      public PrettyPrintXMLWriter(Writer writer, String lineIndent, String encoding, String doctype)
      Deprecated.
      Parameters:
      writer - not null
      lineIndent - can be null, but the normal way is some spaces
      encoding - can be null or invalid
      doctype - can be null
    • PrettyPrintXMLWriter

      public PrettyPrintXMLWriter(PrintWriter writer, String encoding, String doctype)
      Deprecated.
      Parameters:
      writer - not null
      encoding - can be null or invalid
      doctype - can be null
    • PrettyPrintXMLWriter

      public PrettyPrintXMLWriter(Writer writer, String encoding, String doctype)
      Deprecated.
      Parameters:
      writer - not null
      encoding - can be null or invalid
      doctype - can be null
    • PrettyPrintXMLWriter

      public PrettyPrintXMLWriter(PrintWriter writer, String lineIndent, String lineSeparator, String encoding, String doctype)
      Deprecated.
      Parameters:
      writer - not null
      lineIndent - can be null, but the normal way is some spaces
      lineSeparator - can be null, but the normal way is valid line separator
      encoding - can be null or the encoding to use
      doctype - can be null
  • Method Details

    • addAttribute

      public void addAttribute(String key, String value) throws IOException
      Deprecated.
      Add a XML attribute to the current XML Element. This method must get called immediately after XMLWriter.startElement(String).
      Specified by:
      addAttribute in interface XMLWriter
      Parameters:
      key - the key of the attribute
      value - the value of the attribute
      Throws:
      IOException - if adding the attribute fails
    • setEncoding

      public void setEncoding(String encoding)
      Deprecated.
      Sets the encoding of the document. If not set, UTF-8 is used.
      Specified by:
      setEncoding in interface XMLWriter
      Parameters:
      encoding - the encoding
    • setDocType

      public void setDocType(String docType)
      Deprecated.
      Sets the DOCTYPE of the document.
      Specified by:
      setDocType in interface XMLWriter
      Parameters:
      docType - the docType
    • setLineSeparator

      public void setLineSeparator(String lineSeparator)
      Deprecated.
      Parameters:
      lineSeparator - the line separator to be output
    • setLineIndenter

      public void setLineIndenter(String lineIndentParameter)
      Deprecated.
      Parameters:
      lineIndentParameter - the line indent parameter
    • startElement

      public void startElement(String elementName) throws IOException
      Deprecated.
      Start an XML Element tag.
      Specified by:
      startElement in interface XMLWriter
      Parameters:
      elementName - the name of the tag
      Throws:
      IOException - if starting the element fails
    • writeText

      public void writeText(String text) throws IOException
      Deprecated.
      Add text to the current element tag. This performs XML escaping to guarantee well-formed content.
      Specified by:
      writeText in interface XMLWriter
      Parameters:
      text - the text which should be written
      Throws:
      IOException - if writing the text fails
    • writeMarkup

      public void writeMarkup(String markup) throws IOException
      Deprecated.
      Add preformatted markup to the current element tag.
      Specified by:
      writeMarkup in interface XMLWriter
      Parameters:
      markup - the text which should be written
      Throws:
      IOException - if writing the markup fails
    • endElement

      public void endElement() throws IOException
      Deprecated.
      End the previously opened element.
      Specified by:
      endElement in interface XMLWriter
      Throws:
      IOException - if ending the element fails
      See Also: