Package org.codehaus.jackson.impl
Class ReaderBasedParserBase
- java.lang.Object
-
- org.codehaus.jackson.JsonParser
-
- org.codehaus.jackson.impl.JsonParserMinimalBase
-
- org.codehaus.jackson.impl.JsonParserBase
-
- org.codehaus.jackson.impl.ReaderBasedParserBase
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.codehaus.jackson.JsonParser
JsonParser.Feature, JsonParser.NumberType
-
-
Field Summary
Fields Modifier and Type Field Description protected char[]
_inputBuffer
Deprecated.Current buffer from which data is read; generally data is read into buffer from input source.protected java.io.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.-
Fields inherited from class org.codehaus.jackson.impl.JsonParserBase
_binaryValue, _byteArrayBuilder, _closed, _currInputProcessed, _currInputRow, _currInputRowStart, _expLength, _fractLength, _inputEnd, _inputPtr, _intLength, _ioContext, _nameCopied, _nameCopyBuffer, _nextToken, _numberBigDecimal, _numberBigInt, _numberDouble, _numberInt, _numberLong, _numberNegative, _numTypesValid, _parsingContext, _textBuffer, _tokenInputCol, _tokenInputRow, _tokenInputTotal, CHAR_NULL, INT_0, INT_1, INT_2, INT_3, INT_4, INT_5, INT_6, INT_7, INT_8, INT_9, INT_DECIMAL_POINT, INT_e, INT_E, INT_MINUS, INT_PLUS, NR_BIGDECIMAL, NR_BIGINT, NR_DOUBLE, NR_INT, NR_LONG, NR_UNKNOWN
-
Fields inherited from class org.codehaus.jackson.impl.JsonParserMinimalBase
INT_APOSTROPHE, INT_ASTERISK, INT_b, INT_BACKSLASH, INT_COLON, INT_COMMA, INT_CR, INT_f, INT_LBRACKET, INT_LCURLY, INT_LF, INT_n, INT_QUOTE, INT_r, INT_RBRACKET, INT_RCURLY, INT_SLASH, INT_SPACE, INT_t, INT_TAB, INT_u
-
Fields inherited from class org.codehaus.jackson.JsonParser
_currToken, _features, _lastClearedToken
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ReaderBasedParserBase(IOContext ctxt, int features, java.io.Reader r)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
_closeInput()
Deprecated.protected boolean
_matchToken(java.lang.String matchStr, int i)
Deprecated.Helper method for checking whether input matches expected tokenprotected void
_releaseBuffers()
Deprecated.Method called to release internal buffers owned by the base reader.protected void
_reportInvalidToken(java.lang.String matchedPart, java.lang.String msg)
Deprecated.java.lang.Object
getInputSource()
Deprecated.Method that can be used to get access to object that is used to access input being parsed; this is usually eitherInputStream
orReader
, depending on what parser was constructed with.protected char
getNextChar(java.lang.String eofMsg)
Deprecated.protected boolean
loadMore()
Deprecated.int
releaseBuffered(java.io.Writer w)
Deprecated.Method that can be called to push back any content that has been read but not consumed by the parser.-
Methods inherited from class org.codehaus.jackson.impl.JsonParserBase
_decodeBase64Escape, _decodeBase64Escape, _decodeEscaped, _finishString, _getByteArrayBuilder, _handleEOF, _parseNumericValue, _reportMismatchedEndMarker, close, convertNumberToBigDecimal, convertNumberToBigInteger, convertNumberToDouble, convertNumberToInt, convertNumberToLong, getBigIntegerValue, getCurrentLocation, getCurrentName, getDecimalValue, getDoubleValue, getFloatValue, getIntValue, getLongValue, getNumberType, getNumberValue, getParsingContext, getTokenCharacterOffset, getTokenColumnNr, getTokenLineNr, getTokenLocation, hasTextCharacters, isClosed, loadMoreGuaranteed, reportInvalidBase64Char, reportInvalidBase64Char, reportInvalidNumber, reportOverflowInt, reportOverflowLong, reportUnexpectedNumberChar, reset, resetAsNaN, resetFloat, resetInt, version
-
Methods inherited from class org.codehaus.jackson.impl.JsonParserMinimalBase
_constructError, _decodeBase64, _getCharDesc, _handleUnrecognizedCharacterEscape, _reportBase64EOF, _reportError, _reportInvalidBase64, _reportInvalidEOF, _reportInvalidEOF, _reportInvalidEOFInValue, _reportUnexpectedChar, _throwInternal, _throwInvalidSpace, _throwUnquotedSpace, _wrapError, getBinaryValue, getText, getTextCharacters, getTextLength, getTextOffset, getValueAsBoolean, getValueAsDouble, getValueAsInt, getValueAsLong, nextToken, skipChildren
-
Methods inherited from class org.codehaus.jackson.JsonParser
_constructError, canUseSchema, clearCurrentToken, configure, disable, disableFeature, enable, enableFeature, getBinaryValue, getBooleanValue, getByteValue, getCodec, getCurrentToken, getEmbeddedObject, getLastClearedToken, getShortValue, getValueAsBoolean, getValueAsDouble, getValueAsInt, getValueAsLong, hasCurrentToken, isEnabled, isExpectedStartArrayToken, isFeatureEnabled, nextBooleanValue, nextFieldName, nextIntValue, nextLongValue, nextTextValue, nextValue, readValueAs, readValueAs, readValueAsTree, readValuesAs, readValuesAs, releaseBuffered, setCodec, setFeature, setSchema
-
-
-
-
Field Detail
-
_reader
protected java.io.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, java.io.Reader r)
Deprecated.
-
-
Method Detail
-
releaseBuffered
public int releaseBuffered(java.io.Writer w) throws java.io.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 classJsonParser
- 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:
java.io.IOException
- if write using Writer threw exception
-
getInputSource
public java.lang.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 eitherInputStream
orReader
, 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 classJsonParser
-
loadMore
protected final boolean loadMore() throws java.io.IOException
Deprecated.- Specified by:
loadMore
in classJsonParserBase
- Throws:
java.io.IOException
-
getNextChar
protected char getNextChar(java.lang.String eofMsg) throws java.io.IOException, JsonParseException
Deprecated.- Throws:
java.io.IOException
JsonParseException
-
_closeInput
protected void _closeInput() throws java.io.IOException
Deprecated.- Specified by:
_closeInput
in classJsonParserBase
- Throws:
java.io.IOException
-
_releaseBuffers
protected void _releaseBuffers() throws java.io.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 classJsonParserBase
- Throws:
java.io.IOException
-
_matchToken
protected final boolean _matchToken(java.lang.String matchStr, int i) throws java.io.IOException, JsonParseException
Deprecated.Helper method for checking whether input matches expected token- Throws:
java.io.IOException
JsonParseException
- Since:
- 1.8
-
_reportInvalidToken
protected void _reportInvalidToken(java.lang.String matchedPart, java.lang.String msg) throws java.io.IOException, JsonParseException
Deprecated.- Throws:
java.io.IOException
JsonParseException
-
-