protected JsonToken _handleUnexpectedValue ( int i ) throws IOException , JsonParseException { // Most likely an error, unless we are to allow single-quote-strings switch ( i ) { case ' ' : _matchToken ( "NaN" , 1 ) ; if ( isEnabled ( JsonParser . Feature . ALLOW_NON_NUMERIC_NUMBERS ) ) { return resetAsNaN ( "NaN" , Double . NaN ) ; } _reportError ( "Non-standard token 'NaN': enable JsonParser.Feature.ALLOW_NON_NUMERIC_NUMBERS to allow" ) ; break ; case ' ' : // note: '-' is taken as number if ( _inputPtr >= _inputEnd ) { if ( ! loadMore ( ) ) { _reportInvalidEOFInValue ( ) ; } } return _handleInvalidNumberStart ( _inputBuffer [ _inputPtr ++ ] , false ) ; } _reportUnexpectedChar ( i , "expected a valid value (number, String, array, object, 'true', 'false' or 'null')" ) ; return null ; }
Method for handling cases where first non - space character of an expected value token is not legal for standard JSON content .