2
* Copyright (c) 1999 World Wide Web Consortium,
3
* (Massachusetts Institute of Technology, Institut National de
4
* Recherche en Informatique et en Automatique, Keio University). All
5
* Rights Reserved. This program is distributed under the W3C's Software
6
* Intellectual Property License. This program is distributed in the
7
* hope that it will be useful, but WITHOUT ANY WARRANTY; without even
8
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10
* See W3C License http://www.w3.org/Consortium/Legal/ for more details.
12
* $Id: Selector.java 477010 2006-11-20 02:54:38Z mrglavas $
14
package org.w3c.css.sac;
17
* This interface defines a selector.
18
* <p><b>Remarks</b>: Not all the following selectors are supported (or will be
20
* <p>All examples are CSS2 compliant.
22
* @version $Revision: 477010 $
23
* @author Philippe Le Hegaret
25
public interface Selector {
27
/* simple selectors */
30
* This is a conditional selector.
32
* <pre class="example">
33
* simple[role="private"]
39
* @see ConditionalSelector
41
public static final short SAC_CONDITIONAL_SELECTOR = 0;
44
* This selector matches any node.
47
public static final short SAC_ANY_NODE_SELECTOR = 1;
50
* This selector matches the root node.
53
public static final short SAC_ROOT_NODE_SELECTOR = 2;
56
* This selector matches only node that are different from a specified one.
57
* @see NegativeSelector
59
public static final short SAC_NEGATIVE_SELECTOR = 3;
62
* This selector matches only element node.
64
* <pre class="example">
68
* @see ElementSelector
70
public static final short SAC_ELEMENT_NODE_SELECTOR = 4;
73
* This selector matches only text node.
74
* @see CharacterDataSelector
76
public static final short SAC_TEXT_NODE_SELECTOR = 5;
79
* This selector matches only cdata node.
80
* @see CharacterDataSelector
82
public static final short SAC_CDATA_SECTION_NODE_SELECTOR = 6;
85
* This selector matches only processing instruction node.
86
* @see ProcessingInstructionSelector
88
public static final short SAC_PROCESSING_INSTRUCTION_NODE_SELECTOR = 7;
91
* This selector matches only comment node.
92
* @see CharacterDataSelector
94
public static final short SAC_COMMENT_NODE_SELECTOR = 8;
96
* This selector matches the 'first line' pseudo element.
98
* <pre class="example">
101
* @see ElementSelector
103
public static final short SAC_PSEUDO_ELEMENT_SELECTOR = 9;
105
/* combinator selectors */
108
* This selector matches an arbitrary descendant of some ancestor element.
110
* <pre class="example">
113
* @see DescendantSelector
115
public static final short SAC_DESCENDANT_SELECTOR = 10;
118
* This selector matches a childhood relationship between two elements.
120
* <pre class="example">
123
* @see DescendantSelector
125
public static final short SAC_CHILD_SELECTOR = 11;
127
* This selector matches two selectors who shared the same parent in the
128
* document tree and the element represented by the first sequence
129
* immediately precedes the element represented by the second one.
131
* <pre class="example">
134
* @see SiblingSelector
136
public static final short SAC_DIRECT_ADJACENT_SELECTOR = 12;
139
* An integer indicating the type of <code>Selector</code>
141
public short getSelectorType();