1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.query

File QueryFilter.java

 

Code metrics

0
0
0
1
60
9
0
-
-
0
-

Classes

Class Line # Actions
QueryFilter 42 0 - 0 0
-1.0 -
 

Contributing tests

No tests hitting this source file were found.

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19    */
20    package org.xwiki.query;
21   
22    import java.util.List;
23   
24    import org.xwiki.component.annotation.Role;
25   
26    /**
27    * Query Filter interface. A filter can be added to a query through {@link Query#addFilter(QueryFilter)}, it will be
28    * called by the {@link QueryExecutor} before the query is executed. Queries can be filtered during 2 stages:
29    * <ul>
30    * <li>Before the execution, by modifying the statement</li>
31    * <li>After the execution, by modifying list of results</li>
32    * </ul>
33    *
34    * An example of this is the {@link org.xwiki.query.internal.UniqueDocumentFilter} which transform statements in order
35    * to make them return distinct documents names and which also filters query results in order to return only those
36    * names.
37    *
38    * @version $Id: 3f5d18f5209aab352a1451d10de08a9c291f77df $
39    * @since 4.0RC1
40    */
41    @Role
 
42    public interface QueryFilter
43    {
44    /**
45    * Transform a query statement. The statement can be returned without modification.
46    *
47    * @param statement the query statement to transform.
48    * @param language the language of the query statement.
49    * @return the transformed statement.
50    */
51    String filterStatement(String statement, String language);
52   
53    /**
54    * Filter a list of query results. The result list can be returned without modification.
55    *
56    * @param results the original result list.
57    * @return a filtered result list.
58    */
59    List filterResults(List results);
60    }