|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.vaadin.sass.internal.parser.SassExpression
public class SassExpression
SassExpressions are used for representing and evaluating arithmetic expressions.
| Method Summary | |
|---|---|
String |
buildString(Node.BuildStringStrategy strategy)
Return a string representation of this item using the given strategy of converting items to strings. |
boolean |
containsArithmeticalOperator()
Checks whether the item contains an arithmetic expression. |
boolean |
containsVariable()
Checks whether this item contains a variable. |
static SassListItem |
createExpression(List<SassListItem> items)
Creates a new expression containing the elements of the parameter items but with trailing whitespace items eliminated. |
static SassListItem |
createExpression(SassListItem... items)
Creates a new expression containing the elements of the parameter items but with trailing whitespace items eliminated. |
boolean |
equals(Object o)
Tests whether this and o are equal expressions. |
SassListItem |
evaluateFunctionsAndExpressions(ScssContext context,
boolean evaluateArithmetics)
Evaluates the arithmetic expressions and functions of this item without modifying this item. |
int |
getColumnNumber()
|
LexicalUnitImpl |
getContainedValue()
|
int |
getLineNumber()
|
static int |
getNextNonspaceIndex(List<SassListItem> list,
int startIndex)
Returns the index of the next non-whitespace item in list, starting from startIndex (inclusive). |
int |
hashCode()
|
static boolean |
isWhitespace(SassListItem item)
|
String |
printState()
Returns a string representation of this item. |
SassExpression |
replaceVariables(ScssContext context)
Returns a new item that is otherwise equal to this one but all occurrences of variables have been replaced by the values in the current variable scope. |
String |
toString()
|
String |
unquotedString()
Returns a string representation of this item with surrounding quotation marks of the same type (" or ') removed. |
SassExpression |
updateUrl(String prefix)
Returns a new item that is obtained from this by updating all url's by, e.g., adding the prefix to an url not starting with slash "/" and not containing the symbol ":". |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static SassListItem createExpression(SassListItem... items)
items - one or more SassListItems.
public static SassListItem createExpression(List<SassListItem> items)
items - A list of SassListItems.
public int getLineNumber()
getLineNumber in interface SassListItempublic int getColumnNumber()
getColumnNumber in interface SassListItempublic boolean containsArithmeticalOperator()
SassListItem
containsArithmeticalOperator in interface SassListItem
public static int getNextNonspaceIndex(List<SassListItem> list,
int startIndex)
list - A list.startIndex - The first index included in the search.
public SassListItem evaluateFunctionsAndExpressions(ScssContext context,
boolean evaluateArithmetics)
SassListItem
evaluateFunctionsAndExpressions in interface SassListItemcontext - the compilation context in which to evaluate functions,
variables etc.evaluateArithmetics - True indicates that the arithmetic expressions in this item
should be evaluated. This parameter is used to handle the case
where the operator '/' should not be interpreted as an
arithmetic operation. The arithmetic expressions occurring in
the parameter lists of functions will be evaluated even if
evaluateArithmetics is false.
public SassExpression replaceVariables(ScssContext context)
SassListItem
replaceVariables in interface SassListItemcontext - the compilation context in which to evaluate functions,
variables etc.
public SassExpression updateUrl(String prefix)
SassListItem
updateUrl in interface SassListItemprefix - The prefix to be added.public String printState()
SassListItemLexicalUnitImpl.printState(). For a list, the string
representation contains the list items separated with the separator
character of the list. No parentheses appear in the string representation
of a list, for valid CSS output.
printState in interface SassListItempublic String buildString(Node.BuildStringStrategy strategy)
SassListItemLexicalUnitImpl#buildString(BuildStringStrategy).
buildString in interface SassListItemstrategy - Specifies how an item is converted to a string. The strategy
may use the toString- and printState-methods.
public String toString()
toString in class Objectpublic String unquotedString()
SassListItem
unquotedString in interface SassListItempublic LexicalUnitImpl getContainedValue()
getContainedValue in interface SassListItempublic static boolean isWhitespace(SassListItem item)
public boolean containsVariable()
SassListItem
containsVariable in interface SassListItempublic boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||