|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.vaadin.sass.internal.parser.function.AbstractFunctionGenerator
public abstract class AbstractFunctionGenerator
AbstractFunctionGenerator is an abstract base class for implementing built-in Sass functions. It is assumed that all functions implemented by a subclass of AbstractFunctionGenerator have the same formal argument list, i.e. they have the same number of arguments and the arguments of the different functions have the same names.
| Constructor Summary | |
|---|---|
AbstractFunctionGenerator(FormalArgumentList arguments,
String... functionNames)
|
|
| Method Summary | |
|---|---|
protected boolean |
checkForUnsetParameters()
Returns true if this function should ensure that all parameters have been set. |
SassListItem |
compute(ScssContext context,
LexicalUnitImpl function)
Computes the value of the function. |
protected abstract SassListItem |
computeForArgumentList(LexicalUnitImpl function,
FormalArgumentList actualArguments)
Computes the value of the function with the given argument list. |
protected static FormalArgumentList |
createArgumentList(String[] argumentNames,
boolean hasVariableArguments)
Creates a new FormalArgumentList with no default values, i.e. |
protected static FormalArgumentList |
createArgumentList(String[] argumentNames,
SassListItem[] defaultValues)
Creates a new FormalArgumentList without variable arguments. |
protected static FormalArgumentList |
createArgumentList(String[] argumentNames,
SassListItem[] defaultValues,
boolean hasVariableArguments)
Creates a formal argument list with the given argument names and default values. |
protected FormalArgumentList |
getArguments()
|
String[] |
getFunctionNames()
Returns function names handled by this generator. |
protected static SassListItem |
getParam(FormalArgumentList args,
int index)
Returns the value of the argument at the given index. |
protected static SassListItem |
getParam(FormalArgumentList args,
String name)
Returns the value of the argument with the given name. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractFunctionGenerator(FormalArgumentList arguments,
String... functionNames)
| Method Detail |
|---|
public String[] getFunctionNames()
SCSSFunctionGeneratornull and is used if there is no dedicated generator
for given function.
getFunctionNames in interface SCSSFunctionGeneratorprotected FormalArgumentList getArguments()
public SassListItem compute(ScssContext context,
LexicalUnitImpl function)
SCSSFunctionGenerator
compute in interface SCSSFunctionGeneratorcontext - current compilation contextfunction - Function lexical unit to print its state
protected abstract SassListItem computeForArgumentList(LexicalUnitImpl function,
FormalArgumentList actualArguments)
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.actualArguments - The argument list of the function, obtained by replacing all
formal arguments with the corresponding values of the actual
argument list of the function.
protected boolean checkForUnsetParameters()
protected static FormalArgumentList createArgumentList(String[] argumentNames,
SassListItem[] defaultValues,
boolean hasVariableArguments)
argumentNames - The names of the arguments.defaultValues - The default values of the arguments.hasVariableArguments - True, if the function supports variable arguments, false
otherwise.
protected static FormalArgumentList createArgumentList(String[] argumentNames,
SassListItem[] defaultValues)
argumentNames - The names of the arguments.defaultValues - The default values of the arguments.
protected static FormalArgumentList createArgumentList(String[] argumentNames,
boolean hasVariableArguments)
argumentNames - The names of the arguments.hasVariableArguments - True, if the function supports variable arguments, false
otherwise.
protected static SassListItem getParam(FormalArgumentList args,
String name)
args - The argument list.name - The name of the argument.
protected static SassListItem getParam(FormalArgumentList args,
int index)
args - The argument list.index - The position of the argument in the argument list.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||