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

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Error code denoting that an invalid attribute value was found in the XML
    static final int
    Error code denoting that an unsupported attribute was found in the XML
    static final int
    Error 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
    static final int
    Error code denoting that the document had more than one root element
    static final int
    Error code denoting that a tag was not closed properly in the XML
    static final int
    Error code denoting that the document had no root element at all (empty document or seriously malformed XML)
    static final int
    Error code denoting that an unsupported tag was found in the XML
    static final int
    Error code denoting that the parser bumped into an unexpected character
    static final int
    Error code denoting that a tag was not closed prematurely
    static final int
    Error 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 Type
    Method
    Description
    boolean
    parsingError(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_SUPPORTED
      Error code denoting that an unsupported tag was found in the XML
      See Also:
    • ERROR_ATTRIBUTE_NOT_SUPPORTED

      static final int ERROR_ATTRIBUTE_NOT_SUPPORTED
      Error code denoting that an unsupported attribute was found in the XML
      See Also:
    • ERROR_ATTIBUTE_VALUE_INVALID

      static final int ERROR_ATTIBUTE_VALUE_INVALID
      Error code denoting that an invalid attribute value was found in the XML
      See Also:
    • ERROR_NO_CLOSE_TAG

      static final int ERROR_NO_CLOSE_TAG
      Error code denoting that a tag was not closed properly in the XML
      See Also:
    • ERROR_UNRECOGNIZED_CHAR_ENTITY

      static final int ERROR_UNRECOGNIZED_CHAR_ENTITY
      Error 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_CLOSING
      Error code denoting that a tag was not closed prematurely
      See Also:
    • ERROR_UNEXPECTED_CHARACTER

      static final int ERROR_UNEXPECTED_CHARACTER
      Error code denoting that the parser bumped into an unexpected character
      See Also:
    • ERROR_MULTIPLE_ROOTS

      static final int ERROR_MULTIPLE_ROOTS
      Error code denoting that the document had more than one root element
      See Also:
    • ERROR_NO_ROOTS

      static final int ERROR_NO_ROOTS
      Error 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_ENCODING
      Error 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

      boolean parsingError(int errorId, String tag, String attribute, String value, String description)

      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