Class PropertyTokenizer

java.lang.Object
org.apache.fop.fo.expr.PropertyTokenizer
Direct Known Subclasses:
PropertyParser

class PropertyTokenizer extends Object
Class to tokenize XSL FO property expression. This class is heavily based on the epxression tokenizer in James Clark's XT, an XSLT processor.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected int
     
    private int
     
    protected String
     
    protected int
     
    private static final String
     
    private String
     
    private int
     
    private int
     
    private static final String
     
    private static final String
     
    private static final String
     
    (package private) static final int
     
    (package private) static final int
     
    (package private) static final int
     
    (package private) static final int
     
    (package private) static final int
     
    (package private) static final int
     
    (package private) static final int
     
    (package private) static final int
     
    (package private) static final int
     
    (package private) static final int
     
    (package private) static final int
     
    (package private) static final int
     
    (package private) static final int
     
    (package private) static final int
     
    (package private) static final int
     
    (package private) static final int
     
    (package private) static final int
     
    (package private) static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Construct a new PropertyTokenizer object to tokenize the passed String.
  • Method Summary

    Modifier and Type
    Method
    Description
    private boolean
    Return a boolean value indicating whether the following non-whitespace character is an opening parenthesis.
    private static boolean
    isDigit(char c)
    Return a boolean value indicating whether the argument is a decimal digit (0-9).
    private static boolean
    isHexDigit(char c)
    Return a boolean value indicating whether the argument is a hexadecimal digit (0-9, A-F, a-f).
    private static boolean
    isNameChar(char c)
    Return a boolean value indicating whether the argument is a valid name character, ie.
    private static boolean
    Return a boolean value indicating whether the argument is a valid name start character, ie.
    (package private) void
    Parse the next token in the expression string.
    private void
     
    private void
     
    private void
    Attempt to recognize a valid sequence of decimal DIGITS in the input expression.
    private void
    Attempt to recognize a valid sequence of hexadecimal DIGITS in the input expression.
    private void
    Attempt to recognize a valid NAME token in the input expression.
    private void
     

    Methods inherited from class java.lang.Object

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

  • Constructor Details

    • PropertyTokenizer

      PropertyTokenizer(String s)
      Construct a new PropertyTokenizer object to tokenize the passed String.
      Parameters:
      s - The Property expressio to tokenize.
  • Method Details

    • next

      void next() throws PropertyException
      Parse the next token in the expression string. This sets the following package visible variables: currentToken An enumerated value identifying the recognized token currentTokenValue A String containing the token contents currentUnitLength If currentToken = TOK_NUMERIC, the number of characters in the unit name.
      Throws:
      PropertyException - If un unrecognized token is encountered.
    • nextDecimalPoint

      private void nextDecimalPoint() throws PropertyException
      Throws:
      PropertyException
    • nextColor

      private void nextColor() throws PropertyException
      Throws:
      PropertyException
    • scanName

      private void scanName()
      Attempt to recognize a valid NAME token in the input expression.
    • scanRestOfName

      private void scanRestOfName()
    • scanDigits

      private void scanDigits()
      Attempt to recognize a valid sequence of decimal DIGITS in the input expression.
    • scanHexDigits

      private void scanHexDigits()
      Attempt to recognize a valid sequence of hexadecimal DIGITS in the input expression.
    • followingParen

      private boolean followingParen()
      Return a boolean value indicating whether the following non-whitespace character is an opening parenthesis.
    • isDigit

      private static boolean isDigit(char c)
      Return a boolean value indicating whether the argument is a decimal digit (0-9).
      Parameters:
      c - The character to check
    • isHexDigit

      private static boolean isHexDigit(char c)
      Return a boolean value indicating whether the argument is a hexadecimal digit (0-9, A-F, a-f).
      Parameters:
      c - The character to check
    • isNameStartChar

      private static boolean isNameStartChar(char c)
      Return a boolean value indicating whether the argument is a valid name start character, ie. can start a NAME as defined by XSL.
      Parameters:
      c - The character to check
    • isNameChar

      private static boolean isNameChar(char c)
      Return a boolean value indicating whether the argument is a valid name character, ie. can occur in a NAME as defined by XSL.
      Parameters:
      c - The character to check