Package com.github.javaparser
Class UnicodeEscapeProcessingProvider
- java.lang.Object
-
- com.github.javaparser.UnicodeEscapeProcessingProvider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classUnicodeEscapeProcessingProvider.LineCounterProcessor keeping track of the current line and column in a stream of incoming characters.static classUnicodeEscapeProcessingProvider.PositionMappingAn algorithm mappingPositionform two corresponding files.private static classUnicodeEscapeProcessingProvider.PositionMappingBuilder
-
Field Summary
Fields Modifier and Type Field Description private boolean_backslashSeenprivate char[]_dataprivate Provider_inputprivate UnicodeEscapeProcessingProvider.LineCounter_inputLineprivate int_lenThe number of characters in_data.private UnicodeEscapeProcessingProvider.PositionMappingBuilder_mappingBuilderprivate UnicodeEscapeProcessingProvider.LineCounter_outputLineprivate int_posThe position in_datawhere to read the next source character from.private static charBACKSLASHprivate static charCRprivate static intEOFprivate static charLF
-
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 intbackSlashSeen()private intclearBackSlashSeen(int next)voidclose()Closes the stream and releases any system resources associated with it.private static intdigit(int ch)private intfillBuffer()UnicodeEscapeProcessingProvider.LineCountergetInputCounter()TheUnicodeEscapeProcessingProvider.LineCounterof the input file.UnicodeEscapeProcessingProvider.LineCountergetOutputCounter()TheUnicodeEscapeProcessingProvider.LineCounterof the output file.UnicodeEscapeProcessingProvider.PositionMappinggetPositionMapping()TheUnicodeEscapeProcessingProvider.PositionMappingbeing built during processing the file.private booleanisBufferEmpty()private intnextBufferedChar()Retrieves the next un-escaped character from the buffered_input.private intnextInputChar()Processes column/line information from the input file.private intnextOutputChar()Produces the next un-escaped character to be written to the output.private voidpushBack(int ch)private voidpushBackUs(int cnt)intread(char[] buffer, int offset, int len)Reads characters into an arrayprivate intreadDigits(int uCnt, int next3)private intunicodeStartSeen()
-
-
-
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_datawhere 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.LineCounterof the input file.
-
getOutputCounter
public UnicodeEscapeProcessingProvider.LineCounter getOutputCounter()
TheUnicodeEscapeProcessingProvider.LineCounterof the output file.
-
read
public int read(char[] buffer, int offset, int len) throws java.io.IOExceptionDescription copied from interface:ProviderReads characters into an array
-
close
public void close() throws java.io.IOExceptionDescription copied from interface:ProviderCloses the stream and releases any system resources associated with it.
-
nextOutputChar
private int nextOutputChar() throws java.io.IOExceptionProduces the next un-escaped character to be written to the output.- Returns:
- The next character or
-1if 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.IOExceptionProcesses column/line information from the input file.- Returns:
- The next character or
-1if no more input is available. - Throws:
java.io.IOException
-
nextBufferedChar
private int nextBufferedChar() throws java.io.IOExceptionRetrieves the next un-escaped character from the buffered_input.- Returns:
- The next character or
-1if 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.PositionMappingbeing built during processing the file.
-
-