public class JsonParser
extends java.lang.Object
Constructor and Description |
---|
JsonParser(JsonHandler<?,?> handler)
Creates a new JsonParser with the given handler.
|
Modifier and Type | Method and Description |
---|---|
void |
parse(java.io.Reader reader)
Reads the entire input from the given reader and parses it as JSON.
|
void |
parse(java.io.Reader reader,
int buffersize)
Reads the entire input from the given reader and parses it as JSON.
|
void |
parse(java.lang.String string)
Parses the given input string.
|
public JsonParser(JsonHandler<?,?> handler)
handler
- the handler to process parser eventspublic void parse(java.lang.String string)
string
- the input string, must be valid JSONParseException
- if the input is not valid JSONpublic void parse(java.io.Reader reader) throws java.io.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 fromjava.io.IOException
- if an I/O error occurs in the readerParseException
- if the input is not valid JSONpublic void parse(java.io.Reader reader, int buffersize) throws java.io.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 charsjava.io.IOException
- if an I/O error occurs in the readerParseException
- if the input is not valid JSONJHepSim. A part of HSTOOLS. version-1.2