public class CodeReader extends CodeBuffer
CodeBuffer.Cursor
Constructor and Description |
---|
CodeReader(Reader code) |
CodeReader(Reader code,
CodeReaderConfiguration configuration)
Creates a code reader with specific configuration parameters.
|
CodeReader(String code) |
CodeReader(String code,
CodeReaderConfiguration configuration)
Creates a code reader with specific configuration parameters.
|
Modifier and Type | Method and Description |
---|---|
CodeBuffer.Cursor |
getPreviousCursor() |
char[] |
peek(int length)
Read without consuming the next characters
|
void |
peekTo(EndMatcher matcher,
Appendable appendable)
Read without consuming the next characters until a condition is reached (EndMatcher)
|
void |
pop(Appendable appendable)
Read and consume the next character
|
int |
popTo(Matcher matcher,
Appendable appendable)
Read and consume the next characters according to a given regular expression
|
int |
popTo(Matcher matcher,
Matcher afterMatcher,
Appendable appendable)
Read and consume the next characters according to a given regular expression.
|
charAt, getColumnPosition, getCursor, getLinePosition, intAt, lastChar, length, peek, pop, setColumnPosition, setLinePosition, startRecording, stopRecording, subSequence, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
chars, codePoints
public CodeReader(Reader code)
public CodeReader(String code)
public CodeReader(Reader code, CodeReaderConfiguration configuration)
code
- the Reader to read code fromconfiguration
- the configuration parameterspublic CodeReader(String code, CodeReaderConfiguration configuration)
code
- the code itselfconfiguration
- the configuration parameterspublic final void pop(Appendable appendable)
appendable
- the read character is appended to appendablepublic final char[] peek(int length)
length
- number of character to readpublic final void peekTo(EndMatcher matcher, Appendable appendable)
matcher
- the EndMatcher used to stop the readingappendable
- the read characters is appended to appendablepublic final int popTo(Matcher matcher, Appendable appendable)
matcher
- the regular expression matcherappendable
- the consumed characters are appended to this appendablepublic final int popTo(Matcher matcher, Matcher afterMatcher, Appendable appendable)
matcher
- the Matcher used to try consuming next charactersafterMatcher
- the Matcher used to check character sequence immediately following the consumed charactersappendable
- the consumed characters are appended to this appendablepublic final CodeBuffer.Cursor getPreviousCursor()
Copyright © 2009–2017 SonarSource. All rights reserved.