cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject git commit: Add few more methods to search QueryContext to avoid passing null if the query can be discovered
Date Tue, 15 Jul 2014 10:47:44 GMT
Repository: cxf
Updated Branches:
  refs/heads/master b39006ba5 -> 217d41ac0


Add few more methods to search QueryContext to avoid passing null if the query can be discovered


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/217d41ac
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/217d41ac
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/217d41ac

Branch: refs/heads/master
Commit: 217d41ac09eeba46e95d9fd8b612a01ca9858094
Parents: b39006b
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Tue Jul 15 11:47:27 2014 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Tue Jul 15 11:47:27 2014 +0100

----------------------------------------------------------------------
 .../cxf/jaxrs/ext/search/QueryContext.java      | 27 ++++++++++++++++++++
 .../jaxrs/ext/search/QueryContextProvider.java  | 17 ++++++++++++
 2 files changed, 44 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/217d41ac/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/QueryContext.java
----------------------------------------------------------------------
diff --git a/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/QueryContext.java
b/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/QueryContext.java
index 55d909d..1f60f43 100644
--- a/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/QueryContext.java
+++ b/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/QueryContext.java
@@ -30,6 +30,33 @@ public interface QueryContext {
      * 
      * @return converted search expression
      */
+    String getConvertedExpression();
+    
+    /**
+     * Uses a custom bean and a visitor registered with 
+     * "search.visitor" contextual property to capture and 
+     * convert the original expression
+     * 
+     * @return converted search expression
+     */
+    <T> String getConvertedExpression(Class<T> beanClass);
+    
+    /**
+     * Uses a custom bean and query classes and a visitor registered with 
+     * "search.visitor" contextual property to capture and 
+     * convert the original expression
+     * 
+     * @return converted search expression
+     */
+    <T, E> E getConvertedExpression(Class<T> beanClass, Class<E> queryClass);
+    
+    /**
+     * Uses {@link SearchBean} and a visitor registered with 
+     * "search.visitor" contextual property to capture and 
+     * convert the original expression
+     * 
+     * @return converted search expression
+     */
     String getConvertedExpression(String originalExpression);
     
     /**

http://git-wip-us.apache.org/repos/asf/cxf/blob/217d41ac/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/QueryContextProvider.java
----------------------------------------------------------------------
diff --git a/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/QueryContextProvider.java
b/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/QueryContextProvider.java
index 2c70a33..42dbef8 100644
--- a/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/QueryContextProvider.java
+++ b/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/QueryContextProvider.java
@@ -39,6 +39,21 @@ public class QueryContextProvider implements ContextProvider<QueryContext>
{
             this.message = message;
         }
 
+        @Override
+        public String getConvertedExpression() {
+            return getConvertedExpression((String)null);
+        }
+
+        @Override
+        public <T> String getConvertedExpression(Class<T> beanClass) {
+            return getConvertedExpression((String)null, beanClass);
+        }
+
+        @Override
+        public <T, E> E getConvertedExpression(Class<T> beanClass, Class<E>
queryClass) {
+            return getConvertedExpression((String)null, beanClass, queryClass);
+        }
+        
         public String getConvertedExpression(String originalExpression) {
             return getConvertedExpression(originalExpression, SearchBean.class);
         }
@@ -76,5 +91,7 @@ public class QueryContextProvider implements ContextProvider<QueryContext>
{
                 return (SearchConditionVisitor<T, Y>)visitor;
             }
         }
+
+        
     }
 }


Mime
View raw message