Package org.eclipse.text.readers
Class SubstitutionReader
java.lang.Object
java.io.Reader
org.eclipse.text.readers.SingleCharacterReader
org.eclipse.text.readers.SubstitutionReader
- All Implemented Interfaces:
Closeable,AutoCloseable,Readable
Reads the text contents from a reader and computes for each character
a potential substitution. The substitution may eat more characters than
only the one passed into the computation routine.
Moved into this package from org.eclipse.jface.internal.text.revisions.
- Since:
- 3.14
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected abstract StringcomputeSubstitution(int c) Computes the substitution for the given character and if necessary subsequent characters.protected ReaderReturns the internal reader.protected final booleanprotected intnextChar()Returns the next character.intread()booleanready()voidreset()protected final voidsetSkipWhitespace(boolean state) Methods inherited from class org.eclipse.text.readers.SingleCharacterReader
getString, readMethods inherited from class java.io.Reader
mark, markSupported, nullReader, read, read, skip, transferTo
-
Field Details
-
LINE_DELIM
-
fWasWhiteSpace
protected boolean fWasWhiteSpace
-
-
Constructor Details
-
SubstitutionReader
-
-
Method Details
-
computeSubstitution
Computes the substitution for the given character and if necessary subsequent characters. Implementation should usenextCharto read subsequent characters.- Parameters:
c- the character to be substituted- Returns:
- the substitution for
c - Throws:
IOException- in case computing the substitution fails
-
getReader
Returns the internal reader.- Returns:
- the internal reader
-
nextChar
Returns the next character.- Returns:
- the next character
- Throws:
IOException- in case reading the character fails
-
read
- Specified by:
readin classSingleCharacterReader- Throws:
IOException- See Also:
-
ready
- Overrides:
readyin classSingleCharacterReader- Throws:
IOException- See Also:
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classReader- Throws:
IOException- See Also:
-
reset
- Overrides:
resetin classReader- Throws:
IOException- See Also:
-
setSkipWhitespace
protected final void setSkipWhitespace(boolean state) -
isSkippingWhitespace
protected final boolean isSkippingWhitespace()
-