• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package com.fasterxml.jackson.core.async;
2 
3 /**
4  * Interface used by non-blocking {@link com.fasterxml.jackson.core.JsonParser}
5  * implementations to feed input to parse.
6  * Feeder is used by entity that feeds content to parse; at any given point
7  * only one chunk of content can be processed so caller has to take care to
8  * only feed more content when existing content has been parsed (which occurs
9  * when parser's <code>nextToken</code> is called). Once application using
10  * non-blocking parser has no more data to feed it should call
11  * {@link #endOfInput} to indicate end of logical input (stream) to parse.
12  *
13  * @since 2.9
14  */
15 public interface NonBlockingInputFeeder
16 {
17     /**
18      * Method called to check whether it is ok to feed more data: parser returns true
19      * if it has no more content to parse (and it is ok to feed more); otherwise false
20      * (and no data should yet be fed).
21      */
needMoreInput()22     public boolean needMoreInput();
23 
24     /**
25      * Method that should be called after last chunk of data to parse has been fed
26      * (with <code>feedInput</code> in sub-class); can be called regardless of what {@link #needMoreInput}
27      * returns. After calling this method, no more data can be fed; and parser assumes
28      * no more data will be available.
29      */
endOfInput()30     public void endOfInput();
31 }
32