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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected abstract String
computeSubstitution
(int c) Computes the substitution for the given character and if necessary subsequent characters.protected Reader
Returns the internal reader.protected final boolean
protected int
nextChar()
Returns the next character.int
read()
boolean
ready()
void
reset()
protected final void
setSkipWhitespace
(boolean state) Methods inherited from class org.eclipse.text.readers.SingleCharacterReader
getString, read
Methods 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 usenextChar
to 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:
read
in classSingleCharacterReader
- Throws:
IOException
- See Also:
-
ready
- Overrides:
ready
in classSingleCharacterReader
- Throws:
IOException
- See Also:
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classReader
- Throws:
IOException
- See Also:
-
reset
- Overrides:
reset
in classReader
- Throws:
IOException
- See Also:
-
setSkipWhitespace
protected final void setSkipWhitespace(boolean state) -
isSkippingWhitespace
protected final boolean isSkippingWhitespace()
-