public class Format extends Object
Format
object is used to provide information on
how a generated XML document should be structured. The information
provided tells the formatter whether an XML prolog is required and
the number of spaces that should be used for indenting. The prolog
specified will be written directly before the XML document.
Should a Format
be created with an indent of zero or
less then no indentation is done, and the generated XML will be on
the same line. The prolog can contain any legal XML heading, which
can domain a DTD declaration and XML comments if required.
Constructor and Description |
---|
Format()
Constructor for the
Format object. |
Format(int indent)
Constructor for the
Format object. |
Format(int indent,
String prolog)
Constructor for the
Format object. |
Format(int indent,
String prolog,
boolean singleQuote) |
Format(int indent,
String prolog,
Style style)
Constructor for the
Format object. |
Format(int indent,
String prolog,
Style style,
boolean singleQuote) |
Format(int indent,
String prolog,
Style style,
Verbosity verbosity) |
Format(int indent,
String prolog,
Style style,
Verbosity verbosity,
boolean singleQuote)
Constructor for the
Format object. |
Format(int indent,
Style style)
Constructor for the
Format object. |
Format(int indent,
Style style,
Verbosity verbosity)
Constructor for the
Format object. |
Format(int indent,
Verbosity verbosity)
Constructor for the
Format object. |
Format(String prolog)
Constructor for the
Format object. |
Format(Style style)
Constructor for the
Format object. |
Format(Style style,
Verbosity verbosity)
Constructor for the
Format object. |
Format(Verbosity verbosity)
Constructor for the
Format object. |
Modifier and Type | Method and Description |
---|---|
int |
getIndent()
This method returns the size of the indent to use for the XML
generated.
|
String |
getProlog()
This method returns the prolog that is to be used at the start
of the generated XML document.
|
Style |
getStyle()
This is used to acquire the
Style for the format. |
Verbosity |
getVerbosity()
This method is used to indicate the preference of verbosity
for the resulting XML.
|
boolean |
isSingleQuote() |
public Format()
Format
object. This creates an
object that is used to describe how the formatter should create
the XML document. This constructor uses an indent size of three.public Format(int indent)
Format
object. This creates an
object that is used to describe how the formatter should create
the XML document. This constructor uses the specified indent
size and a null prolog, which means no prolog is generated.indent
- this is the number of spaces used in the indentpublic Format(String prolog)
Format
object. This creates an
object that is used to describe how the formatter should create
the XML document. This constructor uses the specified prolog
that is to be inserted at the start of the XML document.prolog
- this is the prolog for the generated XML documentpublic Format(int indent, String prolog)
Format
object. This creates an
object that is used to describe how the formatter should create
the XML document. This constructor uses the specified indent
size and the text to use in the generated prolog.indent
- this is the number of spaces used in the indentprolog
- this is the prolog for the generated XML documentpublic Format(Verbosity verbosity)
Format
object. This creates an
object that is used to describe how the formatter should create
the XML document. This constructor uses the specified style
to style the attributes and elements of the XML document.verbosity
- this indicates the verbosity of the formatpublic Format(int indent, Verbosity verbosity)
Format
object. This creates an
object that is used to describe how the formatter should create
the XML document. This constructor uses the specified style
to style the attributes and elements of the XML document.indent
- this is the number of spaces used in the indentverbosity
- this indicates the verbosity of the formatpublic Format(Style style)
Format
object. This creates an
object that is used to describe how the formatter should create
the XML document. This constructor uses the specified style
to style the attributes and elements of the XML document.style
- this is the style to apply to the format objectpublic Format(Style style, Verbosity verbosity)
Format
object. This creates an
object that is used to describe how the formatter should create
the XML document. This constructor uses the specified style
to style the attributes and elements of the XML document.style
- this is the style to apply to the format objectverbosity
- this indicates the verbosity of the formatpublic Format(int indent, Style style)
Format
object. This creates an
object that is used to describe how the formatter should create
the XML document. This constructor uses the specified indent
size and the style provided to style the XML document.indent
- this is the number of spaces used in the indentstyle
- this is the style to apply to the format objectpublic Format(int indent, Style style, Verbosity verbosity)
Format
object. This creates an
object that is used to describe how the formatter should create
the XML document. This constructor uses the specified indent
size and the style provided to style the XML document.indent
- this is the number of spaces used in the indentstyle
- this is the style to apply to the format objectverbosity
- this indicates the verbosity of the formatpublic Format(int indent, String prolog, Style style)
Format
object. This creates an
object that is used to describe how the formatter should create
the XML document. This constructor uses the specified indent
size and the text to use in the generated prolog.indent
- this is the number of spaces used in the indentprolog
- this is the prolog for the generated XML documentstyle
- this is the style to apply to the format objectpublic Format(int indent, String prolog, Style style, Verbosity verbosity, boolean singleQuote)
Format
object. This creates an
object that is used to describe how the formatter should create
the XML document. This constructor uses the specified indent
size and the text to use in the generated prolog.indent
- this is the number of spaces used in the indentprolog
- this is the prolog for the generated XML documentstyle
- this is the style to apply to the format objectverbosity
- this indicates the verbosity of the formatsingleQuote
- this indicates the quote style of the formatpublic int getIndent()
public String getProlog()
public Style getStyle()
Style
for the format.
If no style has been set a default style is used, which does
not modify the attributes and elements that are used to build
the resulting XML document.public Verbosity getVerbosity()
public boolean isSingleQuote()