Interface ParserCallback
- All Known Subinterfaces:
HTMLCallback
- All Known Implementing Classes:
Ads, DefaultHTMLCallback, RSSService
public interface ParserCallback
A callback used to dispatch errors encountered while parsing XML resources
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intError code denoting that an invalid attribute value was found in the XMLstatic final intError code denoting that an unsupported attribute was found in the XMLstatic final intError code denoting that the encoding the page needed according to its charset (usually specified in the content-type response header) is unsupported in the devicestatic final intError code denoting that the document had more than one root elementstatic final intError code denoting that a tag was not closed properly in the XMLstatic final intError code denoting that the document had no root element at all (empty document or seriously malformed XML)static final intError code denoting that an unsupported tag was found in the XMLstatic final intError code denoting that the parser bumped into an unexpected characterstatic final intError code denoting that a tag was not closed prematurelystatic final intError code denoting that an invalid character entity was found A character entity is XML codes that start with an ampersand and end with semicolon and denote special/reserved chars -
Method Summary
Modifier and TypeMethodDescriptionbooleanparsingError(int errorId, String tag, String attribute, String value, String description) Called when encountering an error while parsing the XML document.
-
Field Details
-
ERROR_TAG_NOT_SUPPORTED
static final int ERROR_TAG_NOT_SUPPORTEDError code denoting that an unsupported tag was found in the XML- See Also:
-
ERROR_ATTRIBUTE_NOT_SUPPORTED
static final int ERROR_ATTRIBUTE_NOT_SUPPORTEDError code denoting that an unsupported attribute was found in the XML- See Also:
-
ERROR_ATTIBUTE_VALUE_INVALID
static final int ERROR_ATTIBUTE_VALUE_INVALIDError code denoting that an invalid attribute value was found in the XML- See Also:
-
ERROR_NO_CLOSE_TAG
static final int ERROR_NO_CLOSE_TAGError code denoting that a tag was not closed properly in the XML- See Also:
-
ERROR_UNRECOGNIZED_CHAR_ENTITY
static final int ERROR_UNRECOGNIZED_CHAR_ENTITYError code denoting that an invalid character entity was found A character entity is XML codes that start with an ampersand and end with semicolon and denote special/reserved chars- See Also:
-
ERROR_UNEXPECTED_TAG_CLOSING
static final int ERROR_UNEXPECTED_TAG_CLOSINGError code denoting that a tag was not closed prematurely- See Also:
-
ERROR_UNEXPECTED_CHARACTER
static final int ERROR_UNEXPECTED_CHARACTERError code denoting that the parser bumped into an unexpected character- See Also:
-
ERROR_MULTIPLE_ROOTS
static final int ERROR_MULTIPLE_ROOTSError code denoting that the document had more than one root element- See Also:
-
ERROR_NO_ROOTS
static final int ERROR_NO_ROOTSError code denoting that the document had no root element at all (empty document or seriously malformed XML)- See Also:
-
ERROR_ENCODING
static final int ERROR_ENCODINGError code denoting that the encoding the page needed according to its charset (usually specified in the content-type response header) is unsupported in the device- See Also:
-
-
Method Details
-
parsingError
Called when encountering an error while parsing the XML document. When implementing this, the developer should return true if the error should be ignored and the document needs to be further parsed, or false to stop parsing and issue an error to the user Note that this method is always called NOT on the EDT thread.
Parameters
-
errorId: The error ID, one of the ERROR_* constants -
tag: The tag in which the error occured (Can be null for non-tag related errors) -
attribute: The attribute in which the error occured (Can be null for non-attribute related errors) -
value: The value in which the error occured (Can be null for non-value related errors) -
description: A verbal description of the error
Returns
true to continue parsing, false to stop
-
-