org.eclipse.rdf4j.rio.helpers

## Class XMLReaderBasedParser

- java.lang.Object
- - org.eclipse.rdf4j.rio.helpers.AbstractRDFParser
  - - org.eclipse.rdf4j.rio.helpers.XMLReaderBasedParser

- All Implemented Interfaces:
    RDFParser
  Direct Known Subclasses:
    RDFXMLParser, TriXParser

      public abstract class XMLReaderBasedParser
      extends AbstractRDFParser

  Base class for Rio parsers that are based on a SAX `XMLReader`.
  Author:
    Jeen Broekstra

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.eclipse.rdf4j.rio.RDFParser

      `RDFParser.DatatypeHandling`

  - ### Field Summary

    - ### Fields inherited from class org.eclipse.rdf4j.rio.helpers.AbstractRDFParser

      `rdfHandler, valueFactory`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `XMLReaderBasedParser(ValueFactory f)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Collection<RioSetting<Boolean>>` | `getCompulsoryXmlFeatureSettings()` Returns a collection of settings that will always be set as XML parser features using `XMLReader.setFeature(String, boolean)`.
    `Collection<RioSetting<?>>` | `getCompulsoryXmlPropertySettings()` Returns a collection of settings that will always be set as XML parser properties using `XMLReader.setProperty(String, Object)`
    `Collection<RioSetting<Boolean>>` | `getOptionalXmlFeatureSettings()` Returns a collection of settings that will be used, if set in `AbstractRDFParser.getParserConfig()`, as XML parser features using `XMLReader.setFeature(String, boolean)`.
    `Collection<RioSetting<?>>` | `getOptionalXmlPropertySettings()` Returns a collection of settings that will be used, if set in `AbstractRDFParser.getParserConfig()`, as XML parser properties using `XMLReader.setProperty(String, Object)`
    `protected XMLReader` | `getXMLReader()` Creates an XML Reader configured using the current parser settings.

    - ### Methods inherited from class org.eclipse.rdf4j.rio.helpers.AbstractRDFParser

      `clear, clearBNodeIDMap, createBNode, createBNode, createLiteral, createLiteral, createNode, createNode, createStatement, createStatement, createURI, datatypeHandling, getNamespace, getParseErrorListener, getParseLocationListener, getParserConfig, getRDFHandler, getSupportedSettings, initializeNamespaceTableFromConfiguration, preserveBNodeIDs, reportError, reportError, reportError, reportError, reportError, reportFatalError, reportFatalError, reportFatalError, reportFatalError, reportFatalError, reportLocation, reportWarning, reportWarning, resolveURI, set, setBaseURI, setBaseURI, setDatatypeHandling, setNamespace, setParseErrorListener, setParseLocationListener, setParserConfig, setPreserveBNodeIDs, setRDFHandler, setStopAtFirstError, setValueFactory, setVerifyData, stopAtFirstError, verifyData`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.eclipse.rdf4j.rio.RDFParser

      `getRDFFormat, parse, parse, parse, parse`

- - ### Constructor Detail

    - #### XMLReaderBasedParser

          protected XMLReaderBasedParser(ValueFactory f)

  - ### Method Detail

    - #### getCompulsoryXmlPropertySettings

          public Collection<RioSetting<?>> getCompulsoryXmlPropertySettings()

      Returns a collection of settings that will always be set as XML parser properties using `XMLReader.setProperty(String, Object)`

      Subclasses can override this to specify more supported settings.

      Returns:
        A collection of `RioSetting`s that indicate which properties will always be setup using `XMLReader.setProperty(String, Object)`.

    - #### getCompulsoryXmlFeatureSettings

          public Collection<RioSetting<Boolean>> getCompulsoryXmlFeatureSettings()

      Returns a collection of settings that will always be set as XML parser features using `XMLReader.setFeature(String, boolean)`.

      Subclasses can override this to specify more supported settings.

      Returns:
        A collection of `RioSetting`s that indicate which boolean settings will always be setup using `XMLReader.setFeature(String, boolean)`.

    - #### getOptionalXmlPropertySettings

          public Collection<RioSetting<?>> getOptionalXmlPropertySettings()

      Returns a collection of settings that will be used, if set in `AbstractRDFParser.getParserConfig()`, as XML parser properties using `XMLReader.setProperty(String, Object)`

      Subclasses can override this to specify more supported settings.

      Returns:
        A collection of `RioSetting`s that indicate which properties can be setup using `XMLReader.setProperty(String, Object)`.

    - #### getOptionalXmlFeatureSettings

          public Collection<RioSetting<Boolean>> getOptionalXmlFeatureSettings()

      Returns a collection of settings that will be used, if set in `AbstractRDFParser.getParserConfig()`, as XML parser features using `XMLReader.setFeature(String, boolean)`.

      Subclasses can override this to specify more supported settings.

      Returns:
        A collection of `RioSetting`s that indicate which boolean settings can be setup using `XMLReader.setFeature(String, boolean)`.

    - #### getXMLReader

          protected XMLReader getXMLReader()
                                    throws SAXException

      Creates an XML Reader configured using the current parser settings.
      Returns:
        a configured `XMLReader`
      Throws:
        `SAXException` - if an error occurs during configuration.

Copyright © 2015-2021 Eclipse Foundation. All Rights Reserved.