KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > w3c > css > sac > SelectorFactory


1 /*
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
9  * PURPOSE.
10  * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
11  *
12  * $Id: SelectorFactory.java,v 1.1.1.1 2003/12/28 21:23:54 davidsch Exp $
13  */

14 package org.w3c.css.sac;
15
16 /**
17  * @version $Revision: 1.1.1.1 $
18  * @author Philippe Le Hegaret
19  * @see org.w3c.css.sac.Selector
20  */

21 public interface SelectorFactory {
22
23     /**
24      * Creates a conditional selector.
25      *
26      * @param selector a selector.
27      * @param condition a condition
28      * @return the conditional selector.
29      * @exception CSSException If this selector is not supported.
30      */

31     ConditionalSelector createConditionalSelector(SimpleSelector selector,
32                           Condition condition)
33     throws CSSException;
34
35     /**
36      * Creates an any node selector.
37      *
38      * @return the any node selector.
39      * @exception CSSException If this selector is not supported.
40      */

41     SimpleSelector createAnyNodeSelector() throws CSSException;
42
43     /**
44      * Creates an root node selector.
45      *
46      * @return the root node selector.
47      * @exception CSSException If this selector is not supported.
48      */

49     SimpleSelector createRootNodeSelector() throws CSSException;
50
51     /**
52      * Creates an negative selector.
53      *
54      * @param selector a selector.
55      * @return the negative selector.
56      * @exception CSSException If this selector is not supported.
57      */

58     NegativeSelector createNegativeSelector(SimpleSelector selector)
59     throws CSSException;
60
61     /**
62      * Creates an element selector.
63      *
64      * @param namespaceURI the <a HREF="http://www.w3.org/TR/REC-xml-names/#dt-NSName">namespace
65      * URI</a> of the element selector.
66      * @param tagName the <a HREF="http://www.w3.org/TR/REC-xml-names/#NT-LocalPart">local
67      * part</a> of the element name. <code>NULL</code> if this element
68      * selector can match any element.</p>
69      * @return the element selector
70      * @exception CSSException If this selector is not supported.
71      */

72     ElementSelector createElementSelector(String JavaDoc namespaceURI, String JavaDoc tagName)
73     throws CSSException;
74
75     /**
76      * Creates a text node selector.
77      *
78      * @param data the data
79      * @return the text node selector
80      * @exception CSSException If this selector is not supported.
81      */

82     CharacterDataSelector createTextNodeSelector(String JavaDoc data)
83     throws CSSException;
84
85     /**
86      * Creates a cdata section node selector.
87      *
88      * @param data the data
89      * @return the cdata section node selector
90      * @exception CSSException If this selector is not supported.
91      */

92     CharacterDataSelector createCDataSectionSelector(String JavaDoc data)
93     throws CSSException;
94
95     /**
96      * Creates a processing instruction node selector.
97      *
98      * @param target the target
99      * @param data the data
100      * @return the processing instruction node selector
101      * @exception CSSException If this selector is not supported.
102      */

103     ProcessingInstructionSelector
104     createProcessingInstructionSelector(String JavaDoc target,
105                         String JavaDoc data)
106     throws CSSException;
107
108     /**
109      * Creates a comment node selector.
110      *
111      * @param data the data
112      * @return the comment node selector
113      * @exception CSSException If this selector is not supported.
114      */

115     CharacterDataSelector createCommentSelector(String JavaDoc data)
116     throws CSSException;
117
118     /**
119      * Creates a pseudo element selector.
120      *
121      * @param pseudoName the pseudo element name. <code>NULL</code> if this
122      * element selector can match any pseudo element.</p>
123      * @return the element selector
124      * @exception CSSException If this selector is not supported.
125      */

126     ElementSelector createPseudoElementSelector(String JavaDoc namespaceURI,
127                         String JavaDoc pseudoName)
128     throws CSSException;
129
130     /**
131      * Creates a descendant selector.
132      *
133      * @param parent the parent selector
134      * @param descendant the descendant selector
135      * @return the combinator selector.
136      * @exception CSSException If this selector is not supported.
137      */

138     DescendantSelector createDescendantSelector(Selector parent,
139                          SimpleSelector descendant)
140     throws CSSException;
141
142     /**
143      * Creates a child selector.
144      *
145      * @param parent the parent selector
146      * @param child the child selector
147      * @return the combinator selector.
148      * @exception CSSException If this selector is not supported.
149      */

150     DescendantSelector createChildSelector(Selector parent,
151                        SimpleSelector child)
152     throws CSSException;
153
154     /**
155      * Creates a sibling selector.
156      *
157      * @param nodeType the type of nodes in the siblings list.
158      * @param child the child selector
159      * @param adjacent the direct adjacent selector
160      * @return the sibling selector with nodeType
161                equals to org.w3c.dom.Node.ELEMENT_NODE
162      * @exception CSSException If this selector is not supported.
163      */

164     SiblingSelector createDirectAdjacentSelector(short nodeType,
165                          Selector child,
166                          SimpleSelector directAdjacent)
167     throws CSSException;
168 }
169
Popular Tags