Class StyleElement

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<StyleElement>

    public class StyleElement
    extends java.lang.Object
    implements java.lang.Comparable<StyleElement>, java.io.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.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.concurrent.atomic.AtomicLong ElementIndex_
      The current style element index.
      private long index_  
      private java.lang.String name_  
      private java.lang.String priority_  
      static java.lang.String PRIORITY_IMPORTANT
      CSS important property constant.
      private org.htmlunit.cssparser.parser.selector.SelectorSpecificity specificity_  
      private java.lang.String value_  
    • Constructor Summary

      Constructors 
      Constructor Description
      StyleElement​(java.lang.String name, java.lang.String value, java.lang.String priority, org.htmlunit.cssparser.parser.selector.SelectorSpecificity specificity)
      Creates a new instance.
      StyleElement​(java.lang.String name, java.lang.String value, java.lang.String priority, org.htmlunit.cssparser.parser.selector.SelectorSpecificity specificity, long index)
      Creates a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(StyleElement e)
      long getIndex()
      Returns the style element's index.
      java.lang.String getName()
      Returns the style element's name.
      java.lang.String getPriority()
      Returns the style element's priority.
      org.htmlunit.cssparser.parser.selector.SelectorSpecificity getSpecificity()
      Returns the specificity of the rule specifying this element.
      java.lang.String getValue()
      Returns the style element's value.
      boolean isImportant()  
      java.lang.String toString()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • PRIORITY_IMPORTANT

        public static final java.lang.String PRIORITY_IMPORTANT
        CSS important property constant.
        See Also:
        Constant Field Values
      • ElementIndex_

        private static final java.util.concurrent.atomic.AtomicLong ElementIndex_
        The current style element index.
      • name_

        private final java.lang.String name_
      • value_

        private final java.lang.String value_
      • priority_

        private final java.lang.String priority_
      • index_

        private final long index_
      • specificity_

        private final org.htmlunit.cssparser.parser.selector.SelectorSpecificity specificity_
    • Constructor Detail

      • StyleElement

        public StyleElement​(java.lang.String name,
                            java.lang.String value,
                            java.lang.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​(java.lang.String name,
                            java.lang.String value,
                            java.lang.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 Detail

      • getName

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

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

        public java.lang.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 java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • compareTo

        public int compareTo​(StyleElement e)
        Specified by:
        compareTo in interface java.lang.Comparable<StyleElement>