Package org.codehaus.plexus.util.xml
Class XmlUtil
java.lang.Object
org.codehaus.plexus.util.xml.XmlUtil
Common XML utilities methods.
- Since:
- 1.5.7
- Author:
- Vincent Siveton
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intThe default line indenter size i.e.static final StringThe default line separator ("\n" on UNIX)
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic booleanDetermines if a given File shall be handled as XML.static voidprettyFormat(InputStream is, OutputStream os) Pretty format the input stream.static voidprettyFormat(InputStream is, OutputStream os, int indentSize, String lineSeparator) Pretty format the input stream.static voidprettyFormat(Reader reader, Writer writer) Pretty format the input reader.static voidprettyFormat(Reader reader, Writer writer, int indentSize, String lineSeparator) Pretty format the input reader.
- 
Field Details- 
DEFAULT_INDENTATION_SIZEpublic static final int DEFAULT_INDENTATION_SIZEThe default line indenter size i.e. 2.- See Also:
 
- 
DEFAULT_LINE_SEPARATORThe default line separator ("\n" on UNIX)
 
- 
- 
Constructor Details- 
XmlUtilpublic XmlUtil()
 
- 
- 
Method Details- 
isXmlDetermines if a given File shall be handled as XML.- Parameters:
- f- not null file
- Returns:
- trueif the given file has XML content,- falseotherwise.
 
- 
prettyFormatPretty format the input reader. For instance, the following input:<div><b>content</b></div> becomes<div> <b>content</b> </div> - Parameters:
- reader- not null
- writer- not null
- Throws:
- IOException- if any or invalid xml content
- See Also:
 
- 
prettyFormatpublic static void prettyFormat(Reader reader, Writer writer, int indentSize, String lineSeparator) throws IOException Pretty format the input reader. For instance, the following input:<div><b>content</b></div> becomes<div> <b>content</b> </div> - Parameters:
- reader- not null
- writer- not null
- indentSize- positive number for the indentation
- lineSeparator- the wanted line separator
- Throws:
- IOException- if any or invalid xml content
- See Also:
 
- 
prettyFormatPretty format the input stream. For instance, the following input:<div><b>content</b></div> becomes<div> <b>content</b> </div> - Parameters:
- is- not null
- os- not null
- Throws:
- IOException- if any or invalid xml content
- See Also:
 
- 
prettyFormatpublic static void prettyFormat(InputStream is, OutputStream os, int indentSize, String lineSeparator) throws IOException Pretty format the input stream. For instance, the following input:<div><b>content</b></div> becomes<div> <b>content</b> </div> - Parameters:
- is- not null
- os- not null
- indentSize- positive number for the indentation
- lineSeparator- the wanted line separator
- Throws:
- IOException- if any or invalid xml content
 
 
-