XmlErrorHandlerpublic class XmlErrorHandler extends DefaultHandler XML error handler used by the parser to report errors/warnings. |
Fields Summary |
---|
private org.eclipse.core.resources.IFile | mFilefile being parsed | private XmlErrorListener | mErrorListenerlink to the delta visitor, to set the xml error flag |
Methods Summary |
---|
public void | error(org.xml.sax.SAXParseException exception)Xml Error call back
handleError(exception, exception.getLineNumber());
| public void | fatalError(org.xml.sax.SAXParseException exception)Xml Fatal Error call back
handleError(exception, exception.getLineNumber());
| protected final org.eclipse.core.resources.IFile | getFile()
return mFile;
| protected void | handleError(java.lang.Exception exception, int lineNumber)Handles a parsing error and an optional line number.
if (mErrorListener != null) {
mErrorListener.errorFound();
}
if (mFile != null) {
if (lineNumber != -1) {
BaseProjectHelper.addMarker(mFile,
AndroidConstants.MARKER_XML,
exception.getMessage(),
lineNumber,
IMarker.SEVERITY_ERROR);
} else {
BaseProjectHelper.addMarker(mFile,
AndroidConstants.MARKER_XML,
exception.getMessage(),
IMarker.SEVERITY_ERROR);
}
}
| public void | warning(org.xml.sax.SAXParseException exception)Xml Warning call back
if (mFile != null) {
BaseProjectHelper.addMarker(mFile,
AndroidConstants.MARKER_XML,
exception.getMessage(),
exception.getLineNumber(),
IMarker.SEVERITY_WARNING);
}
|
|