Class SAXFilter

java.lang.Object
org.eclipse.rdf4j.rio.rdfxml.SAXFilter
All Implemented Interfaces:
ContentHandler

class SAXFilter extends Object implements ContentHandler
A filter on SAX events to make life easier on the RDF parser itself. This filter does things like combining a call to startElement() that is directly followed by a call to endElement() to a single call to emptyElement().
  • Field Details

    • rdfParser

      private final RDFXMLParser rdfParser
      The RDF parser to supply the filtered SAX events to.
    • locator

      private Locator locator
      A Locator indicating a position in the text that is currently being parsed by the SAX parser.
    • elInfoStack

      private final Stack<SAXFilter.ElementInfo> elInfoStack
      Stack of ElementInfo objects.
    • charBuf

      private final StringBuilder charBuf
      StringBuilder used to collect text during parsing.
    • documentURI

      private ParsedIRI documentURI
      The document's URI.
    • parseStandAloneDocuments

      private boolean parseStandAloneDocuments
      Flag indicating whether the parser parses stand-alone RDF documents. In stand-alone documents, the rdf:RDF element is optional if it contains just one element.
    • deferredElement

      private SAXFilter.ElementInfo deferredElement
      Variable used to defer reporting of start tags. Reporting start tags is deferred to be able to combine a start tag and an immediately following end tag to a single call to emptyElement().
    • newNamespaceMappings

      private final Map<String,String> newNamespaceMappings
      New namespace mappings that have been reported for the next start tag by the SAX parser, but that are not yet assigned to an ElementInfo object.
    • inRDFContext

      private boolean inRDFContext
      Flag indicating whether we're currently parsing RDF elements.
    • rdfContextStackHeight

      private int rdfContextStackHeight
      The number of elements on the stack that are in the RDF context.
    • parseLiteralMode

      private boolean parseLiteralMode
      Flag indicating whether we're currently parsing an XML literal.
    • xmlLiteralStackHeight

      private int xmlLiteralStackHeight
      The number of elements on the stack that are part of an XML literal.
    • xmlLiteralPrefixes

      private final List<String> xmlLiteralPrefixes
      The prefixes that are defined in the XML literal itself (this in contrast to the namespaces from the XML literal's context).
    • unknownPrefixesInXMLLiteral

      private final List<String> unknownPrefixesInXMLLiteral
      The prefixes that were used in an XML literal, but that were not defined in it (but rather in the XML literal's context).
  • Constructor Details

  • Method Details