Package groovy.json
Interface JsonParser
- All Known Implementing Classes:
BaseJsonParser,JsonFastParser,JsonParserCharArray,JsonParserLax,JsonParserUsingCharacterSource
public interface JsonParser
This is the parser interface that backs the new JsonSlurper.
It was derived from the Boon JSON parser.
- Since:
- 2.3.0
-
Method Summary
Modifier and TypeMethodDescriptionparse(byte[] bytes) Parses JSON text from a byte array.Parses JSON text from a byte array using the supplied charset.parse(char[] chars) Parses JSON text from a character array.Parses JSON content read from a file using the supplied charset.parse(InputStream input) Parses JSON content read from an input stream.parse(InputStream input, String charset) Parses JSON content read from an input stream using the supplied charset.Parses JSON text read from aReader.parse(CharSequence charSequence) Parses JSON text from a character sequence.Parses JSON text from aString.
-
Method Details
-
parse
Parses JSON text from aString.- Parameters:
jsonString- the JSON text to parse- Returns:
- the parsed JSON data structure
-
parse
Parses JSON text from a byte array.- Parameters:
bytes- the JSON bytes to parse- Returns:
- the parsed JSON data structure
-
parse
Parses JSON text from a byte array using the supplied charset.- Parameters:
bytes- the JSON bytes to parsecharset- the charset used to decode the bytes- Returns:
- the parsed JSON data structure
-
parse
Parses JSON text from a character sequence.- Parameters:
charSequence- the JSON text to parse- Returns:
- the parsed JSON data structure
-
parse
Parses JSON text from a character array.- Parameters:
chars- the JSON characters to parse- Returns:
- the parsed JSON data structure
-
parse
Parses JSON text read from aReader.- Parameters:
reader- the reader supplying JSON text- Returns:
- the parsed JSON data structure
-
parse
Parses JSON content read from an input stream.- Parameters:
input- the input stream supplying JSON content- Returns:
- the parsed JSON data structure
-
parse
Parses JSON content read from an input stream using the supplied charset.- Parameters:
input- the input stream supplying JSON contentcharset- the charset used to decode the stream- Returns:
- the parsed JSON data structure
-
parse
Parses JSON content read from a file using the supplied charset.- Parameters:
file- the file supplying JSON contentcharset- the charset used to decode the file- Returns:
- the parsed JSON data structure
-