Package com.github.javaparser
Class UnicodeEscapeProcessingProvider
- java.lang.Object
-
- com.github.javaparser.UnicodeEscapeProcessingProvider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
UnicodeEscapeProcessingProvider.LineCounter
Processor keeping track of the current line and column in a stream of incoming characters.static class
UnicodeEscapeProcessingProvider.PositionMapping
An algorithm mappingPosition
form two corresponding files.private static class
UnicodeEscapeProcessingProvider.PositionMappingBuilder
-
Field Summary
Fields Modifier and Type Field Description private boolean
_backslashSeen
private char[]
_data
private Provider
_input
private UnicodeEscapeProcessingProvider.LineCounter
_inputLine
private int
_len
The number of characters in_data
.private UnicodeEscapeProcessingProvider.PositionMappingBuilder
_mappingBuilder
private UnicodeEscapeProcessingProvider.LineCounter
_outputLine
private int
_pos
The position in_data
where to read the next source character from.private static char
BACKSLASH
private static char
CR
private static int
EOF
private static char
LF
-
Constructor Summary
Constructors Constructor Description UnicodeEscapeProcessingProvider(int bufferSize, Provider input)
Creates aUnicodeEscapeProcessingProvider
.UnicodeEscapeProcessingProvider(Provider input)
Creates aUnicodeEscapeProcessingProvider
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private int
backSlashSeen()
private int
clearBackSlashSeen(int next)
void
close()
Closes the stream and releases any system resources associated with it.private static int
digit(int ch)
private int
fillBuffer()
UnicodeEscapeProcessingProvider.LineCounter
getInputCounter()
TheUnicodeEscapeProcessingProvider.LineCounter
of the input file.UnicodeEscapeProcessingProvider.LineCounter
getOutputCounter()
TheUnicodeEscapeProcessingProvider.LineCounter
of the output file.UnicodeEscapeProcessingProvider.PositionMapping
getPositionMapping()
TheUnicodeEscapeProcessingProvider.PositionMapping
being built during processing the file.private boolean
isBufferEmpty()
private int
nextBufferedChar()
Retrieves the next un-escaped character from the buffered_input
.private int
nextInputChar()
Processes column/line information from the input file.private int
nextOutputChar()
Produces the next un-escaped character to be written to the output.private void
pushBack(int ch)
private void
pushBackUs(int cnt)
int
read(char[] buffer, int offset, int len)
Reads characters into an arrayprivate int
readDigits(int uCnt, int next3)
private int
unicodeStartSeen()
-
-
-
Field Detail
-
LF
private static final char LF
- See Also:
- Constant Field Values
-
CR
private static final char CR
- See Also:
- Constant Field Values
-
BACKSLASH
private static final char BACKSLASH
- See Also:
- Constant Field Values
-
EOF
private static final int EOF
- See Also:
- Constant Field Values
-
_data
private char[] _data
-
_len
private int _len
The number of characters in_data
.
-
_pos
private int _pos
The position in_data
where to read the next source character from.
-
_backslashSeen
private boolean _backslashSeen
-
_inputLine
private final UnicodeEscapeProcessingProvider.LineCounter _inputLine
-
_outputLine
private final UnicodeEscapeProcessingProvider.LineCounter _outputLine
-
_mappingBuilder
private final UnicodeEscapeProcessingProvider.PositionMappingBuilder _mappingBuilder
-
_input
private Provider _input
-
-
Constructor Detail
-
UnicodeEscapeProcessingProvider
public UnicodeEscapeProcessingProvider(Provider input)
Creates aUnicodeEscapeProcessingProvider
.
-
UnicodeEscapeProcessingProvider
public UnicodeEscapeProcessingProvider(int bufferSize, Provider input)
Creates aUnicodeEscapeProcessingProvider
.
-
-
Method Detail
-
getInputCounter
public UnicodeEscapeProcessingProvider.LineCounter getInputCounter()
TheUnicodeEscapeProcessingProvider.LineCounter
of the input file.
-
getOutputCounter
public UnicodeEscapeProcessingProvider.LineCounter getOutputCounter()
TheUnicodeEscapeProcessingProvider.LineCounter
of the output file.
-
read
public int read(char[] buffer, int offset, int len) throws java.io.IOException
Description copied from interface:Provider
Reads characters into an array
-
close
public void close() throws java.io.IOException
Description copied from interface:Provider
Closes the stream and releases any system resources associated with it.
-
nextOutputChar
private int nextOutputChar() throws java.io.IOException
Produces the next un-escaped character to be written to the output.- Returns:
- The next character or
-1
if no more characters are available. - Throws:
java.io.IOException
-
clearBackSlashSeen
private int clearBackSlashSeen(int next)
-
backSlashSeen
private int backSlashSeen() throws java.io.IOException
- Throws:
java.io.IOException
-
unicodeStartSeen
private int unicodeStartSeen() throws java.io.IOException
- Throws:
java.io.IOException
-
readDigits
private int readDigits(int uCnt, int next3) throws java.io.IOException
- Throws:
java.io.IOException
-
pushBackUs
private void pushBackUs(int cnt)
-
digit
private static int digit(int ch)
-
nextInputChar
private int nextInputChar() throws java.io.IOException
Processes column/line information from the input file.- Returns:
- The next character or
-1
if no more input is available. - Throws:
java.io.IOException
-
nextBufferedChar
private int nextBufferedChar() throws java.io.IOException
Retrieves the next un-escaped character from the buffered_input
.- Returns:
- The next character or
-1
if no more input is available. - Throws:
java.io.IOException
-
isBufferEmpty
private boolean isBufferEmpty()
-
fillBuffer
private int fillBuffer() throws java.io.IOException
- Throws:
java.io.IOException
-
pushBack
private void pushBack(int ch)
-
getPositionMapping
public UnicodeEscapeProcessingProvider.PositionMapping getPositionMapping()
TheUnicodeEscapeProcessingProvider.PositionMapping
being built during processing the file.
-
-