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 TypeFieldDescriptionintPosition in buffer.static final booleanWhether parser is static. -
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.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)
-
Field Details
-
staticFlag
public static final boolean staticFlagWhether parser is static.- See Also:
-
bufpos
public int bufposPosition in buffer.
-
-
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
-
BeginToken
Start.- Specified by:
BeginTokenin interfaceCharStream- Throws:
IOException
-
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
-