Class CssConstantReferenceNode
- java.lang.Object
-
- com.google.common.css.compiler.ast.CssNode
-
- com.google.common.css.compiler.ast.CssValueNode
-
- com.google.common.css.compiler.ast.CssConstantReferenceNode
-
- All Implemented Interfaces:
Locatable
public class CssConstantReferenceNode extends CssValueNode
A node holding a reference to a constant or an argument of a mixin definition.Because references can be valid within one block, each reference has a scope where it is valid. For example, references to arguments of mixin definitions are only valid in the block of the mixin definition whereas references to global definitions are valid everywhere.
-
-
Constructor Summary
Constructors Constructor Description CssConstantReferenceNode(CssConstantReferenceNode node)Creates a new constant reference node that is a deep copy of the given node.CssConstantReferenceNode(java.lang.String value)CssConstantReferenceNode(java.lang.String value, SourceCodeLocation sourceCodeLocation)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CssConstantReferenceNodedeepCopy()CssNodegetScope()Returns the scope of the reference.static booleanisDefinitionReference(java.lang.String ident)Returns if the given identifier matches the pattern of a constant.voidsetScope(CssNode scope)-
Methods inherited from class com.google.common.css.compiler.ast.CssValueNode
getIsDefault, getValue, setIsDefault, setValue, toString
-
Methods inherited from class com.google.common.css.compiler.ast.CssNode
ancestors, appendComment, deepCopyNodes, equals, getComments, getParent, getShouldBeFlipped, getSourceCodeLocation, getVisitController, hasComment, hashCode, inFunArgs, setComments, setShouldBeFlipped, setSourceCodeLocation
-
-
-
-
Constructor Detail
-
CssConstantReferenceNode
public CssConstantReferenceNode(java.lang.String value, @Nullable SourceCodeLocation sourceCodeLocation)
-
CssConstantReferenceNode
public CssConstantReferenceNode(java.lang.String value)
-
CssConstantReferenceNode
public CssConstantReferenceNode(CssConstantReferenceNode node)
Creates a new constant reference node that is a deep copy of the given node.- Parameters:
node- node
-
-
Method Detail
-
deepCopy
public CssConstantReferenceNode deepCopy()
- Specified by:
deepCopyin classCssValueNode
-
getScope
public CssNode getScope()
Returns the scope of the reference. If the reference belongs to a global definition, the scope is the 'global scope'. If the reference belongs to an argument of a mixin definition, the scope is the mixin definition.- Returns:
- scope
-
setScope
public void setScope(CssNode scope)
-
isDefinitionReference
public static boolean isDefinitionReference(java.lang.String ident)
Returns if the given identifier matches the pattern of a constant.- Parameters:
ident- identifier
-
-