Skip to content

Commit cb16db3

Browse files
committed
#27 add javadoc
1 parent 243d2df commit cb16db3

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

jsurfer-core/src/main/java/org/jsfr/json/JsonParserAdapter.java

+6
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ public interface JsonParserAdapter {
6565
*/
6666
ResumableParser createResumableParser(String json, SurfingContext context);
6767

68+
/**
69+
* Create a NonBlockingParser
70+
*
71+
* @param context Surfing context
72+
* @return NonBlockingParser
73+
*/
6874
NonBlockingParser createNonBlockingParser(SurfingContext context);
6975

7076
}
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
11
package org.jsfr.json;
22

33
/**
4-
* Created by Leo on 2017/8/10.
4+
* Interface for non-blocking parsing
55
*/
6-
public interface NonBlockingParser extends ResumableParser{
6+
public interface NonBlockingParser extends ResumableParser {
77

8+
/**
9+
* Feed data and start or resume parsing immediately
10+
*
11+
* @param bytes bytes to feed
12+
* @param start start position
13+
* @param end end position
14+
* @return true if all feed data is successfully consumed
15+
*/
816
boolean feed(byte[] bytes, int start, int end);
917

18+
/**
19+
* Called to notify parser the input ended
20+
*/
1021
void endOfInput();
1122

1223
}

jsurfer-core/src/main/java/org/jsfr/json/ResumableParser.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public interface ResumableParser {
1313
/**
1414
* Resume parsing. It should not be invoked before parse()!
1515
*
16-
* @return true if parser is not stopped and in paused state before calling resume()
16+
* @return true if parser was in paused state before invoking resume()
1717
*/
1818
boolean resume();
1919

0 commit comments

Comments
 (0)