jodd.lagarto.csselly.selector
Class PseudoClassSelector

java.lang.Object
  extended by jodd.lagarto.csselly.Selector
      extended by jodd.lagarto.csselly.selector.PseudoClassSelector
All Implemented Interfaces:
NodeFilter, NodeListFilter

public class PseudoClassSelector
extends Selector
implements NodeFilter, NodeListFilter

Pseudo class selector. A pseudo-class always consists of a "colon" (:) followed by the name of the pseudo-class and optionally by a value between parentheses.

Selectors introduces the concept of structural pseudo-classes to permit selection based on extra information that lies in the document tree but cannot be represented by other simple selectors or combinators.

Standalone text and other non-element nodes are not counted when calculating the position of an element in the list of children of its parent. When calculating the position of an element in the list of children of its parent, the index numbering starts at 1.


Nested Class Summary
 
Nested classes/interfaces inherited from class jodd.lagarto.csselly.Selector
Selector.Type
 
Field Summary
protected static java.util.Map<java.lang.String,PseudoClass> PSEUDO_CLASS_MAP
           
protected  PseudoClass pseudoClass
           
 
Fields inherited from class jodd.lagarto.csselly.Selector
type
 
Constructor Summary
PseudoClassSelector(java.lang.String pseudoClassName)
           
 
Method Summary
 boolean accept(java.util.LinkedList<Node> currentResults, Node node, int index)
          Accepts node within selected results.
 boolean accept(Node node)
          Matches node to this selector.
 PseudoClass getPseudoClass()
          Returns pseudo class value.
static PseudoClass lookupPseudoClass(java.lang.String pseudoClassName)
          Lookups pseudo class for given pseudo class name.
static void registerPseudoClass(java.lang.Class<? extends PseudoClass> pseudoClassType)
          Registers pseudo class.
 
Methods inherited from class jodd.lagarto.csselly.Selector
getType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PSEUDO_CLASS_MAP

protected static final java.util.Map<java.lang.String,PseudoClass> PSEUDO_CLASS_MAP

pseudoClass

protected final PseudoClass pseudoClass
Constructor Detail

PseudoClassSelector

public PseudoClassSelector(java.lang.String pseudoClassName)
Method Detail

registerPseudoClass

public static void registerPseudoClass(java.lang.Class<? extends PseudoClass> pseudoClassType)
Registers pseudo class.


lookupPseudoClass

public static PseudoClass lookupPseudoClass(java.lang.String pseudoClassName)
Lookups pseudo class for given pseudo class name.


getPseudoClass

public PseudoClass getPseudoClass()
Returns pseudo class value.


accept

public boolean accept(Node node)
Matches node to this selector.

Specified by:
accept in interface NodeFilter

accept

public boolean accept(java.util.LinkedList<Node> currentResults,
                      Node node,
                      int index)
Accepts node within selected results. Invoked after results are matched.

Specified by:
accept in interface NodeListFilter


Copyright © 2003-2011 Jodd Team