java.lang.Object
io.sf.carte.doc.style.css.om.AbstractSelectorMatcher
io.sf.carte.doc.style.css.om.DOMSelectorMatcher
- All Implemented Interfaces:
SelectorMatcher
CSS Selector matcher for DOM.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
getAttributeValue
(String attrName) Gets the value of the given attribute in the element associated to this selector matcher.protected DirectionalityHelper.Directionality
Get the directionality of the element associated to this matcher.protected String
getId()
Gets the 'id' attribute of the element associated to this selector matcher.protected String
Gets the language of the element associated to this selector matcher.protected String
protected CSSDocument
protected AbstractSelectorMatcher
Gets the selector matcher for the parent element.protected AbstractSelectorMatcher
Gets the selector matcher for the previous sibling.protected boolean
hasAttribute
(String attrName) Checks if is defined the given attribute in the element associated to this selector matcher.protected int
indexOf
(SelectorList selectors) protected boolean
isActivePseudoClass
(String pseudoclassName) protected boolean
isBlank()
protected boolean
protected boolean
protected boolean
isEmpty()
protected boolean
The element in this matcher is the first child?protected boolean
The element in this matcher is the first child of its type (tag name)?protected boolean
The element in this matcher is the last child?protected boolean
The element in this matcher is the last child of its type (tag name)?protected boolean
isNthLastOfType
(int step, int offset) protected boolean
isNthOfType
(int step, int offset) protected boolean
isRoot()
protected boolean
isTarget()
protected int
reverseIndexOf
(SelectorList selectors) protected boolean
scopeMatchChild
(DescendantSelector selector) protected boolean
scopeMatchDirectAdjacent
(SiblingSelector selector) Methods inherited from class io.sf.carte.doc.style.css.om.AbstractSelectorMatcher
findStatePseudoClasses, getClassAttribute, getLocalName, getPseudoElement, isAnyLink, isChecked, isDir, isEnabled, isFormElement, isIndeterminate, isNotVisitedLink, isOnlyChild, isOnlyOfType, isPlaceholderShown, isReadWrite, isUIDefault, isVisitedLink, matches, matches, setLocalName, setPseudoElement, toString
-
Constructor Details
-
DOMSelectorMatcher
-
-
Method Details
-
getParentSelectorMatcher
Description copied from class:AbstractSelectorMatcher
Gets the selector matcher for the parent element.- Specified by:
getParentSelectorMatcher
in classAbstractSelectorMatcher
- Returns:
- the selector matcher for the parent element, or null if none.
-
getPreviousSiblingSelectorMatcher
Description copied from class:AbstractSelectorMatcher
Gets the selector matcher for the previous sibling.- Specified by:
getPreviousSiblingSelectorMatcher
in classAbstractSelectorMatcher
- Returns:
- the selector matcher for the previous sibling, or null if no previous sibling.
-
indexOf
- Specified by:
indexOf
in classAbstractSelectorMatcher
-
reverseIndexOf
- Specified by:
reverseIndexOf
in classAbstractSelectorMatcher
-
isActivePseudoClass
- Overrides:
isActivePseudoClass
in classAbstractSelectorMatcher
-
isFirstChild
protected boolean isFirstChild()Description copied from class:AbstractSelectorMatcher
The element in this matcher is the first child?- Specified by:
isFirstChild
in classAbstractSelectorMatcher
- Returns:
true
if the element in this matcher is a first child,false
if not.
-
isLastChild
protected boolean isLastChild()Description copied from class:AbstractSelectorMatcher
The element in this matcher is the last child?- Specified by:
isLastChild
in classAbstractSelectorMatcher
- Returns:
true
if the element in this matcher is the last child,false
if not.
-
isFirstOfType
protected boolean isFirstOfType()Description copied from class:AbstractSelectorMatcher
The element in this matcher is the first child of its type (tag name)?- Specified by:
isFirstOfType
in classAbstractSelectorMatcher
- Returns:
true
if the element in this matcher is a first child of its type,false
if not.
-
isLastOfType
protected boolean isLastOfType()Description copied from class:AbstractSelectorMatcher
The element in this matcher is the last child of its type (tag name)?- Specified by:
isLastOfType
in classAbstractSelectorMatcher
- Returns:
true
if the element in this matcher is the last child of its type,false
if not.
-
isNthOfType
protected boolean isNthOfType(int step, int offset) - Specified by:
isNthOfType
in classAbstractSelectorMatcher
-
isNthLastOfType
protected boolean isNthLastOfType(int step, int offset) - Specified by:
isNthLastOfType
in classAbstractSelectorMatcher
-
isTarget
protected boolean isTarget()- Specified by:
isTarget
in classAbstractSelectorMatcher
-
isRoot
protected boolean isRoot()- Specified by:
isRoot
in classAbstractSelectorMatcher
-
isEmpty
protected boolean isEmpty()- Specified by:
isEmpty
in classAbstractSelectorMatcher
-
isBlank
protected boolean isBlank()- Specified by:
isBlank
in classAbstractSelectorMatcher
-
isDisabled
protected boolean isDisabled()- Specified by:
isDisabled
in classAbstractSelectorMatcher
-
isDefaultButton
protected boolean isDefaultButton()- Specified by:
isDefaultButton
in classAbstractSelectorMatcher
-
getNamespaceURI
- Specified by:
getNamespaceURI
in classAbstractSelectorMatcher
-
getAttributeValue
Description copied from class:AbstractSelectorMatcher
Gets the value of the given attribute in the element associated to this selector matcher.- Specified by:
getAttributeValue
in classAbstractSelectorMatcher
- Parameters:
attrName
- the attribute name.- Returns:
- the attribute value, or the empty string if the attribute is defined but has no value, also if the attribute is not defined. Never returns null.
-
hasAttribute
Description copied from class:AbstractSelectorMatcher
Checks if is defined the given attribute in the element associated to this selector matcher.- Specified by:
hasAttribute
in classAbstractSelectorMatcher
- Parameters:
attrName
- the attribute name.- Returns:
true
if the attribute is defined,false
if not.
-
getOwnerDocument
- Specified by:
getOwnerDocument
in classAbstractSelectorMatcher
-
getId
Description copied from class:AbstractSelectorMatcher
Gets the 'id' attribute of the element associated to this selector matcher.- Specified by:
getId
in classAbstractSelectorMatcher
- Returns:
- the 'id' attribute value, or the empty string if the element has no 'id'.
-
getLanguage
Description copied from class:AbstractSelectorMatcher
Gets the language of the element associated to this selector matcher.- Specified by:
getLanguage
in classAbstractSelectorMatcher
- Returns:
- the language, or the empty String if the element has no language defined.
-
getDirectionality
Description copied from class:AbstractSelectorMatcher
Get the directionality of the element associated to this matcher.- Specified by:
getDirectionality
in classAbstractSelectorMatcher
- Returns:
- the directionality.
-
scopeMatchChild
- Specified by:
scopeMatchChild
in classAbstractSelectorMatcher
-
scopeMatchDirectAdjacent
- Specified by:
scopeMatchDirectAdjacent
in classAbstractSelectorMatcher
-