Class CssCharStream

java.lang.Object
org.htmlunit.cssparser.parser.CssCharStream
All Implemented Interfaces:
CharStream

public final class CssCharStream extends Object implements 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 Details

    • staticFlag

      public static final boolean staticFlag
      Whether 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 bufpos
      Position 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

      private Reader inputStream
    • buffer

      private char[] buffer
    • maxNextCharInd

      private int maxNextCharInd
    • inBuf

      private int inBuf
    • tabSize

      private int tabSize
    • trackLineColumn

      private boolean trackLineColumn
  • Constructor Details

    • CssCharStream

      public CssCharStream(Reader dstream, int startline, int startcolumn, int buffersize)
      Constructor.
      Parameters:
      dstream - the stream to read from
      startline - startline
      startcolumn - startcolumn
      buffersize - buffersize
    • CssCharStream

      public CssCharStream(Reader dstream, int startline, int startcolumn)
      Constructor.
      Parameters:
      dstream - the stream to read from
      startline - startline
      startcolumn - startcolumn
  • Method Details

    • ExpandBuff

      private void ExpandBuff(boolean wrapAround)
    • FillBuff

      private final void FillBuff() throws IOException
      Throws:
      IOException
    • BeginToken

      public final char BeginToken() throws IOException
      Start.
      Specified by:
      BeginToken in interface CharStream
      Throws:
      IOException
    • UpdateLineColumn

      private final void UpdateLineColumn(char c)
    • readChar

      public final char readChar() throws IOException
      Read a character.
      Specified by:
      readChar in interface CharStream
      Throws:
      IOException
    • getColumn

      @Deprecated public final int getColumn()
      Deprecated.
      Description copied from interface: CharStream
      Returns the column position of the character last read.
      Specified by:
      getColumn in interface CharStream
      See Also:
    • getLine

      @Deprecated public final int getLine()
      Deprecated.
      Description copied from interface: CharStream
      Returns the line number of the character last read.
      Specified by:
      getLine in interface CharStream
      See Also:
    • getEndColumn

      public final int getEndColumn()
      Get token end column number.
      Specified by:
      getEndColumn in interface CharStream
    • getEndLine

      public final int getEndLine()
      Get token end line number.
      Specified by:
      getEndLine in interface CharStream
    • getBeginColumn

      public final int getBeginColumn()
      Get token beginning column number.
      Specified by:
      getBeginColumn in interface CharStream
    • getBeginLine

      public final int getBeginLine()
      Get token beginning line number.
      Specified by:
      getBeginLine in interface CharStream
    • backup

      public final void backup(int amount)
      Backup a number of characters.
      Specified by:
      backup in interface CharStream
    • GetImage

      public final String GetImage()
      Get token literal value.
      Specified by:
      GetImage in interface CharStream
    • GetSuffix

      public final char[] GetSuffix(int len)
      Get the suffix.
      Specified by:
      GetSuffix in interface CharStream
    • Done

      public void Done()
      Reset buffer when finished.
      Specified by:
      Done in interface CharStream
    • 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 line
      newCol - the new column
    • setTabSize

      public void setTabSize(int i)
      Specified by:
      setTabSize in interface CharStream
    • getTabSize

      public int getTabSize()
      Specified by:
      getTabSize in interface CharStream
    • getTrackLineColumn

      public boolean getTrackLineColumn()
      Specified by:
      getTrackLineColumn in interface CharStream
    • setTrackLineColumn

      public void setTrackLineColumn(boolean tlc)
      Specified by:
      setTrackLineColumn in interface CharStream