Package com.github.javaparser
Class UnicodeEscapeProcessingProvider
java.lang.Object
com.github.javaparser.UnicodeEscapeProcessingProvider
- All Implemented Interfaces:
Provider
Provider
un-escaping unicode escape sequences in the input sequence.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Processor keeping track of the current line and column in a stream of incoming characters.static final class
An algorithm mappingPosition
form two corresponding files.private static final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private char[]
private Provider
private final UnicodeEscapeProcessingProvider.LineCounter
private int
The number of characters in_data
.private final UnicodeEscapeProcessingProvider.PositionMappingBuilder
private final UnicodeEscapeProcessingProvider.LineCounter
private int
The position in_data
where to read the next source character from.private static final char
private static final char
private static final int
private static final char
-
Constructor Summary
ConstructorsConstructorDescriptionUnicodeEscapeProcessingProvider
(int bufferSize, Provider input) Creates aUnicodeEscapeProcessingProvider
.Creates aUnicodeEscapeProcessingProvider
. -
Method Summary
Modifier and TypeMethodDescriptionprivate int
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
TheUnicodeEscapeProcessingProvider.LineCounter
of the input file.TheUnicodeEscapeProcessingProvider.LineCounter
of the output file.TheUnicodeEscapeProcessingProvider.PositionMapping
being built during processing the file.private boolean
private int
Retrieves the next un-escaped character from the buffered_input
.private int
Processes column/line information from the input file.private int
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
-
Field Details
-
LF
private static final char LF- See Also:
-
CR
private static final char CR- See Also:
-
BACKSLASH
private static final char BACKSLASH- See Also:
-
EOF
private static final int EOF- See Also:
-
_data
private char[] _data -
_len
private int _lenThe number of characters in_data
. -
_pos
private int _posThe position in_data
where to read the next source character from. -
_backslashSeen
private boolean _backslashSeen -
_inputLine
-
_outputLine
-
_mappingBuilder
-
_input
-
-
Constructor Details
-
UnicodeEscapeProcessingProvider
Creates aUnicodeEscapeProcessingProvider
. -
UnicodeEscapeProcessingProvider
Creates aUnicodeEscapeProcessingProvider
.
-
-
Method Details
-
getInputCounter
TheUnicodeEscapeProcessingProvider.LineCounter
of the input file. -
getOutputCounter
TheUnicodeEscapeProcessingProvider.LineCounter
of the output file. -
read
Description copied from interface:Provider
Reads characters into an array- Specified by:
read
in interfaceProvider
- Parameters:
buffer
- Destination bufferoffset
- Offset at which to start storing characterslen
- The maximum possible number of characters to read- Returns:
- The number of characters read, or -1 if all read
- Throws:
IOException
-
close
Description copied from interface:Provider
Closes the stream and releases any system resources associated with it.- Specified by:
close
in interfaceProvider
- Throws:
IOException
-
nextOutputChar
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:
IOException
-
clearBackSlashSeen
private int clearBackSlashSeen(int next) -
backSlashSeen
- Throws:
IOException
-
unicodeStartSeen
- Throws:
IOException
-
readDigits
- Throws:
IOException
-
pushBackUs
private void pushBackUs(int cnt) -
digit
private static int digit(int ch) -
nextInputChar
Processes column/line information from the input file.- Returns:
- The next character or
-1
if no more input is available. - Throws:
IOException
-
nextBufferedChar
Retrieves the next un-escaped character from the buffered_input
.- Returns:
- The next character or
-1
if no more input is available. - Throws:
IOException
-
isBufferEmpty
private boolean isBufferEmpty() -
fillBuffer
- Throws:
IOException
-
pushBack
private void pushBack(int ch) -
getPositionMapping
TheUnicodeEscapeProcessingProvider.PositionMapping
being built during processing the file.
-