public class JsonParser extends Object
| Constructor and Description |
|---|
JsonParser(JsonHandler<?,?> handler)
Creates a new JsonParser with the given handler.
|
| Modifier and Type | Method and Description |
|---|---|
void |
parse(Reader reader)
Reads the entire input from the given reader and parses it as JSON.
|
void |
parse(Reader reader,
int buffersize)
Reads the entire input from the given reader and parses it as JSON.
|
void |
parse(String string)
Parses the given input string.
|
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 © 2020 Hazelcast, Inc.. All Rights Reserved.