Class Scanner

java.lang.Object
org.apache.batik.css.parser.Scanner

public class Scanner extends Object
This class represents a CSS scanner - an object which decodes CSS lexical units.
Version:
$Id: Scanner.java 1733416 2016-03-03 07:07:13Z gadams $
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected int
    The characters to skip to create the string which represents the current token.
    protected char[]
    The recording buffer.
    protected int
    The current char.
    protected int
    The end offset of the last lexical unit.
    protected int
    The current position in the buffer.
    The reader.
    protected int
    The start offset of the last lexical unit.
    protected int
    The type of the current lexical unit.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new Scanner object.
    Creates a new Scanner object.
    Creates a new Scanner object.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clears the buffer.
    void
    Closes the underlying stream used by the scanner.
    protected int
    Scans the decimal part of a number.
    protected int
    Returns the end gap of the current lexical unit.
    protected void
    Scans an escape sequence, if one.
    char[]
    Returns the buffer used to store the chars.
    int
    Returns the current column.
    int
    Returns the end offset of the last lexical unit.
    int
    Returns the current line.
    int
    Returns the start offset of the last lexical unit.
    Returns the string representation of the current lexical unit.
    int
    The current lexical unit type like defined in LexicalUnits.
    protected static boolean
    isEqualIgnoreCase(int i, char c)
    Compares the given int with the given character, ignoring case.
    int
    Returns the next token.
    protected int
    Sets the value of the current char to the next character or -1 if the end of stream has been reached.
    protected void
    Returns the next token.
    protected int
    Scans a number.
    protected int
    numberUnit(boolean integer)
    Scans the unit of a number.
    void
    Scans a @rule value.
    protected int
    Scans a single quoted string.
    protected int
    Scans a double quoted string.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • reader

      protected NormalizingReader reader
      The reader.
    • current

      protected int current
      The current char.
    • buffer

      protected char[] buffer
      The recording buffer.
    • position

      protected int position
      The current position in the buffer.
    • type

      protected int type
      The type of the current lexical unit.
    • start

      protected int start
      The start offset of the last lexical unit.
    • end

      protected int end
      The end offset of the last lexical unit.
    • blankCharacters

      protected int blankCharacters
      The characters to skip to create the string which represents the current token.
  • Constructor Details

  • Method Details

    • getLine

      public int getLine()
      Returns the current line.
    • getColumn

      public int getColumn()
      Returns the current column.
    • getBuffer

      public char[] getBuffer()
      Returns the buffer used to store the chars.
    • getStart

      public int getStart()
      Returns the start offset of the last lexical unit.
    • getEnd

      public int getEnd()
      Returns the end offset of the last lexical unit.
    • clearBuffer

      public void clearBuffer()
      Clears the buffer.
    • getType

      public int getType()
      The current lexical unit type like defined in LexicalUnits.
    • getStringValue

      public String getStringValue()
      Returns the string representation of the current lexical unit.
    • scanAtRule

      public void scanAtRule() throws ParseException
      Scans a @rule value. This method assumes that the current lexical unit is a at keyword.
      Throws:
      ParseException
    • next

      public int next() throws ParseException
      Returns the next token.
      Throws:
      ParseException
    • close

      public void close()
      Closes the underlying stream used by the scanner.
    • endGap

      protected int endGap()
      Returns the end gap of the current lexical unit.
    • nextToken

      protected void nextToken() throws ParseException
      Returns the next token.
      Throws:
      ParseException
    • string1

      protected int string1() throws IOException
      Scans a single quoted string.
      Throws:
      IOException
    • string2

      protected int string2() throws IOException
      Scans a double quoted string.
      Throws:
      IOException
    • number

      protected int number() throws IOException
      Scans a number.
      Throws:
      IOException
    • dotNumber

      protected int dotNumber() throws IOException
      Scans the decimal part of a number.
      Throws:
      IOException
    • numberUnit

      protected int numberUnit(boolean integer) throws IOException
      Scans the unit of a number.
      Throws:
      IOException
    • escape

      protected void escape() throws IOException
      Scans an escape sequence, if one.
      Throws:
      IOException
    • isEqualIgnoreCase

      protected static boolean isEqualIgnoreCase(int i, char c)
      Compares the given int with the given character, ignoring case.
    • nextChar

      protected int nextChar() throws IOException
      Sets the value of the current char to the next character or -1 if the end of stream has been reached.
      Throws:
      IOException