Class ConstantDefinitions
java.lang.Object
com.google.common.css.compiler.passes.ConstantDefinitions
A container for GSS constant definitions, since a constant could be
defined multiple times in the tree, this class has two set of interfaces
that can be used to get either all definitions of a constant or only last
definition of a constant.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConstantDefinition(CssDefinitionNode definition) Adds a constant definition to this css tree.getConstantDefinition(String constant) Returns the last definition of a constant.getConstantDefinitions(String constant) Returns all definitions of a constant.com.google.common.collect.Multimap<String,CssDefinitionNode>
-
Constructor Details
-
ConstantDefinitions
public ConstantDefinitions()
-
-
Method Details
-
getConstantMultimap
-
getConstantDefinition
Returns the last definition of a constant. Callers should not attempt to modify the returned value.- Returns:
- definition node or
nullif the constant is not defined
-
getConstantDefinitions
Returns all definitions of a constant.- Returns:
- collection of definition node or empty collection if the constant is not defined
-
addConstantDefinition
Adds a constant definition to this css tree.Note that a constant may be defined multiple times in the tree. For the compact representation of the tree, all references to a constant will be replaced with the same value: the last one specified in the stylesheet (to ignore the definitions in inactive condition blocks the
EliminateConditionalNodescompiler pass needs to be run first). -
getConstantsNames
- Returns:
- the iterable of names of all defined constants
-