KickJava   Java API By Example, From Geeks To Geeks.

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


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: ConditionFactory.java,v 1.1.1.1 2003/12/28 21:23:45 davidsch Exp $
13  */

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

20 public interface ConditionFactory {
21
22     /**
23      * Creates an and condition
24      *
25      * @param first the first condition
26      * @param second the second condition
27      * @return A combinator condition
28      * @exception CSSException if this exception is not supported.
29      */

30     CombinatorCondition createAndCondition(Condition first, Condition second)
31     throws CSSException;
32
33     /**
34      * Creates an or condition
35      *
36      * @param first the first condition
37      * @param second the second condition
38      * @return A combinator condition
39      * @exception CSSException if this exception is not supported.
40      */

41     CombinatorCondition createOrCondition(Condition first, Condition second)
42     throws CSSException;
43
44     /**
45      * Creates a negative condition
46      *
47      * @param condition the condition
48      * @return A negative condition
49      * @exception CSSException if this exception is not supported.
50      */

51     NegativeCondition createNegativeCondition(Condition condition)
52     throws CSSException;
53
54     /**
55      * Creates a positional condition
56      *
57      * @param position the position of the node in the list.
58      * @param typeNode <code>true</code> if the list should contain
59      * only nodes of the same type (element, text node, ...).
60      * @param type <code>true</code> true if the list should contain
61      * only nodes of the same node (for element, same localName
62      * and same namespaceURI).
63      * @return A positional condition
64      * @exception CSSException if this exception is not supported.
65      */

66     PositionalCondition createPositionalCondition(int position,
67                           boolean typeNode,
68                           boolean type)
69     throws CSSException;
70     
71     /**
72      * Creates an attribute condition
73      *
74      * @param localName the localName of the attribute
75      * @param namespaceURI the namespace URI of the attribute
76      * @param specified <code>true</code> if the attribute must be specified
77      * in the document.
78      * @param value the value of this attribute.
79      * @return An attribute condition
80      * @exception CSSException if this exception is not supported.
81      */

82     AttributeCondition createAttributeCondition(String JavaDoc localName,
83                         String JavaDoc namespaceURI,
84                         boolean specified,
85                         String JavaDoc value)
86     throws CSSException;
87
88     /**
89      * Creates an id condition
90      *
91      * @param value the value of the id.
92      * @return An Id condition
93      * @exception CSSException if this exception is not supported.
94      */

95     AttributeCondition createIdCondition(String JavaDoc value)
96     throws CSSException;
97
98     /**
99      * Creates a lang condition
100      *
101      * @param value the value of the language.
102      * @return A lang condition
103      * @exception CSSException if this exception is not supported.
104      */

105     LangCondition createLangCondition(String JavaDoc lang)
106     throws CSSException;
107
108     /**
109      * Creates a "one of" attribute condition
110      *
111      * @param localName the localName of the attribute
112      * @param namespaceURI the namespace URI of the attribute
113      * @param specified <code>true</code> if the attribute must be specified
114      * in the document.
115      * @param value the value of this attribute.
116      * @return A "one of" attribute condition
117      * @exception CSSException if this exception is not supported.
118      */

119     AttributeCondition createOneOfAttributeCondition(String JavaDoc localName,
120                              String JavaDoc namespaceURI,
121                              boolean specified,
122                              String JavaDoc value)
123     throws CSSException;
124
125     /**
126      * Creates a "begin hyphen" attribute condition
127      *
128      * @param localName the localName of the attribute
129      * @param namespaceURI the namespace URI of the attribute
130      * @param specified <code>true</code> if the attribute must be specified
131      * in the document.
132      * @param value the value of this attribute.
133      * @return A "begin hyphen" attribute condition
134      * @exception CSSException if this exception is not supported.
135      */

136     AttributeCondition createBeginHyphenAttributeCondition(String JavaDoc localName,
137                                String JavaDoc namespaceURI,
138                                boolean specified,
139                                String JavaDoc value)
140     throws CSSException;
141
142     /**
143      * Creates a class condition
144      *
145      * @param localName the localName of the attribute
146      * @param namespaceURI the namespace URI of the attribute
147      * @param specified <code>true</code> if the attribute must be specified
148      * in the document.
149      * @param value the name of the class.
150      * @return A class condition
151      * @exception CSSException if this exception is not supported.
152      */

153     AttributeCondition createClassCondition(String JavaDoc namespaceURI,
154                         String JavaDoc value)
155     throws CSSException;
156
157     /**
158      * Creates a pseudo class condition
159      *
160      * @param namespaceURI the namespace URI of the attribute
161      * @param value the name of the pseudo class
162      * @return A pseudo class condition
163      * @exception CSSException if this exception is not supported.
164      */

165     AttributeCondition createPseudoClassCondition(String JavaDoc namespaceURI,
166                           String JavaDoc value)
167     throws CSSException;
168
169     /**
170      * Creates a "only one" child condition
171      *
172      * @return A "only one" child condition
173      * @exception CSSException if this exception is not supported.
174      */

175     Condition createOnlyChildCondition() throws CSSException;
176
177
178     /**
179      * Creates a "only one" type condition
180      *
181      * @return A "only one" type condition
182      * @exception CSSException if this exception is not supported.
183      */

184     Condition createOnlyTypeCondition() throws CSSException;
185
186     /**
187      * Creates a content condition
188      *
189      * @param data the data in the content
190      * @return A content condition
191      * @exception CSSException if this exception is not supported.
192      */

193     ContentCondition createContentCondition(String JavaDoc data)
194     throws CSSException;
195
196     
197 }
198
Popular Tags