Class ByteBasedScanner

  • All Implemented Interfaces:
    XmlConsts, javax.xml.namespace.NamespaceContext, javax.xml.stream.XMLStreamConstants
    Direct Known Subclasses:
    AsyncByteScanner, StreamScanner

    public abstract class ByteBasedScanner
    extends XmlScanner
    Intermediate base class used by different byte-backed scanners. Specifically, used as a base by both blocking (stream) and non-blocking (async) byte-based scanners (as opposed to Reader-backed, character-based scanners)
    • Constructor Detail

      • ByteBasedScanner

        protected ByteBasedScanner​(ReaderConfig cfg)
    • Method Detail

      • _closeSource

        protected abstract void _closeSource()
                                      throws java.io.IOException
        Specified by:
        _closeSource in class XmlScanner
        Throws:
        java.io.IOException
      • getCurrentLocation

        public org.codehaus.stax2.XMLStreamLocation2 getCurrentLocation()
        Specified by:
        getCurrentLocation in class XmlScanner
        Returns:
        Current input location
      • getEndingByteOffset

        public long getEndingByteOffset()
                                 throws javax.xml.stream.XMLStreamException
        Specified by:
        getEndingByteOffset in class XmlScanner
        Throws:
        javax.xml.stream.XMLStreamException
      • getEndingCharOffset

        public long getEndingCharOffset()
                                 throws javax.xml.stream.XMLStreamException
        Specified by:
        getEndingCharOffset in class XmlScanner
        Throws:
        javax.xml.stream.XMLStreamException
      • markLF

        protected final void markLF​(int offset)
      • markLF

        protected final void markLF()
      • setStartLocation

        protected final void setStartLocation()
      • decodeCharForError

        protected abstract int decodeCharForError​(byte b)
                                           throws javax.xml.stream.XMLStreamException
        Method called by methods when encountering a byte that can not be part of a valid character in the current context. Should return the actual decoded character for error reporting purposes.
        Throws:
        javax.xml.stream.XMLStreamException
      • addUTFPName

        protected final PName addUTFPName​(ByteBasedPNameTable symbols,
                                          XmlCharTypes charTypes,
                                          int hash,
                                          int[] quads,
                                          int qlen,
                                          int lastQuadBytes)
                                   throws javax.xml.stream.XMLStreamException
        Conceptually, this method really does NOT belong here. However, currently it is quite hard to refactor it, so it'll have to stay here until better place is found
        Throws:
        javax.xml.stream.XMLStreamException
      • reportInvalidInitial

        protected void reportInvalidInitial​(int mask)
                                     throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException
      • reportInvalidOther

        protected void reportInvalidOther​(int mask)
                                   throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException