- java.lang.Object
-
- org.joox.selector.Selector
-
class Selector extends java.lang.ObjectRepresents a selector. A selector has a tag name, a combinator and a list of specifiers.- See Also:
- Selector syntax description
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSelector.CombinatorCombinators
-
Field Summary
Fields Modifier and Type Field Description private Selector.CombinatorcombinatorCombinatorprivate java.util.List<Specifier>specifiersA list of specifiers.private java.lang.StringtagNameTag name.static java.lang.StringUNIVERSAL_TAGThe universal tag name (i.e.
-
Constructor Summary
Constructors Constructor Description Selector()Create a new instance with the tag name set to the value ofUNIVERSAL_TAG, and with the combinator set toSelector.Combinator.DESCENDANT.Selector(java.lang.String tagName, java.util.List<Specifier> specifiers)Create a new instance with the specified tag name and list of specifiers.Selector(java.lang.String tagName, Selector.Combinator combinator)Create a new instance with the specified tag name and combinator.Selector(java.lang.String tagName, Selector.Combinator combinator, java.util.List<Specifier> specifiers)Create a new instance with the specified tag name, combinator and list of specifiers.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Selector.CombinatorgetCombinator()Get the combinator.java.util.List<Specifier>getSpecifiers()Get the list of specifiers.java.lang.StringgetTagName()Get the tag name.booleanhasSpecifiers()Returns whether this selector has any specifiers or not.
-
-
-
Field Detail
-
UNIVERSAL_TAG
public static final java.lang.String UNIVERSAL_TAG
The universal tag name (i.e.*).- See Also:
- Constant Field Values
-
tagName
private final java.lang.String tagName
Tag name.
-
combinator
private final Selector.Combinator combinator
Combinator
-
specifiers
private final java.util.List<Specifier> specifiers
A list of specifiers.
-
-
Constructor Detail
-
Selector
public Selector()
Create a new instance with the tag name set to the value ofUNIVERSAL_TAG, and with the combinator set toSelector.Combinator.DESCENDANT. The list of specifiers will be set tonull.
-
Selector
public Selector(java.lang.String tagName, Selector.Combinator combinator)Create a new instance with the specified tag name and combinator. The list of specifiers will be set tonull.- Parameters:
tagName- The tag name to set.combinator- The combinator to set.
-
Selector
public Selector(java.lang.String tagName, java.util.List<Specifier> specifiers)Create a new instance with the specified tag name and list of specifiers. The combinator will be set toSelector.Combinator.DESCENDANT.- Parameters:
tagName- The tag name to set.specifiers- The list of specifiers to set.
-
Selector
public Selector(java.lang.String tagName, Selector.Combinator combinator, java.util.List<Specifier> specifiers)Create a new instance with the specified tag name, combinator and list of specifiers.- Parameters:
tagName- The tag name to set.combinator- The combinator to set.specifiers- The list of specifiers to set.
-
-
Method Detail
-
getTagName
public java.lang.String getTagName()
Get the tag name.- Returns:
- The tag name.
-
getCombinator
public Selector.Combinator getCombinator()
Get the combinator.- Returns:
- The combinator.
-
getSpecifiers
public java.util.List<Specifier> getSpecifiers()
Get the list of specifiers.- Returns:
- The list of specifiers or
null.
-
hasSpecifiers
public boolean hasSpecifiers()
Returns whether this selector has any specifiers or not.- Returns:
trueorfalse.
-
-