Class StyleElement

java.lang.Object
org.htmlunit.css.StyleElement
All Implemented Interfaces:
Serializable, Comparable<StyleElement>

public class StyleElement extends Object implements Comparable<StyleElement>, Serializable
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Contains information about a single style element, including its name, its value, and an index which can be compared against other indices in order to determine precedence.
Author:
Mike Bowler, Christian Sell, Daniel Gredler, Chris Erskine, Ahmed Ashour, Rodney Gitzel, Sudhan Moghe, Ronald Brill, Frank Danek
See Also:
  • Field Details

  • Constructor Details

    • StyleElement

      public StyleElement(String name, String value, String priority, org.htmlunit.cssparser.parser.selector.SelectorSpecificity specificity, long index)
      Creates a new instance.
      Parameters:
      name - the style element's name
      value - the style element's value
      priority - the style element's priority like "important"
      specificity - the specificity of the rule providing this style information
      index - the style element's index
    • StyleElement

      public StyleElement(String name, String value, String priority, org.htmlunit.cssparser.parser.selector.SelectorSpecificity specificity)
      Creates a new instance.
      Parameters:
      name - the style element's name
      value - the style element's value
      priority - the style element's priority like "important"
      specificity - the specificity of the rule providing this style information
  • Method Details

    • getName

      public String getName()
      Returns the style element's name.
      Returns:
      the style element's name
    • getValue

      public String getValue()
      Returns the style element's value.
      Returns:
      the style element's value
    • getPriority

      public String getPriority()
      Returns the style element's priority.
      Returns:
      the style element's priority
    • isImportant

      public boolean isImportant()
      Returns:
      true if priority is 'important'
    • getSpecificity

      public org.htmlunit.cssparser.parser.selector.SelectorSpecificity getSpecificity()
      Returns the specificity of the rule specifying this element.
      Returns:
      the specificity
    • getIndex

      public long getIndex()
      Returns the style element's index.
      Returns:
      the style element's index
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo(StyleElement e)
      Specified by:
      compareTo in interface Comparable<StyleElement>