View Javadoc

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  
20  package jakarta.faces.component.search;
21  
22  import jakarta.faces.component.UIComponent;
23  
24  /**
25   *
26   */
27  public abstract class SearchKeywordResolver
28  {
29      
30      public abstract void resolve(SearchKeywordContext keywordContext, UIComponent current, String keyword);
31      
32      /**
33       * Check if the keyword can be resolved by the current resolver
34       * 
35       * @param searchExpressionContext
36       * @param keyword
37       * @return 
38       */
39      public abstract boolean isResolverForKeyword(SearchExpressionContext searchExpressionContext, String keyword);
40      
41      /**
42       * A passthrough keyword is a keyword that according to the context does not require to be resolved on the server,
43       * and can be passed to the client
44       * 
45       * @param searchExpressionContext
46       * @param keyword
47       * @return 
48       */
49      public boolean isPassthrough(SearchExpressionContext searchExpressionContext, String keyword)
50      {
51          return false;
52      }
53      
54      /**
55       * A leaf keyword is a keyword that does not allow to be combined with keywords or id chains to the right.
56       * For example: @none:@parent.
57       * 
58       * @param searchExpressionContext
59       * @param keyword
60       * @return 
61       */
62      public boolean isLeaf(SearchExpressionContext searchExpressionContext, String keyword)
63      {
64          return false;
65      }
66  }