Class PrettyPrintXMLWriter
- java.lang.Object
-
- org.apache.maven.shared.utils.xml.PrettyPrintXMLWriter
-
- All Implemented Interfaces:
XMLWriter
@Deprecated public class PrettyPrintXMLWriter extends java.lang.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 Summary
Constructors Constructor Description PrettyPrintXMLWriter(java.io.PrintWriter writer)Deprecated.PrettyPrintXMLWriter(java.io.PrintWriter writer, java.lang.String lineIndent)Deprecated.PrettyPrintXMLWriter(java.io.PrintWriter writer, java.lang.String encoding, java.lang.String doctype)Deprecated.PrettyPrintXMLWriter(java.io.PrintWriter writer, java.lang.String lineIndent, java.lang.String encoding, java.lang.String doctype)Deprecated.PrettyPrintXMLWriter(java.io.PrintWriter writer, java.lang.String lineIndent, java.lang.String lineSeparator, java.lang.String encoding, java.lang.String doctype)Deprecated.PrettyPrintXMLWriter(java.io.Writer writer)Deprecated.PrettyPrintXMLWriter(java.io.Writer writer, java.lang.String lineIndent)Deprecated.PrettyPrintXMLWriter(java.io.Writer writer, java.lang.String encoding, java.lang.String doctype)Deprecated.PrettyPrintXMLWriter(java.io.Writer writer, java.lang.String lineIndent, java.lang.String encoding, java.lang.String doctype)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddAttribute(java.lang.String key, java.lang.String value)Deprecated.Add a XML attribute to the current XML Element.voidendElement()Deprecated.End the previously opened element.voidsetDocType(java.lang.String docType)Deprecated.Sets the DOCTYPE of the document.voidsetEncoding(java.lang.String encoding)Deprecated.Sets the encoding of the document.voidsetLineIndenter(java.lang.String lineIndentParameter)Deprecated.voidsetLineSeparator(java.lang.String lineSeparator)Deprecated.voidstartElement(java.lang.String elementName)Deprecated.Start an XML Element tag.voidwriteMarkup(java.lang.String markup)Deprecated.Add preformatted markup to the current element tag.voidwriteText(java.lang.String text)Deprecated.Add text to the current element tag.
-
-
-
Constructor Detail
-
PrettyPrintXMLWriter
public PrettyPrintXMLWriter(java.io.PrintWriter writer, java.lang.String lineIndent)Deprecated.- Parameters:
writer- not nulllineIndent- can be null, but the normal way is some spaces
-
PrettyPrintXMLWriter
public PrettyPrintXMLWriter(java.io.Writer writer, java.lang.String lineIndent)Deprecated.- Parameters:
writer- not nulllineIndent- can be null, but the normal way is some spaces
-
PrettyPrintXMLWriter
public PrettyPrintXMLWriter(java.io.PrintWriter writer)
Deprecated.- Parameters:
writer- not null
-
PrettyPrintXMLWriter
public PrettyPrintXMLWriter(java.io.Writer writer)
Deprecated.- Parameters:
writer- not null
-
PrettyPrintXMLWriter
public PrettyPrintXMLWriter(java.io.PrintWriter writer, java.lang.String lineIndent, java.lang.String encoding, java.lang.String doctype)Deprecated.- Parameters:
writer- not nulllineIndent- can be null, but the normal way is some spacesencoding- can be null or invaliddoctype- can be null
-
PrettyPrintXMLWriter
public PrettyPrintXMLWriter(java.io.Writer writer, java.lang.String lineIndent, java.lang.String encoding, java.lang.String doctype)Deprecated.- Parameters:
writer- not nulllineIndent- can be null, but the normal way is some spacesencoding- can be null or invaliddoctype- can be null
-
PrettyPrintXMLWriter
public PrettyPrintXMLWriter(java.io.PrintWriter writer, java.lang.String encoding, java.lang.String doctype)Deprecated.- Parameters:
writer- not nullencoding- can be null or invaliddoctype- can be null
-
PrettyPrintXMLWriter
public PrettyPrintXMLWriter(java.io.Writer writer, java.lang.String encoding, java.lang.String doctype)Deprecated.- Parameters:
writer- not nullencoding- can be null or invaliddoctype- can be null
-
PrettyPrintXMLWriter
public PrettyPrintXMLWriter(java.io.PrintWriter writer, java.lang.String lineIndent, java.lang.String lineSeparator, java.lang.String encoding, java.lang.String doctype)Deprecated.- Parameters:
writer- not nulllineIndent- can be null, but the normal way is some spaceslineSeparator- can be null, but the normal way is valid line separatorencoding- can be null or the encoding to usedoctype- can be null
-
-
Method Detail
-
addAttribute
public void addAttribute(java.lang.String key, java.lang.String value) throws java.io.IOExceptionDeprecated.Add a XML attribute to the current XML Element. This method must get called immediately afterXMLWriter.startElement(String).- Specified by:
addAttributein interfaceXMLWriter- Parameters:
key- the key of the attributevalue- the value of the attribute- Throws:
java.io.IOException- if adding the attribute fails
-
setEncoding
public void setEncoding(java.lang.String encoding)
Deprecated.Sets the encoding of the document. If not set, UTF-8 is used.- Specified by:
setEncodingin interfaceXMLWriter- Parameters:
encoding- the encoding
-
setDocType
public void setDocType(java.lang.String docType)
Deprecated.Sets the DOCTYPE of the document.- Specified by:
setDocTypein interfaceXMLWriter- Parameters:
docType- the docType
-
setLineSeparator
public void setLineSeparator(java.lang.String lineSeparator)
Deprecated.- Parameters:
lineSeparator- the line separator to be output
-
setLineIndenter
public void setLineIndenter(java.lang.String lineIndentParameter)
Deprecated.- Parameters:
lineIndentParameter- the line indent parameter
-
startElement
public void startElement(java.lang.String elementName) throws java.io.IOExceptionDeprecated.Start an XML Element tag.- Specified by:
startElementin interfaceXMLWriter- Parameters:
elementName- the name of the tag- Throws:
java.io.IOException- if starting the element fails
-
writeText
public void writeText(java.lang.String text) throws java.io.IOExceptionDeprecated.Add text to the current element tag. This performs XML escaping to guarantee well-formed content.
-
writeMarkup
public void writeMarkup(java.lang.String markup) throws java.io.IOExceptionDeprecated.Add preformatted markup to the current element tag.- Specified by:
writeMarkupin interfaceXMLWriter- Parameters:
markup- the text which should be written- Throws:
java.io.IOException- if writing the markup fails
-
endElement
public void endElement() throws java.io.IOExceptionDeprecated.End the previously opened element.- Specified by:
endElementin interfaceXMLWriter- Throws:
java.io.IOException- if ending the element fails- See Also:
XMLWriter.startElement(String)
-
-