public static class Document.OutputSettings extends Object implements Cloneable
Modifier and Type | Class and Description |
---|---|
static class |
Document.OutputSettings.Syntax
The output serialization syntax.
|
Modifier and Type | Field and Description |
---|---|
private Charset |
charset |
(package private) Entities.CoreCharset |
coreCharset |
(package private) CharsetEncoder |
encoder |
private Entities.EscapeMode |
escapeMode |
private int |
indentAmount |
private boolean |
outline |
private boolean |
prettyPrint |
private Document.OutputSettings.Syntax |
syntax |
Constructor and Description |
---|
OutputSettings() |
Modifier and Type | Method and Description |
---|---|
Charset |
charset()
Get the document's current output charset, which is used to control which characters are escaped when
generating HTML (via the
html() methods), and which are kept intact. |
Document.OutputSettings |
charset(Charset charset)
Update the document's output charset.
|
Document.OutputSettings |
charset(String charset)
Update the document's output charset.
|
Document.OutputSettings |
clone() |
Entities.EscapeMode |
escapeMode()
Get the document's current HTML escape mode:
base , which provides a limited set of named HTML
entities and escapes other characters as numbered entities for maximum compatibility; or extended ,
which uses the complete set of HTML named entities. |
Document.OutputSettings |
escapeMode(Entities.EscapeMode escapeMode)
Set the document's escape mode, which determines how characters are escaped when the output character set
does not support a given character:- using either a named or a numbered escape.
|
int |
indentAmount()
Get the current tag indent amount, used when pretty printing.
|
Document.OutputSettings |
indentAmount(int indentAmount)
Set the indent amount for pretty printing
|
boolean |
outline()
Get if outline mode is enabled.
|
Document.OutputSettings |
outline(boolean outlineMode)
Enable or disable HTML outline mode.
|
(package private) CharsetEncoder |
prepareEncoder() |
boolean |
prettyPrint()
Get if pretty printing is enabled.
|
Document.OutputSettings |
prettyPrint(boolean pretty)
Enable or disable pretty printing.
|
Document.OutputSettings.Syntax |
syntax()
Get the document's current output syntax.
|
Document.OutputSettings |
syntax(Document.OutputSettings.Syntax syntax)
Set the document's output syntax.
|
private Entities.EscapeMode escapeMode
CharsetEncoder encoder
Entities.CoreCharset coreCharset
private boolean prettyPrint
private boolean outline
private int indentAmount
private Document.OutputSettings.Syntax syntax
public OutputSettings()
public Entities.EscapeMode escapeMode()
base
, which provides a limited set of named HTML
entities and escapes other characters as numbered entities for maximum compatibility; or extended
,
which uses the complete set of HTML named entities.
The default escape mode is base
.
public Document.OutputSettings escapeMode(Entities.EscapeMode escapeMode)
escapeMode
- the new escape mode to usepublic Charset charset()
html()
methods), and which are kept intact.
Where possible (when parsing from a URL or File), the document's output charset is automatically set to the input charset. Otherwise, it defaults to UTF-8.
public Document.OutputSettings charset(Charset charset)
charset
- the new charset to use.public Document.OutputSettings charset(String charset)
charset
- the new charset (by name) to use.CharsetEncoder prepareEncoder()
public Document.OutputSettings.Syntax syntax()
public Document.OutputSettings syntax(Document.OutputSettings.Syntax syntax)
html
, with empty tags and boolean attributes (etc), or
xml
, with self-closing tags.syntax
- serialization syntaxpublic boolean prettyPrint()
public Document.OutputSettings prettyPrint(boolean pretty)
pretty
- new pretty print settingpublic boolean outline()
public Document.OutputSettings outline(boolean outlineMode)
outlineMode
- new outline settingpublic int indentAmount()
public Document.OutputSettings indentAmount(int indentAmount)
indentAmount
- number of spaces to use for indenting each level. Must be >= 0.public Document.OutputSettings clone()
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses