org.eclipse.actf.model.dom.html
Interface IHTMLParser

All Superinterfaces:
IParser

public interface IHTMLParser
extends IParser


Field Summary
 
Fields inherited from interface org.eclipse.actf.model.dom.html.IParser
LOWER_CASE, ORIGINAL_CASE, UPPER_CASE
 
Method Summary
 String getEncoding()
          Character Encoding parsed a document with.
 Node parse(InputStream is)
          Parses an HTML document and return its top element.
 Node parse(InputStream is, String charEncoding)
          Parses a HTML document and return its top element.
 Node parseSwitchEnc(InputStream is)
          Parses a HTML document and return its top element.
 Node parseSwitchEnc(InputStream is, String defaultEncoding)
          Parses a HTML document and return its top element.
 
Methods inherited from interface org.eclipse.actf.model.dom.html.IParser
addErrorHandler, addErrorLogListener, autoGenerated, changeDefaultTagCase, elementHandle, error, getContext, getContextElements, getDocument, getErrorHandlers, getExtraErrInfo, getNode, getPushbackBufferSize, hasEndTag, keepUnknownElements, pushBackNode, reopenContext, setAttrNameCase, setContext, setCurrentNode, setDefaultTagCase, setDocumentHandler, setHasEndTag, setTagCase
 

Method Detail

parse

Node parse(InputStream is)
           throws ParseException,
                  IOException,
                  SAXException
Parses an HTML document and return its top element.

Parameters:
is - target InputStream to parse with default encoding. The InputStream will be closed after parsing.
Returns:
Top element.
Throws:
PaserException - If unrecoverable syntax or token error occurred, thrown
IOException
ParseException
SAXException

parse

Node parse(InputStream is,
           String charEncoding)
           throws SAXException,
                  ParseException,
                  IOException
Parses a HTML document and return its top element.

Parameters:
is - target InputStream to parse. The InputStream will be closed after parsing.
charEncoding - encoding used for parse
Returns:
Top element.
Throws:
PaserException - If unrecoverable syntax or token error occurred, thrown
IOException
SAXException
ParseException

parseSwitchEnc

Node parseSwitchEnc(InputStream is)
                    throws ParseException,
                           IOException,
                           SAXException
Parses a HTML document and return its top element. This method is almost same as parse(InputStream). If it meets <META http-equiv="Content-Type" content="text/html; charset=xxx"> tag in a document, it tries to change encoding to xxx.

Parameters:
is - target InputStream to parse. The InputStream will be closed after parsing.
Returns:
Top element.
Throws:
PaserException - If unrecoverable syntax or token error occurred, thrown
IOException
ParseException
SAXException

parseSwitchEnc

Node parseSwitchEnc(InputStream is,
                    String defaultEncoding)
                    throws SAXException,
                           ParseException,
                           IOException
Parses a HTML document and return its top element. This method is the same as parse(InputStream,String) If it meets <META http-equiv="Content-Type" content="text/html; charset=xxx"> tag in a document, it tries to change encoding to xxx.

Parameters:
is - target InputStream to parse. The InputStream will be closed after parsing.
defaultEncoding - default encoding before switching encoding.
Returns:
Top element.
Throws:
PaserException - If unrecoverable syntax or token error occurred, thrown
IOException
SAXException
ParseException

getEncoding

String getEncoding()
Character Encoding parsed a document with.

Returns:
If null parsed a document with default encoding.