|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjavax.xml.parsers.DocumentBuilder
org.jdesktop.dom.SimpleHtmlDocumentBuilder
public class SimpleHtmlDocumentBuilder extends DocumentBuilder
An HTML DOM DocumentBuilder implementation that does
not require the factory pattern for creation. Most of the time calling one of
the static simpleParse methods is all that is required.
This implementation requires a normal DOM parser. It is not suitable for parsing arbitrary HTML documents, even those documents which conform to the various HTML specifications. Rather, it requires a preproccesor to first clean up the HTML such that it can be parsed into a DOM.
| Field Summary | |
|---|---|
private static SimpleHtmlDocumentBuilder |
INSTANCE
|
private SAXParserFactory |
factory
|
| Constructor Summary | |
SimpleHtmlDocumentBuilder()
Create a new SimpleHtmlDocumentBuilder. |
|
| Methods inherited from class DocumentBuilder | |
|---|---|
| reset, parse, parse, parse, parse, parse, setErrorHandler, setEntityResolver, isNamespaceAware, isValidating, newDocument, getDOMImplementation, getSchema, isXIncludeAware, wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
| Methods inherited from class Object | |
|---|---|
| wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
| Field Detail |
|---|
private static SimpleHtmlDocumentBuilder INSTANCE
private SAXParserFactory factory
| Constructor Detail |
|---|
public SimpleHtmlDocumentBuilder()
| Method Detail |
|---|
public org.w3c.dom.DOMImplementation getDOMImplementation()
private static SimpleHtmlDocumentBuilder getInstance()
public Schema getSchema()
public boolean isNamespaceAware()
public boolean isValidating()
public boolean isXIncludeAware()
public SimpleHtmlDocument newDocument()
org.w3c.dom.html.HTMLDocument newPlainDocument()
public SimpleHtmlDocument parse(InputSource is)
public SimpleHtmlDocument parse(InputStream is)
public SimpleHtmlDocument parse(InputStream is, String systemId)
public SimpleHtmlDocument parse(String uri)
public SimpleHtmlDocument parse(File f)
public SimpleHtmlDocument parseString(String html)
Parse the content of the given String as an XML
document and return a new HTML DOM SimpleHtmlDocument object.
An IllegalArgumentException is thrown if the
String is null.
NOTE: this implementation requires a normal DOM parser. It is not suitable for parsing arbitrary HTML documents, even those documents which conform to the various HTML specifications. Rather, it requires a preproccesor to first clean up the HTML such that it can be parsed into a DOM.
html is nullhtml - String containing the content to be parsed. Must be valid XHTMLSimpleHtmlDocument result of parsing the
String
public void reset()
public void setEntityResolver(EntityResolver er)
public void setErrorHandler(ErrorHandler eh)
public static SimpleHtmlDocument simpleParse(InputSource is)
Parse the content of the given input source as an XML document
and return a new HTML DOM SimpleDocument object.
An IllegalArgumentException is thrown if the
InputSource is null null.
NOTE: this implementation requires a normal DOM parser. It is not suitable for parsing arbitrary HTML documents, even those documents which conform to the various HTML specifications. Rather, it requires a preproccesor to first clean up the HTML such that it can be parsed into a DOM.
is is nullis - InputSource containing the content to be parsed.
public static SimpleHtmlDocument simpleParse(InputStream in)
public static SimpleHtmlDocument simpleParse(URL url)
public static SimpleHtmlDocument simpleParse(String xml)
Parse the content of the given String as an XML
document and return a new HTML DOM SimpleHtmlDocument object.
An IllegalArgumentException is thrown if the
String is null.
NOTE: this implementation requires a normal DOM parser. It is not suitable for parsing arbitrary HTML documents, even those documents which conform to the various HTML specifications. Rather, it requires a preproccesor to first clean up the HTML such that it can be parsed into a DOM.
xml is nullxml - String containing the content to be parsed.SimpleDocument result of parsing the
String
Groovy Documentation