This project has retired. For details please refer to its Attic page.
QueryConditionProcessor xref

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   * http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.chemistry.opencmis.inmemory.query;
20  
21  import java.util.List;
22  
23  import org.antlr.runtime.tree.Tree;
24  import org.apache.chemistry.opencmis.server.support.query.PredicateWalkerBase;
25  
26  /**
27   * An interface used by the walker when traversing the AST from the grammar.
28   * The interface consists of callback methods that are called when a rule
29   * is processed (as part of the WHERE statement)
30   * @author Jens
31   *
32   */
33  public interface QueryConditionProcessor extends PredicateWalkerBase {
34  
35      void onStartProcessing(Tree whereNode);
36      void onStopProcessing();
37  
38      // Compare operators
39      void onEquals(Tree eqNode, Tree leftNode, Tree rightNode);
40      void onNotEquals(Tree neNode, Tree leftNode, Tree rightNode);
41      void onGreaterThan(Tree gtNode, Tree leftNode, Tree rightNode);
42      void onGreaterOrEquals(Tree geNode, Tree leftNode, Tree rightNode);
43      void onLessThan(Tree ltNode, Tree leftNode, Tree rightNode);
44      void onLessOrEquals(Tree leqNode, Tree leftNode, Tree rightNode);
45  
46      // Boolean operators
47      void onPreNot(Tree opNode, Tree leftNode);
48      void onNot(Tree opNode, Tree leftNode);
49      void onPostNot(Tree opNode, Tree leftNode);
50      void onPreAnd(Tree opNode, Tree leftNode, Tree rightNode);
51      void onAnd(Tree opNode, Tree leftNode, Tree rightNode);
52      void onPostAnd(Tree opNode, Tree leftNode, Tree rightNode);
53      void onPreOr(Tree opNode, Tree leftNode, Tree rightNode);
54      void onOr(Tree opNode, Tree leftNode, Tree rightNode);
55      void onPostOr(Tree opNode, Tree leftNode, Tree rightNode);
56  
57      // Multi-value:
58      void onIn(Tree node, Tree colNode, Tree listNode);
59      void onNotIn(Tree node, Tree colNode, Tree listNode);
60      void onInAny(Tree node, Tree colNode, Tree listNode);
61      void onNotInAny(Tree node, Tree colNode, Tree listNode);
62      void onEqAny(Tree node, Tree literalNode, Tree colNode);
63  
64      // Null comparisons:
65      void onIsNull(Tree nullNode, Tree colNode);
66      void onIsNotNull(Tree notNullNode, Tree colNode);
67  
68      // String matching:
69      void onIsLike(Tree node, Tree colNode, Tree stringNode);
70      void onIsNotLike(Tree node, Tree colNode, Tree stringNode);
71  
72      // Functions:
73      void onContains(Tree node, Tree typeNode, Tree searchExprNode);
74      void onInFolder(Tree node, Tree colNode, Tree paramNode);
75      void onInTree(Tree node, Tree colNode, Tree paramNode);
76      void onScore(Tree node);
77      
78      // full text search
79      void onTextAnd(Tree node, List<Tree> conjunctionNodes);
80      void onTextOr(Tree node, List<Tree> termNodes);
81      void onTextMinus(Tree node, Tree notNode);
82      void onTextWord(String word);
83      void onTextPhrase(String phrase);
84  }