Cannot resolve method accept for JSQLParser

224 Views Asked by At

For condition.accept I get the error "cannot resolve method 'accept(cs4321.project2.Operators.SelectExpressionVisitor)". I'm not sure why because I'm following the Expression accept method syntax correctly.

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

There are 1 best solutions below

0
On BEST ANSWER

I realized I imported the wrong Expression class, which didn't have an accept method.

Correct import statement

import net.sf.jsqlparser.expression.Expression;