• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package com.fasterxml.jackson.core.io;
2 
3 import com.fasterxml.jackson.core.JsonParseException;
4 import com.fasterxml.jackson.core.JsonParser;
5 import com.fasterxml.jackson.core.JsonToken;
6 
7 /**
8  * Specialized {@link JsonParseException} that is thrown when end-of-input
9  * is reached unexpectedly, either within token being decoded, or during
10  * skipping of intervening white-space that is not between root-level
11  * tokens (that is, is within JSON Object or JSON Array construct).
12  *
13  * @since 2.8
14  */
15 public class JsonEOFException extends JsonParseException
16 {
17     private static final long serialVersionUID = 1L;
18 
19     /**
20      * Type of token that was being decoded, if parser had enough information
21      * to recognize type (such as starting double-quote for Strings)
22      */
23     protected final JsonToken _token;
24 
JsonEOFException(JsonParser p, JsonToken token, String msg)25     public JsonEOFException(JsonParser p, JsonToken token, String msg) {
26         super(p, msg);
27         _token = token;
28     }
29 
30     /**
31      * Accessor for possibly available information about token that was being
32      * decoded while encountering end of input.
33      */
getTokenBeingDecoded()34     public JsonToken getTokenBeingDecoded() {
35         return _token;
36     }
37 }
38