• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java ComparisonNode类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中cz.jirutka.rsql.parser.ast.ComparisonNode的典型用法代码示例。如果您正苦于以下问题:Java ComparisonNode类的具体用法?Java ComparisonNode怎么用?Java ComparisonNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

ComparisonNode类属于cz.jirutka.rsql.parser.ast包,在下文中一共展示了ComparisonNode类的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: evaluate

点赞 3

import cz.jirutka.rsql.parser.ast.ComparisonNode; //导入依赖的package包/类
@Override
public BooleanExpression evaluate(EnumPath path, ComparisonNode comparisonNode) {
    ComparisonOperator comparisonOperator = comparisonNode.getOperator();
    List<String> arguments = comparisonNode.getArguments();

    List<Enum> enumArgs = convertArgumentsToEnum(path, arguments);

    Enum firstEnumArg = enumArgs.get(0);
    boolean firstArgEqualsNull = firstEnumArg == null;

    if (EQUAL.equals(comparisonOperator)) {
        return firstArgEqualsNull ? path.isNull() : path.eq(firstEnumArg);
    } else if (NOT_EQUAL.equals(comparisonOperator)) {
        return firstArgEqualsNull ? path.isNotNull() : path.ne(firstEnumArg);
    } else if (IN.equals(comparisonOperator)) {
        return path.in(enumArgs);
    } else if (NOT_IN.equals(comparisonOperator)) {
        return path.notIn(enumArgs);
    }
    throw new UnsupportedRqlOperatorException(comparisonNode, path.getClass());
}
 

开发者ID:vineey,
项目名称:archelix-rsql,
代码行数:22,
代码来源:EnumPathConverter.java

示例2: evaluate

点赞 3

import cz.jirutka.rsql.parser.ast.ComparisonNode; //导入依赖的package包/类
@Override
public BooleanExpression evaluate(PATH path, ComparisonNode comparisonNode) {
    ComparisonOperator comparisonOperator = comparisonNode.getOperator();
    List<String> arguments = comparisonNode.getArguments();
    Comparable firstTimeArg = convertArgument((Class<RANGE>) path.getType(), arguments.get(0));

    if (EQUAL.equals(comparisonOperator)) {
        return firstTimeArg == null ? path.isNull() : path.eq(firstTimeArg);
    } else if (NOT_EQUAL.equals(comparisonOperator)) {
        return firstTimeArg == null ? path.isNotNull() : path.ne(firstTimeArg);
    } else if (IN.equals(comparisonOperator)) {
        return path.in(convertToArgumentList(path, arguments));
    } else if (NOT_IN.equals(comparisonOperator)) {
        return path.notIn(convertToArgumentList(path, arguments));
    } else if (GREATER_THAN.equals(comparisonOperator)) {
        return path.gt(firstTimeArg);
    } else if (GREATER_THAN_OR_EQUAL.equals(comparisonOperator)) {
        return path.goe(firstTimeArg);
    } else if (LESS_THAN.equals(comparisonOperator)) {
        return path.lt(firstTimeArg);
    } else if (LESS_THAN_OR_EQUAL.equals(comparisonOperator)) {
        return path.loe(firstTimeArg);
    }

    throw new UnsupportedRqlOperatorException(comparisonNode, path.getClass());
}
 

开发者ID:vineey,
项目名称:archelix-rsql,
代码行数:27,
代码来源:AbstractTimeRangePathConverter.java

示例3: evaluate

点赞 3

import cz.jirutka.rsql.parser.ast.ComparisonNode; //导入依赖的package包/类
@Override
public BooleanExpression evaluate(BooleanPath path, ComparisonNode comparisonNode) {
    Boolean arg = convertToBoolean(comparisonNode);
    ComparisonOperator operator = comparisonNode.getOperator();

    if (arg == null) {
        return path.isNull();
    } else {
        if (EQUAL.equals(operator)) {
            return path.eq(arg);
        } else if (NOT_EQUAL.equals(operator)) {
            return path.ne(arg).or(path.isNull());
        }
    }

    throw new UnsupportedRqlOperatorException(comparisonNode, path.getClass());
}
 

开发者ID:vineey,
项目名称:archelix-rsql,
代码行数:18,
代码来源:BooleanPathConverter.java

示例4: evaluate

点赞 3

import cz.jirutka.rsql.parser.ast.ComparisonNode; //导入依赖的package包/类
@Override
public BooleanExpression evaluate(StringPath path, ComparisonNode comparisonNode) {
    ComparisonOperator comparisonOperator = comparisonNode.getOperator();
    List<String> arguments = comparisonNode.getArguments();
    String firstArg = arguments.get(0);
    if (EQUAL.equals(comparisonOperator)) {
        return ConverterConstant.NULL.equalsIgnoreCase(firstArg) ? path.isNull() : equal(path, firstArg);
    } else if (NOT_EQUAL.equals(comparisonOperator)) {
        return ConverterConstant.NULL.equalsIgnoreCase(firstArg) ? path.isNotNull() : equal(path, firstArg).not().or(path.isNull());
    } else if (IN.equals(comparisonOperator)) {
        return path.in(arguments);
    } else if (NOT_IN.equals(comparisonOperator)) {
        return path.notIn(arguments);
    }

    throw new UnsupportedRqlOperatorException(comparisonNode, path.getClass());
}
 

开发者ID:vineey,
项目名称:archelix-rsql,
代码行数:18,
代码来源:StringPathConverter.java

示例5: validateMapParamter

点赞 3

import cz.jirutka.rsql.parser.ast.ComparisonNode; //导入依赖的package包/类
private void validateMapParamter(final A propertyEnum, final ComparisonNode node, final String[] graph) {
    if (!propertyEnum.isMap()) {
        return;

    }
    if (!propertyEnum.getSubEntityAttributes().isEmpty()) {
        throw new UnsupportedOperationException("Currently subentity attributes for maps are not supported");
    }

    // enum.key
    final int minAttributeForMap = 2;
    if (graph.length != minAttributeForMap) {
        throw new RSQLParameterUnsupportedFieldException("The syntax of the given map search parameter field {"
                + node.getSelector() + "} is wrong. Syntax is: fieldname.keyname", new Exception());
    }
}
 

开发者ID:eclipse,
项目名称:hawkbit,
代码行数:17,
代码来源:RSQLUtility.java

示例6: convertValueIfNecessary

点赞 3

import cz.jirutka.rsql.parser.ast.ComparisonNode; //导入依赖的package包/类
private Object convertValueIfNecessary(final ComparisonNode node, final A fieldName, final String value,
        final Path<Object> fieldPath) {
    // in case the value of an rsql query e.g. type==application is an
    // enum we need to handle it separately because JPA needs the
    // correct java-type to build an expression. So String and numeric
    // values JPA can do it by it's own but not for classes like enums.
    // So we need to transform the given value string into the enum
    // class.
    final Class<? extends Object> javaType = fieldPath.getJavaType();
    if (javaType != null && javaType.isEnum()) {
        return transformEnumValue(node, value, javaType);
    }
    if (fieldName instanceof FieldValueConverter) {
        return convertFieldConverterValue(node, fieldName, value);
    }

    if (Boolean.TYPE.equals(javaType)) {
        return convertBooleanValue(node, value, javaType);
    }

    return value;
}
 

开发者ID:eclipse,
项目名称:hawkbit,
代码行数:23,
代码来源:RSQLUtility.java

示例7: transformEnumValue

点赞 3

import cz.jirutka.rsql.parser.ast.ComparisonNode; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked", "squid:S2095" })
private static Object transformEnumValue(final ComparisonNode node, final String value,
        final Class<? extends Object> javaType) {
    final Class<? extends Enum> tmpEnumType = (Class<? extends Enum>) javaType;
    try {
        return Enum.valueOf(tmpEnumType, value.toUpperCase());
    } catch (final IllegalArgumentException e) {
        // we could not transform the given string value into the enum
        // type, so ignore it and return null and do not filter
        LOGGER.info("given value {} cannot be transformed into the correct enum type {}", value.toUpperCase(),
                javaType);
        LOGGER.debug("value cannot be transformed to an enum", e);

        throw new RSQLParameterUnsupportedFieldException("field {" + node.getSelector()
                + "} must be one of the following values {" + Arrays.stream(tmpEnumType.getEnumConstants())
                        .map(v -> v.name().toLowerCase()).collect(Collectors.toList())
                + "}", e);
    }
}
 

开发者ID:eclipse,
项目名称:hawkbit,
代码行数:20,
代码来源:RSQLUtility.java

示例8: mapToPredicate

点赞 3

import cz.jirutka.rsql.parser.ast.ComparisonNode; //导入依赖的package包/类
private List<Predicate> mapToPredicate(final ComparisonNode node, final Path<Object> fieldPath,
        final List<String> values, final List<Object> transformedValues, final A enumField) {
    // only 'equal' and 'notEqual' can handle transformed value like
    // enums. The JPA API cannot handle object types for greaterThan etc
    // methods.
    final Object transformedValue = transformedValues.get(0);

    String value = values.get(0);
    // if lookup is available, replace macros ...
    if (virtualPropertyReplacer != null) {
        value = virtualPropertyReplacer.replace(value);
    }

    final List<Predicate> singleList = new ArrayList<>();

    final Predicate mapPredicate = mapToMapPredicate(node, fieldPath, enumField);
    if (mapPredicate != null) {
        singleList.add(mapPredicate);
    }

    addOperatorPredicate(node, getMapValueFieldPath(enumField, fieldPath), transformedValues, transformedValue,
            value, singleList);
    return Collections.unmodifiableList(singleList);
}
 

开发者ID:eclipse,
项目名称:hawkbit,
代码行数:25,
代码来源:RSQLUtility.java

示例9: mapToMapPredicate

点赞 3

import cz.jirutka.rsql.parser.ast.ComparisonNode; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private Predicate mapToMapPredicate(final ComparisonNode node, final Path<Object> fieldPath,
        final A enumField) {
    if (!enumField.isMap()) {
        return null;
    }
    final String[] graph = node.getSelector().split("\\" + FieldNameProvider.SUB_ATTRIBUTE_SEPERATOR);
    final String keyValue = graph[graph.length - 1];
    if (fieldPath instanceof MapJoin) {
        // Currently we support only string key .So below cast is safe.
        return cb.equal(cb.upper((Expression<String>) (((MapJoin<?, ?, ?>) fieldPath).key())),
                keyValue.toUpperCase());
    }

    return cb.equal(cb.upper(fieldPath.get(enumField.getKeyFieldName())), keyValue.toUpperCase());
}
 

开发者ID:eclipse,
项目名称:hawkbit,
代码行数:17,
代码来源:RSQLUtility.java

示例10: buildLeafNodeQuery

点赞 2

import cz.jirutka.rsql.parser.ast.ComparisonNode; //导入依赖的package包/类
private SearchQuery buildLeafNodeQuery(final ComparisonNode node) throws IllegalArgumentException {
  final IndexKey indexKey = mapping.getKey(node.getSelector());
  final String name = indexKey != null ? indexKey.getIndexFieldName() : null;
  final Class<?> clazz = indexKey != null ? indexKey.getValueType() : null;
  final List<Object> processedArgs = validate(node, name, clazz);

  if (node.getOperator().equals(RSQLOperators.EQUAL)) {
    return createEqualsQuery(clazz, name, processedArgs.get(0),indexKey.getReservedValues());
  } else if (node.getOperator().equals(RSQLOperators.NOT_EQUAL)) {
    return SearchQueryUtils.not(createEqualsQuery(clazz, name, processedArgs.get(0), null));
  } else if (node.getOperator().equals(RSQLOperators.LESS_THAN)) {
    return createRangeQuery(clazz, name, processedArgs.get(0), RSQLOperators.LESS_THAN);
  } else if (node.getOperator().equals(RSQLOperators.LESS_THAN_OR_EQUAL)) {
    return createRangeQuery(clazz, name, processedArgs.get(0), RSQLOperators.LESS_THAN_OR_EQUAL);
  } else if (node.getOperator().equals(RSQLOperators.GREATER_THAN)) {
    return createRangeQuery(clazz, name, processedArgs.get(0), RSQLOperators.GREATER_THAN);
  } else if (node.getOperator().equals(RSQLOperators.GREATER_THAN_OR_EQUAL)) {
    return createRangeQuery(clazz, name, processedArgs.get(0), RSQLOperators.GREATER_THAN_OR_EQUAL);
  } else if (node.getOperator().equals(RSQLOperators.IN)) {
    throw new IllegalArgumentException("IN operator not yet supported");
  } else if (node.getOperator().equals(RSQLOperators.NOT_IN)) {
    throw new IllegalArgumentException("NOT_IN operator not yet supported");
  } else if (node.getOperator().equals(CONTAINS)) {
    return createMatchAllFieldsQuery((String)processedArgs.get(0), mapping);
  } else {
    throw new IllegalArgumentException(format("%s: Invalid search operator %s", visitorName, node.toString()));
  }
}
 

开发者ID:dremio,
项目名称:dremio-oss,
代码行数:29,
代码来源:SearchFilterToQueryConverter.java

示例11: evaluate

点赞 2

import cz.jirutka.rsql.parser.ast.ComparisonNode; //导入依赖的package包/类
@Override
public BooleanExpression evaluate(PATH path, ComparisonNode comparisonNode) {
    ComparisonOperator comparisonOperator = comparisonNode.getOperator();
    String argument = getArgument(comparisonNode);

    if (SIZE_EQ.equals(comparisonOperator)) {
        return path.size().eq(convertToSize(argument));
    } else if (SIZE_NOT_EQ.equals(comparisonOperator)) {
        return path.size().eq(convertToSize(argument)).not();
    }

    throw new UnsupportedRqlOperatorException(comparisonNode, path.getClass());
}
 

开发者ID:vineey,
项目名称:archelix-rsql,
代码行数:14,
代码来源:AbstractCollectionPathConverter.java

示例12: evaluate

点赞 2

import cz.jirutka.rsql.parser.ast.ComparisonNode; //导入依赖的package包/类
@Override
public BooleanExpression evaluate(NumberPath path, ComparisonNode comparisonNode) {
    ComparisonOperator comparisonOperator = comparisonNode.getOperator();
    List<String> arguments = comparisonNode.getArguments();
    Number firstNumberArg = convertToNumber(path, arguments.get(0));

    if (EQUAL.equals(comparisonOperator)) {
        return firstNumberArg == null ? path.isNull() : path.eq(firstNumberArg);
    } else if (NOT_EQUAL.equals(comparisonOperator)) {
        return firstNumberArg == null ? path.isNotNull() : path.ne(firstNumberArg);
    } else if (IN.equals(comparisonOperator)) {
        return path.in(convertToNumberArguments(path, arguments));
    } else if (NOT_IN.equals(comparisonOperator)) {
        return path.notIn(convertToNumberArguments(path, arguments));
    } else if (GREATER_THAN.equals(comparisonOperator)) {
        return path.gt(firstNumberArg);
    } else if (GREATER_THAN_OR_EQUAL.equals(comparisonOperator)) {
        return path.goe(firstNumberArg);
    } else if (LESS_THAN.equals(comparisonOperator)) {
        return path.lt(firstNumberArg);
    } else if (LESS_THAN_OR_EQUAL.equals(comparisonOperator)) {
        return path.loe(firstNumberArg);
    }

    throw new UnsupportedRqlOperatorException(comparisonNode, path.getClass());

}
 

开发者ID:vineey,
项目名称:archelix-rsql,
代码行数:28,
代码来源:NumberPathConverter.java

示例13: getAndValidatePropertyFieldName

点赞 2

import cz.jirutka.rsql.parser.ast.ComparisonNode; //导入依赖的package包/类
private String getAndValidatePropertyFieldName(final A propertyEnum, final ComparisonNode node) {

            final String[] graph = node.getSelector().split("\\" + FieldNameProvider.SUB_ATTRIBUTE_SEPERATOR);

            validateMapParamter(propertyEnum, node, graph);

            // sub entity need minium 1 dot
            if (!propertyEnum.getSubEntityAttributes().isEmpty() && graph.length < 2) {
                throw createRSQLParameterUnsupportedException(node);
            }

            final StringBuilder fieldNameBuilder = new StringBuilder(propertyEnum.getFieldName());

            for (int i = 1; i < graph.length; i++) {

                final String propertyField = graph[i];
                fieldNameBuilder.append(FieldNameProvider.SUB_ATTRIBUTE_SEPERATOR).append(propertyField);

                // the key of map is not in the graph
                if (propertyEnum.isMap() && graph.length == (i + 1)) {
                    continue;
                }

                if (!propertyEnum.containsSubEntityAttribute(propertyField)) {
                    throw createRSQLParameterUnsupportedException(node);
                }
            }

            return fieldNameBuilder.toString();
        }
 

开发者ID:eclipse,
项目名称:hawkbit,
代码行数:31,
代码来源:RSQLUtility.java

示例14: createRSQLParameterUnsupportedException

点赞 2

import cz.jirutka.rsql.parser.ast.ComparisonNode; //导入依赖的package包/类
private RSQLParameterUnsupportedFieldException createRSQLParameterUnsupportedException(
        final ComparisonNode node) {
    return new RSQLParameterUnsupportedFieldException(
            "The given search parameter field {" + node.getSelector()
                    + "} does not exist, must be one of the following fields {" + getExpectedFieldList() + "}",
            new Exception());
}
 

开发者ID:eclipse,
项目名称:hawkbit,
代码行数:8,
代码来源:RSQLUtility.java

示例15: visit

点赞 2

import cz.jirutka.rsql.parser.ast.ComparisonNode; //导入依赖的package包/类
@Override
// Exception squid:S2095 - see
// https://jira.sonarsource.com/browse/SONARJAVA-1478
@SuppressWarnings({ "squid:S2095" })
public List<Predicate> visit(final ComparisonNode node, final String param) {
    A fieldName = null;
    try {
        fieldName = getFieldEnumByName(node);
    } catch (final IllegalArgumentException e) {
        throw new RSQLParameterUnsupportedFieldException("The given search parameter field {"
                + node.getSelector() + "} does not exist, must be one of the following fields {"
                + Arrays.stream(enumType.getEnumConstants()).map(v -> v.name().toLowerCase())
                        .collect(Collectors.toList())
                + "}", e);

    }
    final String finalProperty = getAndValidatePropertyFieldName(fieldName, node);

    final List<String> values = node.getArguments();
    final List<Object> transformedValue = new ArrayList<>();
    final Path<Object> fieldPath = getFieldPath(fieldName, finalProperty);

    for (final String value : values) {
        transformedValue.add(convertValueIfNecessary(node, fieldName, value, fieldPath));
    }

    return mapToPredicate(node, fieldPath, node.getArguments(), transformedValue, fieldName);
}
 

开发者ID:eclipse,
项目名称:hawkbit,
代码行数:29,
代码来源:RSQLUtility.java

示例16: getFieldEnumByName

点赞 2

import cz.jirutka.rsql.parser.ast.ComparisonNode; //导入依赖的package包/类
private A getFieldEnumByName(final ComparisonNode node) {
    String enumName = node.getSelector();
    final String[] graph = enumName.split("\\" + FieldNameProvider.SUB_ATTRIBUTE_SEPERATOR);
    if (graph.length != 0) {
        enumName = graph[0];
    }
    LOGGER.debug("get fieldidentifier by name {} of enum type {}", enumName, enumType);
    return Enum.valueOf(enumType, enumName.toUpperCase());
}
 

开发者ID:eclipse,
项目名称:hawkbit,
代码行数:10,
代码来源:RSQLUtility.java

示例17: convertBooleanValue

点赞 2

import cz.jirutka.rsql.parser.ast.ComparisonNode; //导入依赖的package包/类
private Object convertBooleanValue(final ComparisonNode node, final String value,
        final Class<? extends Object> javaType) {
    try {
        return simpleTypeConverter.convertIfNecessary(value, javaType);
    } catch (final TypeMismatchException e) {
        throw new RSQLParameterSyntaxException(
                "The value of the given search parameter field {" + node.getSelector()
                        + "} is not well formed. Only a boolean (true or false) value will be expected {",
                e);
    }
}
 

开发者ID:eclipse,
项目名称:hawkbit,
代码行数:12,
代码来源:RSQLUtility.java

示例18: convertFieldConverterValue

点赞 2

import cz.jirutka.rsql.parser.ast.ComparisonNode; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
private Object convertFieldConverterValue(final ComparisonNode node, final A fieldName, final String value) {
    final Object convertedValue = ((FieldValueConverter) fieldName).convertValue(fieldName, value);
    if (convertedValue == null) {
        throw new RSQLParameterUnsupportedFieldException(
                "field {" + node.getSelector() + "} must be one of the following values {"
                        + Arrays.toString(((FieldValueConverter) fieldName).possibleValues(fieldName)) + "}",
                null);
    } else {
        return convertedValue;
    }
}
 

开发者ID:eclipse,
项目名称:hawkbit,
代码行数:13,
代码来源:RSQLUtility.java

示例19: addOperatorPredicate

点赞 2

import cz.jirutka.rsql.parser.ast.ComparisonNode; //导入依赖的package包/类
private void addOperatorPredicate(final ComparisonNode node, final Path<Object> fieldPath,
        final List<Object> transformedValues, final Object transformedValue, final String value,
        final List<Predicate> singleList) {
    switch (node.getOperator().getSymbol()) {
    case "==":
        singleList.add(getEqualToPredicate(transformedValue, fieldPath));
        break;
    case "!=":
        singleList.add(getNotEqualToPredicate(transformedValue, fieldPath));
        break;
    case "=gt=":
        singleList.add(cb.greaterThan(pathOfString(fieldPath), value));
        break;
    case "=ge=":
        singleList.add(cb.greaterThanOrEqualTo(pathOfString(fieldPath), value));
        break;
    case "=lt=":
        singleList.add(cb.lessThan(pathOfString(fieldPath), value));
        break;
    case "=le=":
        singleList.add(cb.lessThanOrEqualTo(pathOfString(fieldPath), value));
        break;
    case "=in=":
        singleList.add(getInPredicate(transformedValues, fieldPath));
        break;
    case "=out=":
        singleList.add(getOutPredicate(transformedValues, fieldPath));
        break;
    default:
        LOGGER.info("operator symbol {} is either not supported or not implemented");
    }
}
 

开发者ID:eclipse,
项目名称:hawkbit,
代码行数:33,
代码来源:RSQLUtility.java

示例20: visit

点赞 2

import cz.jirutka.rsql.parser.ast.ComparisonNode; //导入依赖的package包/类
@Override
public FilterExpression visit(ComparisonNode node, Class entityType) {
    ComparisonOperator op = node.getOperator();
    String relationship = node.getSelector();
    List<String> arguments = node.getArguments();
    Path path = buildPath(entityType, relationship);

    if (FilterPredicate.toManyInPath(dictionary, path) && !allowNestedToManyAssociations) {
        throw new RSQLParseException(String.format("Invalid association %s", relationship));
    }

    //handles '=isnull=' op before coerce arguments
    if (op.equals(ISNULL_OP)) {
        return buildIsNullOperator(path, arguments);
    }

    Class<?> relationshipType = path.lastElement()
            .map(Path.PathElement::getFieldType)
            .orElseThrow(() -> new IllegalStateException("Path must not be empty"));

    //Coerce arguments to their correct types
    List<Object> values = arguments.stream()
            .map((argument) -> (Object) CoerceUtil.coerce(argument, relationshipType))
            .collect(Collectors.toList());

    if (op.equals(RSQLOperators.EQUAL) || op.equals(RSQLOperators.IN)) {
        return equalityExpression(arguments.get(0), path, values);
    }
    if (op.equals(RSQLOperators.NOT_EQUAL) || op.equals(RSQLOperators.NOT_IN)) {
        return new NotFilterExpression(equalityExpression(arguments.get(0), path, values));
    }
    if (OPERATOR_MAP.containsKey(op)) {
        return new FilterPredicate(path, OPERATOR_MAP.get(op), values);
    }

    throw new RSQLParseException(String.format("Invalid Operator %s", op.getSymbol()));
}
 

开发者ID:yahoo,
项目名称:elide,
代码行数:38,
代码来源:RSQLFilterDialect.java

示例21: visit

点赞 2

import cz.jirutka.rsql.parser.ast.ComparisonNode; //导入依赖的package包/类
@Override
public SearchQuery visit(final ComparisonNode node) {
  return buildLeafNodeQuery(node);
}
 

开发者ID:dremio,
项目名称:dremio-oss,
代码行数:5,
代码来源:SearchFilterToQueryConverter.java

示例22: checkAtleastOneArgument

点赞 2

import cz.jirutka.rsql.parser.ast.ComparisonNode; //导入依赖的package包/类
private void checkAtleastOneArgument(final ComparisonNode node) {
  if (node.getArguments().size() < 1) {
    throw new IllegalArgumentException(format("%s: Invalid search operator %s, needs at least one argument",
      visitorName, node.toString()));
  }
}
 

开发者ID:dremio,
项目名称:dremio-oss,
代码行数:7,
代码来源:SearchFilterToQueryConverter.java

示例23: getArgument

点赞 2

import cz.jirutka.rsql.parser.ast.ComparisonNode; //导入依赖的package包/类
private String getArgument(ComparisonNode comparisonNode) {
    List<String> arguments = comparisonNode.getArguments();
    return CollectionUtils.isNotEmpty(arguments) ? arguments.get(0) : null;
}
 

开发者ID:vineey,
项目名称:archelix-rsql,
代码行数:5,
代码来源:AbstractCollectionPathConverter.java

示例24: convertToBoolean

点赞 2

import cz.jirutka.rsql.parser.ast.ComparisonNode; //导入依赖的package包/类
private Boolean convertToBoolean(ComparisonNode comparisonNode) {
    String firstArg = comparisonNode.getArguments().get(0);
    return ConverterConstant.NULL.equalsIgnoreCase(firstArg) ? null : Boolean.valueOf(firstArg);
}
 

开发者ID:vineey,
项目名称:archelix-rsql,
代码行数:5,
代码来源:BooleanPathConverter.java

示例25: UnsupportedRqlOperatorException

点赞 2

import cz.jirutka.rsql.parser.ast.ComparisonNode; //导入依赖的package包/类
public UnsupportedRqlOperatorException(ComparisonNode comparisonNode, Class<? extends Expression> pathClass) {
    super("The comparison operator within expression [" + comparisonNode.toString() + "] is not supported on type " + pathClass.getSimpleName() + ".");
}
 

开发者ID:vineey,
项目名称:archelix-rsql,
代码行数:4,
代码来源:UnsupportedRqlOperatorException.java

示例26: evaluate

点赞 1

import cz.jirutka.rsql.parser.ast.ComparisonNode; //导入依赖的package包/类
BooleanExpression evaluate(T path, ComparisonNode comparisonNode); 

开发者ID:vineey,
项目名称:archelix-rsql,
代码行数:2,
代码来源:PathConverter.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)