org.jsoup.nodes
public static class Document.OutputSettings extends java.lang.Object implements java.lang.Cloneable
Constructor and Description |
---|
Document.OutputSettings() |
Modifier and Type | Method and Description |
---|---|
java.nio.charset.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(java.nio.charset.Charset charset)
Update the document's output charset.
|
Document.OutputSettings |
charset(java.lang.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
|
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 |
prettyPrint()
Get if pretty printing is enabled.
|
Document.OutputSettings |
prettyPrint(boolean pretty)
Enable or disable pretty printing.
|
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 java.nio.charset.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(java.nio.charset.Charset charset)
charset
- the new charset to use.public Document.OutputSettings charset(java.lang.String charset)
charset
- the new charset (by name) to use.public boolean prettyPrint()
public Document.OutputSettings prettyPrint(boolean pretty)
pretty
- new pretty print 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()
clone
in class java.lang.Object
Copyright © 2009-2014 Jonathan Hedley. All Rights Reserved.