add --shared
[pylucene.git] / lucene-java-3.4.0 / lucene / contrib / queryparser / src / java / org / apache / lucene / queryParser / ext / ExtensionQuery.java
1 package org.apache.lucene.queryParser.ext;
2
3 import org.apache.lucene.queryParser.QueryParser;
4
5 /**
6  * Licensed to the Apache Software Foundation (ASF) under one or more
7  * contributor license agreements.  See the NOTICE file distributed with
8  * this work for additional information regarding copyright ownership.
9  * The ASF licenses this file to You under the Apache License, Version 2.0
10  * (the "License"); you may not use this file except in compliance with
11  * the License.  You may obtain a copy of the License at
12  *
13  *     http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */
21
22 /**
23  * {@link ExtensionQuery} holds all query components extracted from the original
24  * query string like the query field and the extension query string.
25  * 
26  * @see Extensions
27  * @see ExtendableQueryParser
28  * @see ParserExtension
29  */
30 public class ExtensionQuery {
31
32   private final String field;
33   private final String rawQueryString;
34   private final QueryParser topLevelParser;
35
36   /**
37    * Creates a new {@link ExtensionQuery}
38    * 
39    * @param field
40    *          the query field
41    * @param rawQueryString
42    *          the raw extension query string
43    */
44   public ExtensionQuery(QueryParser topLevelParser, String field, String rawQueryString) {
45     this.field = field;
46     this.rawQueryString = rawQueryString;
47     this.topLevelParser = topLevelParser;
48   }
49
50   /**
51    * Returns the query field
52    * 
53    * @return the query field
54    */
55   public String getField() {
56     return field;
57   }
58
59   /**
60    * Returns the raw extension query string
61    * 
62    * @return the raw extension query string
63    */
64   public String getRawQueryString() {
65     return rawQueryString;
66   }
67   
68   /**
69    * Returns the top level parser which created this {@link ExtensionQuery} 
70    * @return the top level parser which created this {@link ExtensionQuery}
71    */
72   public QueryParser getTopLevelParser() {
73     return topLevelParser;
74   }
75 }