org.apache.maven.shared.utils.xml
Class XmlWriterUtil

java.lang.Object
  extended by org.apache.maven.shared.utils.xml.XmlWriterUtil

public class XmlWriterUtil
extends Object

Utility class for the XmlWriter class.

Version:
$Id$
Author:
Vincent Siveton

Field Summary
static int DEFAULT_COLUMN_LINE
          The default column before line wrapping i.e.
static int DEFAULT_INDENTATION_SIZE
          The default line indenter size i.e.
static String LS
          The vm line separator
 
Constructor Summary
XmlWriterUtil()
           
 
Method Summary
static void writeComment(XMLWriter writer, String comment)
          Convenience method to write XML comment line.
static void writeComment(XMLWriter writer, String comment, int indent)
          Convenience method to write XML comment line.
static void writeComment(XMLWriter writer, String comment, int indent, int indentSize)
          Convenience method to write XML comment line.
static void writeComment(XMLWriter writer, String comment, int indent, int indentSize, int columnSize)
          Convenience method to write XML comment line.
static void writeCommentLineBreak(XMLWriter writer)
          Convenience method to write XML comment line break.
static void writeCommentLineBreak(XMLWriter writer, int columnSize)
          Convenience method to write XML comment line break with columnSize as length.
static void writeCommentText(XMLWriter writer, String comment)
          Convenience method to write XML comments between two comments line break.
static void writeCommentText(XMLWriter writer, String comment, int indent)
          Convenience method to write XML comments between two comments line break.
static void writeCommentText(XMLWriter writer, String comment, int indent, int indentSize)
          Convenience method to write XML comment between two comment line break.
static void writeCommentText(XMLWriter writer, String comment, int indent, int indentSize, int columnSize)
          Convenience method to write XML comments between two comments line break.
static void writeLineBreak(XMLWriter writer)
          Convenience method to write one CRLF.
static void writeLineBreak(XMLWriter writer, int repeat)
          Convenience method to repeat CRLF.
static void writeLineBreak(XMLWriter writer, int repeat, int indent)
          Convenience method to repeat CRLF and to indent the writer by 2.
static void writeLineBreak(XMLWriter writer, int repeat, int indent, int indentSize)
          Convenience method to repeat CRLF and to indent the writer by indentSize.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LS

public static final String LS
The vm line separator


DEFAULT_INDENTATION_SIZE

public static final int DEFAULT_INDENTATION_SIZE
The default line indenter size i.e. 2.

See Also:
Constant Field Values

DEFAULT_COLUMN_LINE

public static final int DEFAULT_COLUMN_LINE
The default column before line wrapping i.e. 80.

See Also:
Constant Field Values
Constructor Detail

XmlWriterUtil

public XmlWriterUtil()
Method Detail

writeLineBreak

public static void writeLineBreak(XMLWriter writer)
Convenience method to write one CRLF.

Parameters:
writer - not null writer

writeLineBreak

public static void writeLineBreak(XMLWriter writer,
                                  int repeat)
Convenience method to repeat CRLF.

Parameters:
writer - not null
repeat - positive number

writeLineBreak

public static void writeLineBreak(XMLWriter writer,
                                  int repeat,
                                  int indent)
Convenience method to repeat CRLF and to indent the writer by 2.

Parameters:
writer - not null
repeat - The number of repetitions of the indent
indent - positive number
See Also:
DEFAULT_INDENTATION_SIZE, writeLineBreak(XMLWriter, int, int, int)

writeLineBreak

public static void writeLineBreak(XMLWriter writer,
                                  int repeat,
                                  int indent,
                                  int indentSize)
Convenience method to repeat CRLF and to indent the writer by indentSize.

Parameters:
writer - not null
repeat - The number of repetitions of the indent
indent - positive number
indentSize - positive number

writeCommentLineBreak

public static void writeCommentLineBreak(XMLWriter writer)
Convenience method to write XML comment line break. Its size is 80.

Parameters:
writer - not null
See Also:
DEFAULT_COLUMN_LINE, writeCommentLineBreak(XMLWriter, int)

writeCommentLineBreak

public static void writeCommentLineBreak(XMLWriter writer,
                                         int columnSize)
Convenience method to write XML comment line break with columnSize as length.

Parameters:
writer - not null
columnSize - positive number

writeComment

public static void writeComment(XMLWriter writer,
                                String comment)
Convenience method to write XML comment line. The comment is splitted to have a size of 80.

Parameters:
writer - not null
comment - The comment to write
See Also:
DEFAULT_INDENTATION_SIZE, writeComment(XMLWriter, String, int, int)

writeComment

public static void writeComment(XMLWriter writer,
                                String comment,
                                int indent)
Convenience method to write XML comment line. The comment is splitted to have a size of 80 and is indented by indent using 2 as indentation size.

Parameters:
writer - not null
comment - The comment to write
indent - positive number
See Also:
DEFAULT_INDENTATION_SIZE, writeComment(XMLWriter, String, int, int)

writeComment

public static void writeComment(XMLWriter writer,
                                String comment,
                                int indent,
                                int indentSize)
Convenience method to write XML comment line. The comment is splitted to have a size of 80 and is indented by indent using indentSize.

Parameters:
writer - not null
comment - The comment to write
indent - positive number
indentSize - positive number
See Also:
DEFAULT_COLUMN_LINE, writeComment(XMLWriter, String, int, int, int)

writeComment

public static void writeComment(XMLWriter writer,
                                String comment,
                                int indent,
                                int indentSize,
                                int columnSize)
Convenience method to write XML comment line. The comment is splitted to have a size of columnSize and is indented by indent using indentSize.

Parameters:
writer - not null
comment - The comment to write
indent - positive number
indentSize - positive number
columnSize - positive number

writeCommentText

public static void writeCommentText(XMLWriter writer,
                                    String comment)
Convenience method to write XML comments between two comments line break. The XML comment block is not indented.

Parameters:
writer - not null
comment - The comment to write
See Also:
DEFAULT_INDENTATION_SIZE, writeCommentText(XMLWriter, String, int, int)

writeCommentText

public static void writeCommentText(XMLWriter writer,
                                    String comment,
                                    int indent)
Convenience method to write XML comments between two comments line break. The XML comment block is also indented by indent using 2 as indentation size.

Parameters:
writer - not null
comment - The comment to write
indent - positive number
See Also:
DEFAULT_INDENTATION_SIZE, writeCommentText(XMLWriter, String, int, int)

writeCommentText

public static void writeCommentText(XMLWriter writer,
                                    String comment,
                                    int indent,
                                    int indentSize)
Convenience method to write XML comment between two comment line break. The XML comment block is also indented by indent using indentSize.

Parameters:
writer - not null
comment - The comment to write
indent - positive number
indentSize - positive number
See Also:
DEFAULT_COLUMN_LINE, writeCommentText(XMLWriter, String, int, int, int)

writeCommentText

public static void writeCommentText(XMLWriter writer,
                                    String comment,
                                    int indent,
                                    int indentSize,
                                    int columnSize)
Convenience method to write XML comments between two comments line break. The XML comment block is also indented by indent using indentSize. The column size could be also be specified.

Parameters:
writer - not null
comment - The comment to write
indent - positive number
indentSize - positive number
columnSize - positive number


Copyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.