public class JSONParser extends Object
| 构造器和说明 |
|---|
JSONParser(JSONHandler<?,?> handler)
Creates a new JsonParser with the given handler.
|
public JSONParser(JSONHandler<?,?> handler)
handler - the handler to process parser eventspublic void parse(String string)
string - the input string, must be valid JSONParseException - if the input is not valid JSONpublic void parse(Reader reader) throws IOException
Characters are read in chunks into a default-sized input buffer. Hence, wrapping a reader in an
additional BufferedReader likely won't improve reading performance.
reader - the reader to read the input fromIOException - if an I/O error occurs in the readerParseException - if the input is not valid JSONpublic void parse(Reader reader, int buffersize) throws IOException
Characters are read in chunks into an input buffer of the given size. Hence, wrapping a reader
in an additional BufferedReader likely won't improve reading performance.
reader - the reader to read the input frombuffersize - the size of the input buffer in charsIOException - if an I/O error occurs in the readerParseException - if the input is not valid JSONCopyright © 2016. All rights reserved.