Class Parser

All Implemented Interfaces:
ScanHandler, ContentHandler, DTDHandler, EntityResolver, ErrorHandler, LexicalHandler, XMLReader

public class Parser extends DefaultHandler implements ScanHandler, XMLReader, LexicalHandler
The SAX parser class.
  • Field Details

    • namespacesFeature

      public static final String namespacesFeature
      A value of "true" indicates namespace URIs and unprefixed local names for element and attribute names will be available.
      See Also:
    • namespacePrefixesFeature

      public static final String namespacePrefixesFeature
      A value of "true" indicates that XML qualified names (with prefixes) and attributes (including xmlns* attributes) will be available. We don't support this value.
      See Also:
    • externalGeneralEntitiesFeature

      public static final String externalGeneralEntitiesFeature
      Reports whether this parser processes external general entities (it doesn't).
      See Also:
    • externalParameterEntitiesFeature

      public static final String externalParameterEntitiesFeature
      Reports whether this parser processes external parameter entities (it doesn't).
      See Also:
    • isStandaloneFeature

      public static final String isStandaloneFeature
      May be examined only during a parse, after the startDocument() callback has been completed; read-only. The value is true if the document specified standalone="yes" in its XML declaration, and otherwise is false. (It's always false.)
      See Also:
    • lexicalHandlerParameterEntitiesFeature

      public static final String lexicalHandlerParameterEntitiesFeature
      A value of "true" indicates that the LexicalHandler will report the beginning and end of parameter entities (it won't).
      See Also:
    • resolveDTDURIsFeature

      public static final String resolveDTDURIsFeature
      A value of "true" indicates that system IDs in declarations will be absolutized (relative to their base URIs) before reporting. (This returns true but doesn't actually do anything.)
      See Also:
    • stringInterningFeature

      public static final String stringInterningFeature
      Has a value of "true" if all XML names (for elements, prefixes, attributes, entities, notations, and local names), as well as Namespace URIs, will have been interned using java.lang.String.intern. This supports fast testing of equality/inequality against string constants, rather than forcing slower calls to String.equals(). (We always intern.)
      See Also:
    • useAttributes2Feature

      public static final String useAttributes2Feature
      Returns "true" if the Attributes objects passed by this parser in ContentHandler.startElement() implement the org.xml.sax.ext.Attributes2 interface. (They don't.)
      See Also:
    • useLocator2Feature

      public static final String useLocator2Feature
      Returns "true" if the Locator objects passed by this parser in ContentHandler.setDocumentLocator() implement the org.xml.sax.ext.Locator2 interface. (They don't.)
      See Also:
    • useEntityResolver2Feature

      public static final String useEntityResolver2Feature
      Returns "true" if, when setEntityResolver is given an object implementing the org.xml.sax.ext.EntityResolver2 interface, those new methods will be used. (They won't be.)
      See Also:
    • validationFeature

      public static final String validationFeature
      Controls whether the parser is reporting all validity errors (We don't report any validity errors.)
      See Also:
    • unicodeNormalizationCheckingFeature

      public static final String unicodeNormalizationCheckingFeature
      Controls whether the parser reports Unicode normalization errors as described in section 2.13 and Appendix B of the XML 1.1 Recommendation. (We don't normalize.)
      See Also:
    • xmlnsURIsFeature

      public static final String xmlnsURIsFeature
      Controls whether, when the namespace-prefixes feature is set, the parser treats namespace declaration attributes as being in the http://www.w3.org/2000/xmlns/ namespace. (It doesn't.)
      See Also:
    • XML11Feature

      public static final String XML11Feature
      Returns "true" if the parser supports both XML 1.1 and XML 1.0. (Always false.)
      See Also:
    • ignoreBogonsFeature

      public static final String ignoreBogonsFeature
      A value of "true" indicates that the parser will ignore unknown elements.
      See Also:
    • bogonsEmptyFeature

      public static final String bogonsEmptyFeature
      A value of "true" indicates that the parser will give unknown elements a content model of EMPTY; a value of "false", a content model of ANY.
      See Also:
    • rootBogonsFeature

      public static final String rootBogonsFeature
      A value of "true" indicates that the parser will allow unknown elements to be the root element.
      See Also:
    • defaultAttributesFeature

      public static final String defaultAttributesFeature
      A value of "true" indicates that the parser will return default attribute values for missing attributes that have default values.
      See Also:
    • translateColonsFeature

      public static final String translateColonsFeature
      A value of "true" indicates that the parser will translate colons into underscores in names.
      See Also:
    • restartElementsFeature

      public static final String restartElementsFeature
      A value of "true" indicates that the parser will attempt to restart the restartable elements.
      See Also:
    • ignorableWhitespaceFeature

      public static final String ignorableWhitespaceFeature
      A value of "true" indicates that the parser will transmit whitespace in element-only content via the SAX ignorableWhitespace callback. Normally this is not done, because HTML is an SGML application and SGML suppresses such whitespace.
      See Also:
    • CDATAElementsFeature

      public static final String CDATAElementsFeature
      A value of "true" indicates that the parser will treat CDATA elements specially. Normally true, since the input is by default HTML.
      See Also:
    • lexicalHandlerProperty

      public static final String lexicalHandlerProperty
      Used to see some syntax events that are essential in some applications: comments, CDATA delimiters, selected general entity inclusions, and the start and end of the DTD (and declaration of document element name). The Object must implement org.xml.sax.ext.LexicalHandler.
      See Also:
    • scannerProperty

      public static final String scannerProperty
      Specifies the Scanner object this Parser uses.
      See Also:
    • schemaProperty

      public static final String schemaProperty
      Specifies the Schema object this Parser uses.
      See Also:
    • autoDetectorProperty

      public static final String autoDetectorProperty
      Specifies the AutoDetector (for encoding detection) this Parser uses.
      See Also:
  • Constructor Details

    • Parser

      public Parser()
  • Method Details