Class ReaderBasedParserBase

  • All Implemented Interfaces:
    Closeable, AutoCloseable, Versioned

    @Deprecated
    public abstract class ReaderBasedParserBase
    extends JsonParserBase
    Deprecated.
    Since 1.9 sub-classes should just include code from here as is.
    This is a simple low-level input reader base class, used by JSON parser. The reason for sub-classing (over composition) is due to need for direct access to character buffers and positions.
    Author:
    Tatu Saloranta
    • Field Detail

      • _reader

        protected Reader _reader
        Deprecated.
        Reader that can be used for reading more content, if one buffer from input source, but in some cases pre-loaded buffer is handed to the parser.
      • _inputBuffer

        protected char[] _inputBuffer
        Deprecated.
        Current buffer from which data is read; generally data is read into buffer from input source.
    • Constructor Detail

      • ReaderBasedParserBase

        protected ReaderBasedParserBase​(IOContext ctxt,
                                        int features,
                                        Reader r)
        Deprecated.
    • Method Detail

      • releaseBuffered

        public int releaseBuffered​(Writer w)
                            throws IOException
        Deprecated.
        Description copied from class: JsonParser
        Method that can be called to push back any content that has been read but not consumed by the parser. This is usually done after reading all content of interest using parser. Content is released by writing it to given writer if possible; if underlying input is char-based it can released, if not (byte-based) it can not.
        Overrides:
        releaseBuffered in class JsonParser
        Returns:
        -1 if the underlying content source is not char-based (that is, input can not be sent to Writer; otherwise number of chars released (0 if there was nothing to release)
        Throws:
        IOException - if write using Writer threw exception
      • getInputSource

        public Object getInputSource()
        Deprecated.
        Description copied from class: JsonParser
        Method that can be used to get access to object that is used to access input being parsed; this is usually either InputStream or Reader, depending on what parser was constructed with. Note that returned value may be null in some cases; including case where parser implementation does not want to exposed raw source to caller. In cases where input has been decorated, object returned here is the decorated version; this allows some level of interaction between users of parser and decorator object.

        In general use of this accessor should be considered as "last effort", i.e. only used if no other mechanism is applicable.

        Overrides:
        getInputSource in class JsonParser
      • _releaseBuffers

        protected void _releaseBuffers()
                                throws IOException
        Deprecated.
        Method called to release internal buffers owned by the base reader. This may be called along with _closeInput() (for example, when explicitly closing this reader instance), or separately (if need be).
        Overrides:
        _releaseBuffers in class JsonParserBase
        Throws:
        IOException