Class CssDeclarationNode

java.lang.Object
com.google.common.css.compiler.ast.CssNode
com.google.common.css.compiler.ast.CssDeclarationNode
All Implemented Interfaces:
Locatable

public class CssDeclarationNode extends CssNode
A node representing a CSS declaration in the abstract syntax tree. For example: background: red or --card-padding: 24px.
  • Constructor Details

    • CssDeclarationNode

      public CssDeclarationNode(CssPropertyNode propertyName)
      Constructor of a node representing a CSS declaration.
    • CssDeclarationNode

      public CssDeclarationNode(CssPropertyNode propertyName, @Nullable SourceCodeLocation sourceCodeLocation)
      Constructor of a node representing a CSS declaration.
      Parameters:
      propertyName - propertyName
      sourceCodeLocation - sourceCodeLocation
    • CssDeclarationNode

      public CssDeclarationNode(CssPropertyNode propertyName, List<CssCommentNode> comments)
      Constructor of a node representing a CSS declaration.
      Parameters:
      propertyName - propertyName
      comments - comments
    • CssDeclarationNode

      public CssDeclarationNode(CssPropertyNode propertyName, List<CssCommentNode> comments, @Nullable SourceCodeLocation sourceCodeLocation)
      Constructor of a node representing a CSS declaration.
      Parameters:
      propertyName - propertyName
      comments - comments
      sourceCodeLocation - sourceCodeLocation
    • CssDeclarationNode

      public CssDeclarationNode(CssPropertyNode propertyName, CssPropertyValueNode propertyValue, @Nullable SourceCodeLocation sourceCodeLocation)
      Constructor of a node representing a CSS declaration.
      Parameters:
      propertyName -
      propertyValue -
      sourceCodeLocation -
    • CssDeclarationNode

      public CssDeclarationNode(CssPropertyNode propertyName, CssPropertyValueNode propertyValue, @Nullable List<CssCommentNode> comments, @Nullable SourceCodeLocation sourceCodeLocation)
      Constructor of a node representing a CSS declaration.
      Parameters:
      propertyName - propertyName
      propertyValue - propertyValue
      comments - comments
      sourceCodeLocation - sourceCodeLocation
    • CssDeclarationNode

      public CssDeclarationNode(CssPropertyNode propertyName, CssPropertyValueNode propertyValue, @Nullable List<CssCommentNode> comments, @Nullable SourceCodeLocation sourceCodeLocation, boolean hasStarHack)
      Constructor of a node representing a CSS declaration.
    • CssDeclarationNode

      public CssDeclarationNode(CssDeclarationNode node)
      Copy constructor.
    • CssDeclarationNode

      public CssDeclarationNode(CssPropertyNode propertyNode, CssPropertyValueNode cssPropertyValueNode)
  • Method Details

    • deepCopy

      public CssDeclarationNode deepCopy()
      Specified by:
      deepCopy in class CssNode
    • getPropertyName

      public CssPropertyNode getPropertyName()
    • setPropertyName

      public void setPropertyName(CssPropertyNode propertyName)
    • getPropertyValue

      public CssPropertyValueNode getPropertyValue()
    • setPropertyValue

      public void setPropertyValue(CssPropertyValueNode propertyValue)
    • setStarHack

      public void setStarHack(boolean hasStarHack)
      Sets the hasStarHack attribute to the given value.
      Parameters:
      hasStarHack -
    • hasStarHack

      public boolean hasStarHack()
      Returns the value of this node's hasStarHack attribute.
      Returns:
      true if this node's hasStarHack is set to true.
    • isCustomDeclaration

      public boolean isCustomDeclaration()
      Returns:
      whether this node represents the declaration of a CSS custom property.
    • toString

      public String toString()
      For debugging only.
      Overrides:
      toString in class CssNode
      See Also: