cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1567102 - in /cxf/trunk/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search: AbstractSearchConditionParser.java fiql/FiqlParser.java
Date Tue, 11 Feb 2014 13:14:04 GMT
Author: sergeyb
Date: Tue Feb 11 13:14:04 2014
New Revision: 1567102

URL: http://svn.apache.org/r1567102
Log:
[CXF-5430] Moving the count extension constant to FiqlParser

Modified:
    cxf/trunk/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/AbstractSearchConditionParser.java
    cxf/trunk/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/fiql/FiqlParser.java

Modified: cxf/trunk/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/AbstractSearchConditionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/AbstractSearchConditionParser.java?rev=1567102&r1=1567101&r2=1567102&view=diff
==============================================================================
--- cxf/trunk/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/AbstractSearchConditionParser.java
(original)
+++ cxf/trunk/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/AbstractSearchConditionParser.java
Tue Feb 11 13:14:04 2014
@@ -36,8 +36,7 @@ import org.apache.cxf.jaxrs.ext.search.c
 import org.apache.cxf.jaxrs.utils.InjectionUtils;
 
 public abstract class AbstractSearchConditionParser<T> implements SearchConditionParser<T>
{
-    public static final String EXTENSION_COUNT = "count";
-    protected static final String EXTENSION_COUNT_OPEN = EXTENSION_COUNT + "(";
+    
     
     protected final Map<String, String> contextProperties;
     protected final Class<T> conditionClass;
@@ -185,7 +184,7 @@ public abstract class AbstractSearchCond
     private CollectionCheck getCollectionCheck(String propName, boolean isCollection, Class<?>
actualCls) {
         if (isCollection) {
             if (InjectionUtils.isPrimitive(actualCls)) {
-                if (propName.startsWith(EXTENSION_COUNT_OPEN)) {
+                if (isCount(propName)) {
                     return CollectionCheck.SIZE;
                 }
             } else {
@@ -195,6 +194,10 @@ public abstract class AbstractSearchCond
         return null;
     }
     
+    protected boolean isCount(String propName) {
+        return false;
+    }
+    
     private Object getCollectionSingleton(Class<?> collectionCls, Object value) {
         if (Set.class.isAssignableFrom(collectionCls)) {
             return Collections.singleton(value);

Modified: cxf/trunk/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/fiql/FiqlParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/fiql/FiqlParser.java?rev=1567102&r1=1567101&r2=1567102&view=diff
==============================================================================
--- cxf/trunk/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/fiql/FiqlParser.java
(original)
+++ cxf/trunk/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/fiql/FiqlParser.java
Tue Feb 11 13:14:04 2014
@@ -64,6 +64,8 @@ public class FiqlParser<T> extends Abstr
         
     
     public static final String SUPPORT_SINGLE_EQUALS = "fiql.support.single.equals.operator";
      
+    public static final String EXTENSION_COUNT = "count";
+    protected static final String EXTENSION_COUNT_OPEN = EXTENSION_COUNT + "(";
     
     private static final Map<String, ConditionType> OPERATORS_MAP;
     private static final Pattern COMPARATORS_PATTERN;
@@ -299,7 +301,9 @@ public class FiqlParser<T> extends Abstr
         
     }
     
-    
+    protected boolean isCount(String propName) {
+        return propName.startsWith(EXTENSION_COUNT_OPEN);
+    }
     
     
     private String unwrapSetter(String setter) {



Mime
View raw message