KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > slide > search > basic > IBasicExpressionFactory


1 /*
2  * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/search/basic/IBasicExpressionFactory.java,v 1.4 2004/07/28 09:35:01 ib Exp $
3  * $Revision: 1.4 $
4  * $Date: 2004/07/28 09:35:01 $
5  *
6  * ====================================================================
7  *
8  * Copyright 1999-2002 The Apache Software Foundation
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  *
22  */

23
24 package org.apache.slide.search.basic;
25
26 import java.util.Collection JavaDoc;
27
28 import org.apache.slide.search.BadQueryException;
29 import org.apache.slide.search.PropertyProvider;
30 import org.jdom.Element;
31
32 /**
33  * An IBasicExpression represents an executable part of the expression tree.
34  * Different stores may have different implementations.
35  *
36  * @version $Revision: 1.4 $
37  */

38 public interface IBasicExpressionFactory {
39
40     /** parameter name for the expression factory implementation */
41     public String JavaDoc BASIC_EXPRESSION_FACTORY_CLASS =
42         "basicExpressionFactoryClass";
43
44     /**
45      * Initializes the factory. Is called exactly once and before any call
46      * to crateExpression ()
47      *
48      * @param query the IBasicQuery.
49      * @param propertyProvider the PropertyProvider to use (may be
50      * <code>null</code>).
51      *
52      * @throws BadQueryException
53      */

54     void init (IBasicQuery query, PropertyProvider propertyProvider) throws BadQueryException;
55     
56     /**
57      * Returns the IBasicQuery to use (set in method {@link #init init()}).
58      *
59      * @return the IBasicQuery to use.
60      */

61     public IBasicQuery getQuery();
62     
63     /**
64      * Returns the PropertyProvider to use (set in method {@link #init init()}).
65      *
66      * @return the PropertyProvider to use.
67      */

68     public PropertyProvider getPropertyProvider();
69     
70     
71     /**
72      * Creates a MergeExpression for the given element (AND, OR). The given children
73      * are the expressions to merge.
74      *
75      * @param name the name of the Element describing the merge expression.
76      * @param namespace the namespace of the Element describing the merge expression.
77      * @param expressionsToMerge the expressions to merge.
78      *
79      * @return an IBasicExpression
80      *
81      * @throws BadQueryException
82      */

83     IBasicExpression createMergeExpression (String JavaDoc name, String JavaDoc namespace, Collection JavaDoc expressionsToMerge)
84         throws BadQueryException;
85     
86     /**
87      * Creates a (non-merge) expression (compare...) for the given Element.
88      *
89      * @param element an Element describing the expression.
90      *
91      * @return an IBasicExpression
92      *
93      * @throws BadQueryException
94      */

95     IBasicExpression createExpression (Element element)
96         throws BadQueryException;
97     
98 }
99
100
101
Popular Tags