GraphflowVisitor.java 文件源码

java
阅读 18 收藏 0 点赞 0 评论 0

项目:graphflow 作者:
private AbstractStructuredQuery visitVariableVertex(StructuredQuery structuredQuery,
    VariableVertexContext ctx) {
    QueryVariable queryVariable = new QueryVariable(ctx.variable().getText());

    TypeContext typeContext = ctx.type();
    if (null != typeContext) {
        queryVariable.setVariableType(typeContext.variable().getText());
    }

    PropertiesContext propertiesContext = ctx.properties();
    if (null != propertiesContext) {
        Map<String, Pair<String, String>> variablePropertyFilters = parseProperties(
            propertiesContext);
        ComparisonPredicate comparisonPredicate;
        for (String key : variablePropertyFilters.keySet()) {
            comparisonPredicate = new ComparisonPredicate();
            comparisonPredicate.setLeftOperand(new Pair<>(ctx.variable().getText(), key));
            comparisonPredicate.setLiteral(variablePropertyFilters.get(key).b);
            comparisonPredicate.setComparisonOperator(ComparisonOperator.EQUALS);
            comparisonPredicate.setPredicateType(PredicateType.
                COMPARATIVE_CLAUSE_PROPERTY_KEY_AND_LITERAL_OPERANDS);
            structuredQuery.addQueryPredicate(comparisonPredicate);
        }
    }
    return queryVariable;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号