com.vaadin.sass.internal.parser.function
Class AbstractSingleParameterFunctionGenerator

java.lang.Object
  extended by com.vaadin.sass.internal.parser.function.AbstractFunctionGenerator
      extended by com.vaadin.sass.internal.parser.function.AbstractSingleParameterFunctionGenerator
All Implemented Interfaces:
SCSSFunctionGenerator
Direct Known Subclasses:
AbsFunctionGenerator, CeilFunctionGenerator, FloorFunctionGenerator, GrayscaleFunctionGenerator, PercentageFunctionGenerator, QuoteUnquoteFunctionGenerator, RoundFunctionGenerator, UnitFunctionGenerator, UnitlessFunctionGenerator

public abstract class AbstractSingleParameterFunctionGenerator
extends AbstractFunctionGenerator

AbstractSingleParameterFunctionGenerator is used as a base class for implementing Sass functions that take exactly one single value parameter. A single value parameter is of type LexicalUnitImpl.

Author:
Vaadin

Constructor Summary
AbstractSingleParameterFunctionGenerator(FormalArgumentList args, String... functionNames)
           
 
Method Summary
protected  SassListItem computeForArgumentList(LexicalUnitImpl function, FormalArgumentList arglist)
          Computes the value of the function with the given argument list.
protected abstract  LexicalUnitImpl computeForParam(String functionName, LexicalUnitImpl firstParam)
          Compute the value of the function.
 
Methods inherited from class com.vaadin.sass.internal.parser.function.AbstractFunctionGenerator
checkForUnsetParameters, compute, createArgumentList, createArgumentList, createArgumentList, getArguments, getFunctionNames, getParam, getParam
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractSingleParameterFunctionGenerator

public AbstractSingleParameterFunctionGenerator(FormalArgumentList args,
                                                String... functionNames)
Method Detail

computeForArgumentList

protected SassListItem computeForArgumentList(LexicalUnitImpl function,
                                              FormalArgumentList arglist)
Description copied from class: AbstractFunctionGenerator
Computes the value of the function with the given argument list. This method is called by compute(), which also forms the parameter list actualArguments by replacing the formal arguments of the function with their actual values.

Specified by:
computeForArgumentList in class AbstractFunctionGenerator
Parameters:
function - The function to be evaluated. The function object can be used to determine which function to evaluate when a function generator implements several Sass functions. It is also used to obtain line and column numbers for error messages.
arglist - The argument list of the function, obtained by replacing all formal arguments with the corresponding values of the actual argument list of the function.
Returns:
The value of the function.

computeForParam

protected abstract LexicalUnitImpl computeForParam(String functionName,
                                                   LexicalUnitImpl firstParam)
Compute the value of the function. This method must not modify firstParam. If necessary, the implementation should copy the parameter before making modifications.

Parameters:
functionName - The name of the function whose value is to be computed.
firstParam - The only parameter of the function.
Returns:


Copyright © 2013–2015 Vaadin. All rights reserved.