KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > slide > search > SearchLanguage


1 /*
2  * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/search/SearchLanguage.java,v 1.11 2004/07/28 09:35:09 ib Exp $
3  * $Revision: 1.11 $
4  * $Date: 2004/07/28 09:35:09 $
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;
25
26 import org.jdom.Element;
27
28 /**
29  * Base class for a search language.
30  *
31  * @version $Revision: 1.11 $
32  */

33 public abstract class SearchLanguage {
34     
35     
36     // ------------------------------------------------------- Security Methods
37

38     
39     /**
40      * Returns this language's name. This is the name of the first
41      * element within the searchrequest.
42      */

43     public abstract String JavaDoc getName();
44     
45     /**
46      * Returns the grammar URI for this language, this is
47      * what the DASL response Header returns.
48      *
49      * @return the URI identifying this language
50      */

51     public abstract String JavaDoc getGrammarUri ();
52     
53     /**
54      * Generate a query object from a String, set the maximum depth.
55      */

56     public abstract SearchQuery parseQuery(String JavaDoc queryString, SearchToken token, PropertyProvider propertyProvider)
57         throws BadQueryException;
58     
59     
60     /**
61      * Generate a query object from a JDOM Element.
62      *
63      * @param queryElement JDOM element containing the query
64      * @param token the SearchToken
65      * @param propertyProvider the PropertyProvider to use (may be
66      * <code>null</code>).
67      *
68      * @return a SearchQuery
69      *
70      * @throws BadQueryException
71      *
72      */

73     public abstract SearchQuery parseQuery(Element queryElement, SearchToken token, PropertyProvider propertyProvider)
74         throws BadQueryException;
75     
76 }
77
Popular Tags