org.eclipse.actf.model.dom.html.errorhandler
Class FormExpander
java.lang.Object
org.eclipse.actf.model.dom.html.errorhandler.FormExpander
- All Implemented Interfaces:
- IErrorHandler, IParserError
public class FormExpander
- extends Object
- implements IErrorHandler
ErrorHandler implementation for illegally closed form context. Usually to add
an error handler, you uses IParser.addErrorHandler(IErrorHandler)
.
However, this error handler conflicts with HTMLErrorHandler
installed
to parsers by default. Thus, instead of that method use addTo(IHTMLParser)
. And to remove this, use remove()
. Note: This
error handler is experimental.
Fields inherited from interface org.eclipse.actf.model.dom.html.IParserError |
ATTR_VALUE, BEFORE_ATTRNAME, BOM, DOCTYPE_MISSED, FLOATING_ENDTAG, ILLEGAL_ATTRIBUTE, ILLEGAL_CHILD, ILLEGAL_DOCTYPE, ILLEGAL_TOP_ELEMENT, MISC_ERR, STARTTAG_SYNTAX_ERR, SUDDEN_ENDTAG, TAG_NAME, UNKNOWN_ELEMENT |
Method Summary |
void |
addTo(IHTMLParser parser)
Add this error handler to parser |
boolean |
handleError(int code,
IParser parser,
Node errorNode)
Find the last FORM element and relink it to the lowest
position whereas it covers its start and end tag. |
void |
remove()
Remove this error handler from the parser. |
FormExpander
public FormExpander()
addTo
public void addTo(IHTMLParser parser)
- Add this error handler to
parser
remove
public void remove()
- Remove this error handler from the parser.
handleError
public boolean handleError(int code,
IParser parser,
Node errorNode)
throws ParseException,
IOException,
SAXException
- Find the last
FORM
element and relink it to the lowest
position whereas it covers its start and end tag.
- Specified by:
handleError
in interface IErrorHandler
- Parameters:
code
- error type.parser
- caller of this handler. This parser's state is easily changed
by the referenced methods.errorNode
- a node that causes the error.
- Returns:
true
if error was handled. Otherwise false
.
- Throws:
ParseException
IOException
SAXException
- See Also:
IParser.getNode()
,
IParser.pushBackNode(org.w3c.dom.Node)
,
IParser.getExtraErrInfo()
,
IParser.getContext()
,
IParser.setContext(org.w3c.dom.Element)