Class ConstantDefinitions


  • public class ConstantDefinitions
    extends java.lang.Object
    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 Detail

      • ConstantDefinitions

        public ConstantDefinitions()
    • Method Detail

      • getConstantMultimap

        public com.google.common.collect.Multimap<java.lang.String,​CssDefinitionNode> getConstantMultimap()
      • getConstantDefinition

        public CssDefinitionNode getConstantDefinition​(java.lang.String constant)
        Returns the last definition of a constant. Callers should not attempt to modify the returned value.
        Returns:
        definition node or null if the constant is not defined
      • getConstantDefinitions

        public java.util.List<CssDefinitionNode> getConstantDefinitions​(java.lang.String constant)
        Returns all definitions of a constant.
        Returns:
        collection of definition node or empty collection if the constant is not defined
      • addConstantDefinition

        public void addConstantDefinition​(CssDefinitionNode definition)
        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 EliminateConditionalNodes compiler pass needs to be run first).

      • getConstantsNames

        public java.lang.Iterable<java.lang.String> getConstantsNames()
        Returns:
        the iterable of names of all defined constants