Skip to content
Permalink
Browse files
[CXF-5430] Moving the count extension constant to FiqlParser
git-svn-id: https://svn.apache.org/repos/asf/cxf/trunk@1567102 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Sergey Beryozkin committed Feb 11, 2014
1 parent d15ad11 commit cd409578835e14f99fbea4d137f84262acce693f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
@@ -36,8 +36,7 @@
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 @@ protected Object parseType(String originalPropName,
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 @@ private CollectionCheck getCollectionCheck(String propName, boolean isCollection
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);
@@ -64,6 +64,8 @@


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 @@ private TypeInfoObject parseType(String originalName, String setter, String valu

}


protected boolean isCount(String propName) {
return propName.startsWith(EXTENSION_COUNT_OPEN);
}


private String unwrapSetter(String setter) {

0 comments on commit cd40957

Please sign in to comment.