Class JsonParser
- java.lang.Object
-
- de.undercouch.citeproc.helper.json.JsonParser
-
public class JsonParser extends Object
Parses JSON tokens to maps- Author:
- Michel Kraemer
-
-
Constructor Summary
Constructors Constructor Description JsonParser(JsonLexer lexer)Constructs a new JSON parser
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Object>parseArray()Parses an arrayMap<String,Object>parseObject()Parses an object into a map
-
-
-
Constructor Detail
-
JsonParser
public JsonParser(JsonLexer lexer)
Constructs a new JSON parser- Parameters:
lexer- a JSON lexer to read from
-
-
Method Detail
-
parseObject
public Map<String,Object> parseObject() throws IOException
Parses an object into a map- Returns:
- the parsed object
- Throws:
IOException- if the input stream could not be read or if the input stream contained an unexpected token
-
parseArray
public List<Object> parseArray() throws IOException
Parses an array- Returns:
- the parsed array
- Throws:
IOException- if the input stream could not be read or if the input stream contained an unexpected token
-
-