Class JsonLexer
- java.lang.Object
-
- de.undercouch.citeproc.helper.json.JsonLexer
-
public class JsonLexer extends Object
A simple JSON lexer- Author:
- Michel Kramer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJsonLexer.TypeToken types
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JsonLexer.TypereadNextToken()Reads the next token from the streamNumberreadNumber()Reads a number from the streamStringreadString()Reads a string from the stream
-
-
-
Constructor Detail
-
JsonLexer
public JsonLexer(Reader r)
Creates a new lexer- Parameters:
r- the reader that provides the JSON to scan
-
-
Method Detail
-
readNextToken
public JsonLexer.Type readNextToken() throws IOException
Reads the next token from the stream- Returns:
- the token
- Throws:
IOException- if the stream could not be read
-
readString
public String readString() throws IOException
Reads a string from the stream- Returns:
- the string
- Throws:
IOException- if the stream could not be read
-
readNumber
public Number readNumber() throws IOException
Reads a number from the stream- Returns:
- the number
- Throws:
IOException- if the stream could not be read
-
-