org.apache.batik.css.parser
Class Scanner

java.lang.Object
  |
  +--org.apache.batik.css.parser.Scanner

public class Scanner
extends java.lang.Object

This class represents a CSS scanner - an object which decodes CSS lexical units.


Field Summary
protected  int blankCharacters
          The characters to skip to create the string which represents the current token.
protected  char[] buffer
          The buffer used to store the value of the current lexical unit.
protected  InputBuffer inputBuffer
          The input buffer.
protected  int type
          The type of the current lexical unit.
protected  java.lang.String uri
          The document uri.
protected  java.lang.String value
          The value of the current lexical unit.
 
Constructor Summary
Scanner(java.io.Reader r, java.lang.String uri)
          Creates a new Scanner object.
 
Method Summary
 int currentType()
          The current lexical unit type like defined in LexicalUnits.
 java.lang.String currentValue()
          Returns the current lexical unit value.
protected  int dotNumber()
          Scans the decimal part of a number.
protected  int escape(int c)
          Scans an escape sequence, if one.
 int getColumn()
          Returns the current column number.
 InputBuffer getInputBuffer()
          Returns the input buffer.
 int getLine()
          Returns the current line number.
protected static boolean isEqualIgnoreCase(int i, char c)
          Compares the given int with the given character, ignoring case.
 int next()
          Returns the next token.
protected  int number()
          Scans a number.
protected  int numberUnit(int c, boolean integer)
          Scans the unit of a number.
 java.lang.String scanAtRule()
          Scans a @rule value.
protected  int string1()
          Scans a single quoted string.
protected  int string2()
          Scans a double quoted string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inputBuffer

protected InputBuffer inputBuffer
The input buffer.

uri

protected java.lang.String uri
The document uri.

buffer

protected char[] buffer
The buffer used to store the value of the current lexical unit.

value

protected java.lang.String value
The value of the current lexical unit.

type

protected int type
The type of the current lexical unit.

blankCharacters

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

Scanner

public Scanner(java.io.Reader r,
               java.lang.String uri)
        throws ParseException
Creates a new Scanner object.
Parameters:
r - The reader to scan.
uri - The document URI, or null.
Method Detail

getInputBuffer

public InputBuffer getInputBuffer()
Returns the input buffer.

getLine

public int getLine()
Returns the current line number.

getColumn

public int getColumn()
Returns the current column number.

currentType

public int currentType()
The current lexical unit type like defined in LexicalUnits.

currentValue

public java.lang.String currentValue()
Returns the current lexical unit value.

scanAtRule

public java.lang.String scanAtRule()
                            throws ParseException
Scans a @rule value. This method assumes that the current lexical unit is a at keyword.

next

public int next()
         throws ParseException
Returns the next token.

string1

protected int string1()
               throws java.io.IOException
Scans a single quoted string.

string2

protected int string2()
               throws java.io.IOException
Scans a double quoted string.

number

protected int number()
              throws java.io.IOException
Scans a number.

dotNumber

protected int dotNumber()
                 throws java.io.IOException
Scans the decimal part of a number.

numberUnit

protected int numberUnit(int c,
                         boolean integer)
                  throws java.io.IOException
Scans the unit of a number.

escape

protected int escape(int c)
              throws java.io.IOException
Scans an escape sequence, if one.

isEqualIgnoreCase

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


Copyright © 2001 Apache Software Foundation. All Rights Reserved.