Package groovy.json
Class JsonLexer
- java.lang.Object
- 
- groovy.json.JsonLexer
 
- 
- 
Constructor SummaryConstructors Constructor Description JsonLexer(java.io.Reader reader)Instantiates a lexer with a reader from which to read JSON tokens.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LineColumnReadergetReader()Underlying reader from which to read the JSON tokens.booleanhasNext()Iterator method to know if another token follows, or if we've reached the end of the stream.JsonTokennext()Iterator method to get the next token of the stream.JsonTokennextToken()voidremove()Method not implemented.intskipWhitespace()Skips all the whitespace characters and moves the cursor to the next non-space character.static java.lang.Stringunescape(java.lang.String input)Replace unicode escape and other control characters with real characters
 
- 
- 
- 
Constructor Detail- 
JsonLexerpublic JsonLexer(java.io.Reader reader) Instantiates a lexer with a reader from which to read JSON tokens. Under the hood, the reader is wrapped in aLineColumnReader, for line and column information, unless it's already an instance of that class.- Parameters:
- reader- underlying reader
 
 
- 
 - 
Method Detail- 
getReaderpublic LineColumnReader getReader() Underlying reader from which to read the JSON tokens. This reader is an instance ofLineColumnReader, to keep track of line and column positions.
 - 
nextTokenpublic JsonToken nextToken() - Returns:
- the next token from the stream
 
 - 
unescapepublic static java.lang.String unescape(java.lang.String input) Replace unicode escape and other control characters with real characters- Parameters:
- input- text
- Returns:
- input text without the escaping
 
 - 
skipWhitespacepublic int skipWhitespace() Skips all the whitespace characters and moves the cursor to the next non-space character.
 - 
hasNextpublic boolean hasNext() Iterator method to know if another token follows, or if we've reached the end of the stream.- Specified by:
- hasNextin interface- java.util.Iterator<JsonToken>
- Returns:
- true if there are more tokens
 
 - 
nextpublic JsonToken next() Iterator method to get the next token of the stream.- Specified by:
- nextin interface- java.util.Iterator<JsonToken>
- Returns:
- the next token
 
 - 
removepublic void remove() Method not implemented.- Specified by:
- removein interface- java.util.Iterator<JsonToken>
- Throws:
- java.lang.UnsupportedOperationException
 
 
- 
 
-