Package org.htmlunit.css
Class StyleElement
- java.lang.Object
-
- org.htmlunit.css.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.AtomicLongElementIndex_The current style element index.private longindex_private java.lang.Stringname_private java.lang.Stringpriority_static java.lang.StringPRIORITY_IMPORTANTCSS important property constant.private org.htmlunit.cssparser.parser.selector.SelectorSpecificityspecificity_private java.lang.Stringvalue_
-
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 intcompareTo(StyleElement e)longgetIndex()Returns the style element's index.java.lang.StringgetName()Returns the style element's name.java.lang.StringgetPriority()Returns the style element's priority.org.htmlunit.cssparser.parser.selector.SelectorSpecificitygetSpecificity()Returns the specificity of the rule specifying this element.java.lang.StringgetValue()Returns the style element's value.booleanisImportant()java.lang.StringtoString()
-
-
-
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 namevalue- the style element's valuepriority- the style element's priority like "important"specificity- the specificity of the rule providing this style informationindex- 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 namevalue- the style element's valuepriority- 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:
toStringin classjava.lang.Object
-
compareTo
public int compareTo(StyleElement e)
- Specified by:
compareToin interfacejava.lang.Comparable<StyleElement>
-
-