Package org.htmlunit.css
Class StyleElement
java.lang.Object
org.htmlunit.css.StyleElement
- All Implemented Interfaces:
Serializable
,Comparable<StyleElement>
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.
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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final AtomicLong
The current style element index.private final long
private final String
private final String
static final String
CSS important property constant.private final org.htmlunit.cssparser.parser.selector.SelectorSpecificity
private final String
-
Constructor Summary
ConstructorsConstructorDescriptionStyleElement
(String name, String value, String priority, org.htmlunit.cssparser.parser.selector.SelectorSpecificity specificity) Creates a new instance.StyleElement
(String name, String value, String priority, org.htmlunit.cssparser.parser.selector.SelectorSpecificity specificity, long index) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionint
long
getIndex()
Returns the style element's index.getName()
Returns the style element's name.Returns the style element's priority.org.htmlunit.cssparser.parser.selector.SelectorSpecificity
Returns the specificity of the rule specifying this element.getValue()
Returns the style element's value.boolean
toString()
-
Field Details
-
PRIORITY_IMPORTANT
CSS important property constant.- See Also:
-
ElementIndex_
The current style element index. -
name_
-
value_
-
priority_
-
index_
private final long index_ -
specificity_
private final org.htmlunit.cssparser.parser.selector.SelectorSpecificity specificity_
-
-
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 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(String name, String value, 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 Details
-
getName
Returns the style element's name.- Returns:
- the style element's name
-
getValue
Returns the style element's value.- Returns:
- the style element's value
-
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
-
compareTo
- Specified by:
compareTo
in interfaceComparable<StyleElement>
-