001: /*
002: * Copyright (c) 1999 World Wide Web Consortium,
003: * (Massachusetts Institute of Technology, Institut National de
004: * Recherche en Informatique et en Automatique, Keio University). All
005: * Rights Reserved. This program is distributed under the W3C's Software
006: * Intellectual Property License. This program is distributed in the
007: * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
008: * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
009: * PURPOSE.
010: * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
011: *
012: * $Id$
013: */
014: package org.w3c.css.sac;
015:
016: /**
017: * @version $Revision$
018: * @author Philippe Le Hegaret
019: */
020: public interface ConditionFactory {
021:
022: /**
023: * Creates an and condition
024: *
025: * @param first the first condition
026: * @param second the second condition
027: * @return A combinator condition
028: * @exception CSSException if this exception is not supported.
029: */
030: CombinatorCondition createAndCondition(Condition first,
031: Condition second) throws CSSException;
032:
033: /**
034: * Creates an or condition
035: *
036: * @param first the first condition
037: * @param second the second condition
038: * @return A combinator condition
039: * @exception CSSException if this exception is not supported.
040: */
041: CombinatorCondition createOrCondition(Condition first,
042: Condition second) throws CSSException;
043:
044: /**
045: * Creates a negative condition
046: *
047: * @param condition the condition
048: * @return A negative condition
049: * @exception CSSException if this exception is not supported.
050: */
051: NegativeCondition createNegativeCondition(Condition condition)
052: throws CSSException;
053:
054: /**
055: * Creates a positional condition
056: *
057: * @param position the position of the node in the list.
058: * @param typeNode <code>true</code> if the list should contain
059: * only nodes of the same type (element, text node, ...).
060: * @param type <code>true</code> true if the list should contain
061: * only nodes of the same node (for element, same localName
062: * and same namespaceURI).
063: * @return A positional condition
064: * @exception CSSException if this exception is not supported.
065: */
066: PositionalCondition createPositionalCondition(int position,
067: boolean typeNode, boolean type) throws CSSException;
068:
069: /**
070: * Creates an attribute condition
071: *
072: * @param localName the localName of the attribute
073: * @param namespaceURI the namespace URI of the attribute
074: * @param specified <code>true</code> if the attribute must be specified
075: * in the document.
076: * @param value the value of this attribute.
077: * @return An attribute condition
078: * @exception CSSException if this exception is not supported.
079: */
080: AttributeCondition createAttributeCondition(String localName,
081: String namespaceURI, boolean specified, String value)
082: throws CSSException;
083:
084: /**
085: * Creates an id condition
086: *
087: * @param value the value of the id.
088: * @return An Id condition
089: * @exception CSSException if this exception is not supported.
090: */
091: AttributeCondition createIdCondition(String value)
092: throws CSSException;
093:
094: /**
095: * Creates a lang condition
096: *
097: * @param value the value of the language.
098: * @return A lang condition
099: * @exception CSSException if this exception is not supported.
100: */
101: LangCondition createLangCondition(String lang) throws CSSException;
102:
103: /**
104: * Creates a "one of" attribute condition
105: *
106: * @param localName the localName of the attribute
107: * @param namespaceURI the namespace URI of the attribute
108: * @param specified <code>true</code> if the attribute must be specified
109: * in the document.
110: * @param value the value of this attribute.
111: * @return A "one of" attribute condition
112: * @exception CSSException if this exception is not supported.
113: */
114: AttributeCondition createOneOfAttributeCondition(String localName,
115: String namespaceURI, boolean specified, String value)
116: throws CSSException;
117:
118: /**
119: * Creates a "begin hyphen" attribute condition
120: *
121: * @param localName the localName of the attribute
122: * @param namespaceURI the namespace URI of the attribute
123: * @param specified <code>true</code> if the attribute must be specified
124: * in the document.
125: * @param value the value of this attribute.
126: * @return A "begin hyphen" attribute condition
127: * @exception CSSException if this exception is not supported.
128: */
129: AttributeCondition createBeginHyphenAttributeCondition(
130: String localName, String namespaceURI, boolean specified,
131: String value) throws CSSException;
132:
133: /**
134: * Creates a class condition
135: *
136: * @param localName the localName of the attribute
137: * @param namespaceURI the namespace URI of the attribute
138: * @param specified <code>true</code> if the attribute must be specified
139: * in the document.
140: * @param value the name of the class.
141: * @return A class condition
142: * @exception CSSException if this exception is not supported.
143: */
144: AttributeCondition createClassCondition(String namespaceURI,
145: String value) throws CSSException;
146:
147: /**
148: * Creates a pseudo class condition
149: *
150: * @param namespaceURI the namespace URI of the attribute
151: * @param value the name of the pseudo class
152: * @return A pseudo class condition
153: * @exception CSSException if this exception is not supported.
154: */
155: AttributeCondition createPseudoClassCondition(String namespaceURI,
156: String value) throws CSSException;
157:
158: /**
159: * Creates a "only one" child condition
160: *
161: * @return A "only one" child condition
162: * @exception CSSException if this exception is not supported.
163: */
164: Condition createOnlyChildCondition() throws CSSException;
165:
166: /**
167: * Creates a "only one" type condition
168: *
169: * @return A "only one" type condition
170: * @exception CSSException if this exception is not supported.
171: */
172: Condition createOnlyTypeCondition() throws CSSException;
173:
174: /**
175: * Creates a content condition
176: *
177: * @param data the data in the content
178: * @return A content condition
179: * @exception CSSException if this exception is not supported.
180: */
181: ContentCondition createContentCondition(String data)
182: throws CSSException;
183:
184: }
|