|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jsoup.nodes.Node
org.jsoup.nodes.Element
org.jsoup.nodes.Document
public class Document
A HTML Document.
| Nested Class Summary | |
|---|---|
static class |
Document.OutputSettings
A Document's output settings control the form of the text() and html() methods. |
static class |
Document.QuirksMode
|
| Constructor Summary | |
|---|---|
Document(String baseUri)
Create a new, empty Document. |
|
| Method Summary | |
|---|---|
Element |
body()
Accessor to the document's body element. |
Charset |
charset()
Returns the charset used in this document. |
void |
charset(Charset charset)
Sets the charset used in this document. |
Document |
clone()
Create a stand-alone, deep copy of this node, and all of its children. |
Element |
createElement(String tagName)
Create a new Element, with this document's base uri. |
static Document |
createShell(String baseUri)
Create a valid, empty shell of a document, suitable for adding more elements to. |
boolean |
equals(Object o)
Check if this node is equal to another node. |
Element |
head()
Accessor to the document's head element. |
String |
location()
Get the URL this Document was parsed from. |
String |
nodeName()
Get the node name of this node. |
Document |
normalise()
Normalise the document. |
String |
outerHtml()
Get the outer HTML of this node. |
Document.OutputSettings |
outputSettings()
Get the document's current output settings. |
Document |
outputSettings(Document.OutputSettings outputSettings)
Set the document's output settings. |
Document.QuirksMode |
quirksMode()
|
Document |
quirksMode(Document.QuirksMode quirksMode)
|
Element |
text(String text)
Set the text of the body of this document. |
String |
title()
Get the string contents of the document's title element. |
void |
title(String title)
Set the document's title element. |
boolean |
updateMetaCharsetElement()
Returns whether the element with charset information in this document is updated on changes through Document.charset(Charset) or not. |
void |
updateMetaCharsetElement(boolean update)
Sets whether the element with charset information in this document is updated on changes through Document.charset(Charset) or not. |
| Methods inherited from class org.jsoup.nodes.Node |
|---|
absUrl, addChildren, addChildren, attr, attributes, baseUri, childNode, childNodes, childNodesAsArray, childNodesCopy, childNodeSize, doClone, hasAttr, indent, nextSibling, outerHtml, ownerDocument, parentNode, previousSibling, remove, removeAttr, removeChild, reparentChild, replaceChild, replaceWith, setBaseUri, setParentNode, setSiblingIndex, siblingIndex, siblingNodes, traverse, unwrap |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Document(String baseUri)
baseUri - base URI of documentJsoup.parse(java.lang.String, java.lang.String),
createShell(java.lang.String)| Method Detail |
|---|
public static Document createShell(String baseUri)
baseUri - baseUri of document
public String location()
public Element head()
head element.
headpublic Element body()
body element.
bodypublic String title()
title element.
public void title(String title)
title element. Updates the existing element, or adds title to head if
not present
title - string to set as titlepublic Element createElement(String tagName)
tagName - element tag name (e.g. a)
public Document normalise()
public String outerHtml()
Node
outerHtml in class Nodepublic Element text(String text)
body of this document. Any existing nodes within the body will be cleared.
text in class Elementtext - unencoded text
public String nodeName()
Node
nodeName in class Elementpublic void charset(Charset charset)
OutputSettings.charset(Charset) but in addition it updates the
charset / encoding element within the document.
This enables
meta charset update.
If there's no element with charset / encoding information yet it will be created. Obsolete charset / encoding definitions are removed!
Elements used:
charset - CharsetupdateMetaCharsetElement(boolean),
Document.OutputSettings.charset(java.nio.charset.Charset)public Charset charset()
Document.OutputSettings.charset().
Document.OutputSettings.charset()public void updateMetaCharsetElement(boolean update)
Document.charset(Charset) or not.
If set to false (default) there are no elements modified.
update - If true the element updated on charset
changes, false if notcharset(java.nio.charset.Charset)public boolean updateMetaCharsetElement()
Document.charset(Charset) or not.
public Document clone()
Node
The cloned node may be adopted into another Document or node structure using Element.appendChild(Node).
clone in class Elementpublic Document.OutputSettings outputSettings()
public Document outputSettings(Document.OutputSettings outputSettings)
outputSettings - new output settings.
public Document.QuirksMode quirksMode()
public Document quirksMode(Document.QuirksMode quirksMode)
public boolean equals(Object o)
Node
equals in class Elemento - other object to compare to
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||