简体   繁体   中英

Cannot resolve method accept for JSQLParser

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;
}
}

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

Correct import statement

import net.sf.jsqlparser.expression.Expression;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM