| 1 |
package com.fasterxml.jackson.dataformat.smile.async; |
| 2 |
|
| 3 |
import java.io.IOException; |
| 4 |
|
| 5 |
import com.fasterxml.jackson.core.JsonParseException; |
| 6 |
import com.fasterxml.jackson.core.JsonToken; |
| 7 |
|
| 8 |
/** |
| 9 |
* Mix-in interface used with {@link com.fasterxml.jackson.core.JsonParser}, |
| 10 |
* extending it with features needed to process data in non-blocking |
| 11 |
* ("asynchronous") |
| 12 |
*/ |
| 13 |
public interface NonBlockingParser |
| 14 |
extends NonBlockingInputFeeder |
| 15 |
{ |
| 16 |
/** |
| 17 |
* Method that can be called when current token is not yet |
| 18 |
* available via {@link com.fasterxml.jackson.core.JsonParser#getCurrentToken}, |
| 19 |
* to try to figure out what kind of token will be eventually returned |
| 20 |
* once the whole token is decoded, if known. |
| 21 |
* Note that this may return {@link com.fasterxml.jackson.core.JsonToken#NOT_AVAILABLE}: |
| 22 |
* this occurs either if current token is known (and thus no more |
| 23 |
* parsing can be done yet), or if not enough content is available |
| 24 |
* to even determine next token type (typically we only need a single |
| 25 |
* byte, but in boundaries zero bytes is available). |
| 26 |
* |
| 27 |
* @return Token that will eventually be returned with |
| 28 |
* a call to {@link com.fasterxml.jackson.core.JsonParser#nextToken}, if known |
| 29 |
*/ |
| 30 |
public JsonToken peekNextToken() throws IOException, JsonParseException; |
| 31 |
} |