Package jodd.csselly.selector
Class PseudoFunctions.NTH_CHILD
- java.lang.Object
-
- jodd.csselly.selector.PseudoFunction<PseudoFunctionExpression>
-
- jodd.csselly.selector.PseudoFunctions.NTH_CHILD
-
- Enclosing interface:
- PseudoFunctions
public static class PseudoFunctions.NTH_CHILD extends PseudoFunction<PseudoFunctionExpression>
The:nth-child(an+b)pseudo-class notation represents an element that has an+b-1 siblings before it in the document tree, for any positive integer or zero value of n, and has a parent element. For values of a and b greater than zero, this effectively divides the element's children into groups of a elements (the last group taking the remainder), and selecting the bth element of each group. For example, this allows the selectors to address every other row in a table, and could be used to alternate the color of paragraph text in a cycle of four. The a and b values must be integers (positive, negative, or zero). The index of the first child of an element is 1.
-
-
Constructor Summary
Constructors Constructor Description NTH_CHILD()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanmatch(Node node, PseudoFunctionExpression expression)Matches node using provided parsed expression.PseudoFunctionExpressionparseExpression(java.lang.String expression)Parses expression before usage.-
Methods inherited from class jodd.csselly.selector.PseudoFunction
getPseudoFunctionName, matchInRange
-
-
-
-
Method Detail
-
parseExpression
public PseudoFunctionExpression parseExpression(java.lang.String expression)
Description copied from class:PseudoFunctionParses expression before usage.- Specified by:
parseExpressionin classPseudoFunction<PseudoFunctionExpression>
-
match
public boolean match(Node node, PseudoFunctionExpression expression)
Description copied from class:PseudoFunctionMatches node using provided parsed expression.- Specified by:
matchin classPseudoFunction<PseudoFunctionExpression>
-
-