无法解析JSQLParser的方法接受

时间:2017-10-01 19:30:07

标签: java methods jsqlparser

对于condition.accept我收到错误“无法解析方法'接受(cs4321.project2.Operators.SelectExpressionVisitor)”。我不确定为什么,因为我正确地遵循Expression accept method语法。

public class SelectExpressionVisitor implements ExpressionVisitor {
private Tuple tuple;
private Map<String, Integer> colToTupleIndexMap;
private boolean tupleFollowsCondition;

public SelectExpressionVisitor(Tuple tuple) {
    this.tuple = tuple;
    colToTupleIndexMap = DatabaseCatalog.getInstance()
            .colToTupleIndexMap;
    tupleFollowsCondition = false;
}

public Tuple getSelectTuple(Expression condition) {
    condition.accept(this);
    if(tupleFollowsCondition) {
        return tuple;
    }
    return null;
}
}

1 个答案:

答案 0 :(得分:0)

我意识到我导入了错误的Expression类,它没有接受方法。

更正导入声明

import net.sf.jsqlparser.expression.Expression;