Class CssCharStream
java.lang.Object
org.htmlunit.cssparser.parser.CssCharStream
- All Implemented Interfaces:
CharStream
An implementation of interface CharStream.
There is no processing of escaping in this class because the escaping is
part of the parser. CSS has some strange rules about that, so processing
unicode escapes in this class is too early.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) intprivate int[]private char[]private static final intprivate int[]intPosition in buffer.(package private) intprivate intprivate intprivate Readerprivate intprivate intprivate booleanprivate booleanstatic final booleanWhether parser is static.private int(package private) intprivate boolean -
Constructor Summary
ConstructorsConstructorDescriptionCssCharStream(Reader dstream, int startline, int startcolumn) Constructor.CssCharStream(Reader dstream, int startline, int startcolumn, int buffersize) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidadjustBeginLineColumn(int newLine, int newCol) Method to adjust line and column numbers for the start of a token.final voidbackup(int amount) Backup a number of characters.final charStart.voidDone()Reset buffer when finished.private voidExpandBuff(boolean wrapAround) private final voidFillBuff()final intGet token beginning column number.final intGet token beginning line number.final intDeprecated.final intGet token end column number.final intGet token end line number.final StringGetImage()Get token literal value.final intgetLine()Deprecated.final char[]GetSuffix(int len) Get the suffix.intbooleanfinal charreadChar()Read a character.voidsetTabSize(int i) voidsetTrackLineColumn(boolean tlc) private final voidUpdateLineColumn(char c)
-
Field Details
-
staticFlag
public static final boolean staticFlagWhether parser is static.- See Also:
-
BUFFER_SIZE
private static final int BUFFER_SIZE- See Also:
-
bufsize
int bufsize -
available
int available -
tokenBegin
int tokenBegin -
bufpos
public int bufposPosition in buffer. -
bufline
private int[] bufline -
bufcolumn
private int[] bufcolumn -
column
private int column -
line
private int line -
prevCharIsCR
private boolean prevCharIsCR -
prevCharIsLF
private boolean prevCharIsLF -
inputStream
-
buffer
private char[] buffer -
maxNextCharInd
private int maxNextCharInd -
inBuf
private int inBuf -
tabSize
private int tabSize -
trackLineColumn
private boolean trackLineColumn
-
-
Constructor Details
-
CssCharStream
Constructor.- Parameters:
dstream- the stream to read fromstartline- startlinestartcolumn- startcolumnbuffersize- buffersize
-
CssCharStream
Constructor.- Parameters:
dstream- the stream to read fromstartline- startlinestartcolumn- startcolumn
-
-
Method Details
-
ExpandBuff
private void ExpandBuff(boolean wrapAround) -
FillBuff
- Throws:
IOException
-
BeginToken
Start.- Specified by:
BeginTokenin interfaceCharStream- Throws:
IOException
-
UpdateLineColumn
private final void UpdateLineColumn(char c) -
readChar
Read a character.- Specified by:
readCharin interfaceCharStream- Throws:
IOException
-
getColumn
Deprecated.Description copied from interface:CharStreamReturns the column position of the character last read.- Specified by:
getColumnin interfaceCharStream- See Also:
-
getLine
Deprecated.Description copied from interface:CharStreamReturns the line number of the character last read.- Specified by:
getLinein interfaceCharStream- See Also:
-
getEndColumn
public final int getEndColumn()Get token end column number.- Specified by:
getEndColumnin interfaceCharStream
-
getEndLine
public final int getEndLine()Get token end line number.- Specified by:
getEndLinein interfaceCharStream
-
getBeginColumn
public final int getBeginColumn()Get token beginning column number.- Specified by:
getBeginColumnin interfaceCharStream
-
getBeginLine
public final int getBeginLine()Get token beginning line number.- Specified by:
getBeginLinein interfaceCharStream
-
backup
public final void backup(int amount) Backup a number of characters.- Specified by:
backupin interfaceCharStream
-
GetImage
Get token literal value.- Specified by:
GetImagein interfaceCharStream
-
GetSuffix
public final char[] GetSuffix(int len) Get the suffix.- Specified by:
GetSuffixin interfaceCharStream
-
Done
-
adjustBeginLineColumn
public void adjustBeginLineColumn(int newLine, int newCol) Method to adjust line and column numbers for the start of a token.- Parameters:
newLine- the new linenewCol- the new column
-
setTabSize
public void setTabSize(int i) - Specified by:
setTabSizein interfaceCharStream
-
getTabSize
public int getTabSize()- Specified by:
getTabSizein interfaceCharStream
-
getTrackLineColumn
public boolean getTrackLineColumn()- Specified by:
getTrackLineColumnin interfaceCharStream
-
setTrackLineColumn
public void setTrackLineColumn(boolean tlc) - Specified by:
setTrackLineColumnin interfaceCharStream
-