Package org.apache.groovy.json.internal
Interface CharacterSource
- All Known Implementing Classes:
- ReaderCharacterSource
public interface CharacterSource
- 
Method SummaryModifier and Type Method Description booleanconsumeIfMatch(char[] match)Useful for finding constants in a string like true, false, etc.intcurrentChar()returns the current character without changing the IO pointer or index.java.lang.StringerrorDetails(java.lang.String message)char[]findNextChar(int ch, int esc)Used to find strings and their ilk Finds the next non-escaped charbooleanhadEscape()booleanhasChar()Checks to see if there is a next character.intlocation()This is mostly for debugging and testing.intnextChar()returns the next character moving the file pointer or index to the next location.char[]readNumber()Reads a number from the character source.intsafeNextChar()Combines the operations of nextChar and hasChar.voidskipWhiteSpace()Skip white space.
- 
Method Details- 
skipWhiteSpacevoid skipWhiteSpace()Skip white space.
- 
nextCharint nextChar()returns the next character moving the file pointer or index to the next location.
- 
currentCharint currentChar()returns the current character without changing the IO pointer or index.
- 
hasCharboolean hasChar()Checks to see if there is a next character.
- 
consumeIfMatchboolean consumeIfMatch(char[] match)Useful for finding constants in a string like true, false, etc.
- 
locationint location()This is mostly for debugging and testing.
- 
safeNextCharint safeNextChar()Combines the operations of nextChar and hasChar. Characters is -1 if not found which signifies end of file. This might be preferable to avoid two method calls.
- 
findNextCharchar[] findNextChar(int ch, int esc)Used to find strings and their ilk Finds the next non-escaped char- Parameters:
- ch- character to find
- esc- escape character to avoid next char if escaped
- Returns:
- list of chars until this is found.
 
- 
hadEscapeboolean hadEscape()
- 
readNumberchar[] readNumber()Reads a number from the character source.
- 
errorDetailsjava.lang.String errorDetails(java.lang.String message)
 
-