Class PeekingReader
java.lang.Object
java.io.Reader
java.io.FilterReader
migratedb.v1.core.internal.parser.PeekingReader
- All Implemented Interfaces:
Closeable,AutoCloseable,Readable
-
Field Summary
Fields inherited from class java.io.FilterReader
in -
Method Summary
Modifier and TypeMethodDescriptionbooleanpeek(char c) Peek ahead in the stream to see if the next character matches this one.booleanpeek(char c1, char c2) Peek ahead in the stream to see if the next character matches either of these.peek(int numChars) Peek ahead in the stream to look at this number of characters ahead in the reader.peek(int numChars, boolean peekMultipleLines) Peek ahead in the stream to look at this number of characters ahead in the reader.booleanPeek ahead in the stream to see if the next characters match this string exactly.booleanpeekKeywordPart(ParserContext context) Peek ahead in the stream to see if the next character could be a character part of a keyword or identifier.charReturn the next non-whitespace characterbooleanPeek ahead in the stream to see if the next character is numeric.booleanPeek ahead in the stream to see if the next character is whitespace.intread()readKeywordPart(Delimiter delimiter, ParserContext context) Reads all characters in this stream as long as they can be part of a keyword.Reads all characters in this stream as long as they can be part of a numeric constant.readUntilExcluding(char delimiter1, char delimiter2) Reads all characters in this stream until any of these delimiting characters has been encountered.readUntilExcluding(String... strings) Reads all characters in this stream until any of the delimiting strings is encountered.readUntilExcludingWithEscape(char delimiter, boolean selfEscape) Reads all characters in this stream until this delimiting character has been encountered, taking into account this escape character for the delimiting character.readUntilExcludingWithEscape(char delimiter, boolean selfEscape, char escape) Reads all characters in this stream until this delimiting character has been encountered, taking into account this escape character for the delimiting character.readUntilIncluding(char delimiter) Reads all characters in this stream until any of this delimiting character has been encountered.readUntilIncluding(String delimiterSequence) Reads all characters in this stream until the delimiting sequence is encountered.Reads all characters in this stream as long as they are whitespace.voidswallow()Swallows the next character.voidswallow(int n) Swallows the next n characters.voidswallowUntilExcluding(char delimiter1, char delimiter2) Swallows all characters in this stream until any of these delimiting characters has been encountered.voidSwallows all characters in this stream until this delimiting string has been encountered.voidswallowUntilIncludingWithEscape(char delimiter, boolean selfEscape) Swallows all characters in this stream until this delimiting character has been encountered, taking into account this escape character for the delimiting character.voidswallowUntilIncludingWithEscape(char delimiter, boolean selfEscape, char escape) Swallows all characters in this stream until this delimiting character has been encountered, taking into account this escape character for the delimiting character.Methods inherited from class java.io.FilterReader
close, mark, markSupported, read, ready, reset, skipMethods inherited from class java.io.Reader
nullReader, read, read, transferTo
-
Method Details
-
read
- Overrides:
readin classFilterReader- Throws:
IOException
-
swallow
Swallows the next character.- Throws:
IOException
-
swallow
Swallows the next n characters.- Throws:
IOException
-
peek
Peek ahead in the stream to see if the next character matches this one.- Parameters:
c- The character to match.- Returns:
trueif it does,falseif not.- Throws:
IOException
-
peek
Peek ahead in the stream to see if the next character matches either of these.- Parameters:
c1- The first character to match.c2- The second character to match.- Returns:
trueif it does,falseif not.- Throws:
IOException
-
peekNumeric
Peek ahead in the stream to see if the next character is numeric.- Returns:
trueif it is,falseif not.- Throws:
IOException
-
peekWhitespace
Peek ahead in the stream to see if the next character is whitespace.- Returns:
trueif it is,falseif not.- Throws:
IOException
-
peekKeywordPart
Peek ahead in the stream to see if the next character could be a character part of a keyword or identifier.- Returns:
trueif it is,falseif not.- Throws:
IOException
-
peek
Peek ahead in the stream to see if the next characters match this string exactly.- Parameters:
str- The string to match.- Returns:
trueif they do,falseif not.- Throws:
IOException
-
peek
Peek ahead in the stream to look at this number of characters ahead in the reader.- Parameters:
numChars- The number of characters.- Returns:
- The characters.
- Throws:
IOException
-
peek
Peek ahead in the stream to look at this number of characters ahead in the reader.- Parameters:
numChars- The number of characters.peekMultipleLines- Whether the peek should go across lines or not- Returns:
- The characters.
- Throws:
IOException
-
peekNextNonWhitespace
Return the next non-whitespace character- Returns:
- The character
- Throws:
IOException
-
swallowUntilExcluding
Swallows all characters in this stream until any of these delimiting characters has been encountered.- Parameters:
delimiter1- The first delimiting character.delimiter2- The second delimiting character.- Throws:
IOException
-
readUntilExcluding
Reads all characters in this stream until any of these delimiting characters has been encountered.- Parameters:
delimiter1- The first delimiting character.delimiter2- The second delimiting character.- Returns:
- The string read, without the delimiting characters.
- Throws:
IOException
-
swallowUntilIncludingWithEscape
Swallows all characters in this stream until this delimiting character has been encountered, taking into account this escape character for the delimiting character.- Parameters:
delimiter- The delimiting character.selfEscape- Whether the delimiter can escape itself by being present twice.- Throws:
IOException
-
swallowUntilIncludingWithEscape
public void swallowUntilIncludingWithEscape(char delimiter, boolean selfEscape, char escape) throws IOException Swallows all characters in this stream until this delimiting character has been encountered, taking into account this escape character for the delimiting character.- Parameters:
delimiter- The delimiting character.selfEscape- Whether the delimiter can escape itself by being present twice.escape- A separate escape character.- Throws:
IOException
-
readUntilExcludingWithEscape
Reads all characters in this stream until this delimiting character has been encountered, taking into account this escape character for the delimiting character.- Parameters:
delimiter- The delimiting character.selfEscape- Whether the delimiter can escape itself by being present twice.- Returns:
- The string read, without the delimiting character.
- Throws:
IOException
-
readUntilExcludingWithEscape
public String readUntilExcludingWithEscape(char delimiter, boolean selfEscape, char escape) throws IOException Reads all characters in this stream until this delimiting character has been encountered, taking into account this escape character for the delimiting character.- Parameters:
delimiter- The delimiting character.selfEscape- Whether the delimiter can escape itself by being present twice.escape- A separate escape character.- Returns:
- The string read, without the delimiting character.
- Throws:
IOException
-
swallowUntilExcluding
Swallows all characters in this stream until this delimiting string has been encountered.- Parameters:
str- The delimiting string.- Throws:
IOException
-
readUntilExcluding
Reads all characters in this stream until any of the delimiting strings is encountered.- Parameters:
strings- The delimiting strings.- Returns:
- The string read, without the delimiting string.
- Throws:
IOException
-
readUntilIncluding
Reads all characters in this stream until any of this delimiting character has been encountered.- Parameters:
delimiter- The delimiting character.- Returns:
- The string read, including the delimiting characters.
- Throws:
IOException
-
readUntilIncluding
Reads all characters in this stream until the delimiting sequence is encountered.- Parameters:
delimiterSequence- The delimiting sequence.- Returns:
- The string read, including the delimiting characters.
- Throws:
IOException
-
readKeywordPart
Reads all characters in this stream as long as they can be part of a keyword.- Parameters:
delimiter- The current delimiter.- Returns:
- The string read.
- Throws:
IOException
-
readNumeric
Reads all characters in this stream as long as they can be part of a numeric constant.- Returns:
- The string read.
- Throws:
IOException
-
readWhitespace
Reads all characters in this stream as long as they are whitespace.- Returns:
- The string read.
- Throws:
IOException
-