Class ExpressionFactory

java.lang.Object
io.sf.carte.doc.style.css.property.ExpressionFactory

public class ExpressionFactory extends Object
Expressions factory.
  • Constructor Details

    • ExpressionFactory

      public ExpressionFactory(LexicalUnit nextLexicalUnit)
      Creates an expression factory.
      Parameters:
      nextLexicalUnit - the next lexical unit, or null if none.
  • Method Details

    • getNextLexicalUnit

      public LexicalUnit getNextLexicalUnit()
      Gives the next lexical unit. It could be the next lexical unit of the parent value, or an operator that was found while producing an expression.

      This method should be called after calling createExpression(LexicalUnit), not before.

      Returns:
      the next lexical unit.
    • createExpression

      public CSSExpression createExpression(LexicalUnit calcParams)
      Create an expression from the given lexical unit.
      Parameters:
      calcParams - the lexical unit(s) of the operands.
      Returns:
      the expression.
    • getCSSValueFactory

      protected CSSValueFactory getCSSValueFactory()
      Get a value factory.
      Returns:
      the value factory.
    • isInvalidOperand

      protected boolean isInvalidOperand(CSSPrimitiveValue primi, LexicalUnit.LexicalType lutype, LexicalUnit.LexicalType lastlutype)
    • isCalcValue

      protected boolean isCalcValue()
      Check whether this is the expression in a calc() value or a sub-expression in some mathematical function.
      Returns:
      true if the expression belongs to a calc() value.