public class HTMLParser extends XMLParser
| Constructor and Description |
|---|
HTMLParser()
Constructs a new instance of HTMLParser
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
convertCharEntity(String charEntity)
Overrides XMLParser.convertCharEntity to add in HTML char entities
|
protected Element |
createNewElement(String name)
Overrides XMLParser.createNewElement to return an HTMLElement instance
|
protected Element |
createNewTextElement(String text)
Overrides XMLParser.createNewTextElement to return an HTMLElement instance
|
protected String |
getSupportedStandardName()
{Returns a string identifying the document type this parser supports.}
|
protected boolean |
isEmptyTag(String tagName)
Checks whether the specified tag is an empty tag as defined in EMPTY_TAGS
|
protected boolean |
isSupported(Element element)
Overrides the Element.isSupported to let the parser know which tags are supported in XHTML-MP 1.0
|
HTMLElement |
parseHTML(InputStreamReader isr)
A convenience method that casts the returned type of the parse method to HTMLElement.
|
protected void |
parseTagContent(Element element,
Reader is)
Overrides XMLParser.parseTagContent to enable embedded CSS segments (Style tags)
|
protected boolean |
shouldEvaluate(Element element)
Overrides the Element.shouldEvaluate method to return false on the script tag.
|
addCharEntitiesRange, addCharEntity, attribute, endTag, eventParser, isCaseSensitive, isWhiteSpace, notifyError, parse, parseCommentOrXMLDeclaration, parseTag, setCaseSensitive, setIncludeWhitespacesBetweenTags, setParserCallback, startTag, textElementprotected void parseTagContent(Element element, Reader is) throws IOException
parseTagContent in class XMLParserelement - The current parent elementis - The reader containing the XMLIOException - if an I/O error in the stream is encounteredprotected Element createNewElement(String name)
createNewElement in class XMLParsername - The HTMLElement's nameprotected Element createNewTextElement(String text)
createNewTextElement in class XMLParsertext - The HTMLElement's textprotected String convertCharEntity(String charEntity)
convertCharEntity in class XMLParsercharEntity - The char entity to convertprotected boolean isEmptyTag(String tagName)
isEmptyTag in class XMLParsertagName - The tag name to checkpublic HTMLElement parseHTML(InputStreamReader isr)
isr - The input stream containing the HTMLprotected String getSupportedStandardName()
getSupportedStandardName in class XMLParserprotected boolean isSupported(Element element)
isSupported in class XMLParserelement - The element to checkprotected boolean shouldEvaluate(Element element)
shouldEvaluate in class XMLParserelement - The element to check