Package groovy.json
Class JsonLexer
java.lang.Object
groovy.json.JsonLexer
The lexer reads JSON tokens in a streaming fashion from the underlying reader.
- Since:
- 1.8.0
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionUnderlying 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.next()Iterator method to get the next token of the stream.voidremove()Method not implemented.intSkips all the whitespace characters and moves the cursor to the next non-space character.static StringReplace unicode escape and other control characters with real charactersMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.IteratorforEachRemaining
- 
Constructor Details- 
JsonLexerInstantiates 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 Details- 
getReaderUnderlying reader from which to read the JSON tokens. This reader is an instance ofLineColumnReader, to keep track of line and column positions.
- 
nextToken- Returns:
- the next token from the stream
 
- 
unescapeReplace 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.
- 
nextIterator method to get the next token of the stream.
- 
removepublic void remove()Method not implemented.- Specified by:
- removein interface- Iterator<JsonToken>
- Throws:
- UnsupportedOperationException
 
 
-