|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.lwuit.xml.XMLParser com.sun.lwuit.html.HTMLParser
public class HTMLParser
The HTMLParser class is used to parse an XHTML-MP 1.0 document into a DOM object (Element). Unsupported tags and attributes as well as comments are dropped in the parsing process. The parser is also makes use of CSSParser for external CSS files, embedded CSS segments and CSS within the 'style' attribute.
Constructor Summary | |
---|---|
HTMLParser()
Constructs a new instance of HTMLParser |
Method Summary | |
---|---|
protected java.lang.String |
convertCharEntity(java.lang.String charEntity)
Overrides XMLParser.convertCharEntity to add in HTML char entities |
protected Element |
createNewElement(java.lang.String name)
Overrides XMLParser.createNewElement to return an HTMLElement instance |
protected Element |
createNewTextElement(java.lang.String text)
Overrides XMLParser.createNewTextElement to return an HTMLElement instance |
protected java.lang.String |
getSupportedStandardName()
Returns a string identifying the document type this parser supports. |
protected boolean |
isEmptyTag(java.lang.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(java.io.InputStreamReader isr)
A convenience method that casts the returned type of the parse method to HTMLElement. |
protected void |
parseTagContent(Element element,
java.io.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. |
Methods inherited from class com.sun.lwuit.xml.XMLParser |
---|
addCharEntitiesRange, addCharEntity, attribute, endTag, eventParser, isWhiteSpace, notifyError, parse, parseCommentOrXMLDeclaration, parseTag, setIncludeWhitespacesBetweenTags, setParserCallback, startTag, textElement |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HTMLParser()
Method Detail |
---|
protected void parseTagContent(Element element, java.io.Reader is) throws java.io.IOException
parseTagContent
in class XMLParser
element
- The current parent elementis
- The reader containing the XML
java.io.IOException
- if an I/O error in the stream is encounteredprotected Element createNewElement(java.lang.String name)
createNewElement
in class XMLParser
name
- The HTMLElement's name
protected Element createNewTextElement(java.lang.String text)
createNewTextElement
in class XMLParser
text
- The HTMLElement's text
protected java.lang.String convertCharEntity(java.lang.String charEntity)
convertCharEntity
in class XMLParser
charEntity
- The char entity to convert
protected boolean isEmptyTag(java.lang.String tagName)
isEmptyTag
in class XMLParser
tagName
- The tag name to check
public HTMLElement parseHTML(java.io.InputStreamReader isr)
isr
- The input stream containing the HTML
protected java.lang.String getSupportedStandardName()
getSupportedStandardName
in class XMLParser
protected boolean isSupported(Element element)
isSupported
in class XMLParser
element
- The element to check
protected boolean shouldEvaluate(Element element)
shouldEvaluate
in class XMLParser
element
- The element to check
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |