Search in sources :

Example 1 with SelectDeParser

use of net.sf.jsqlparser.util.deparser.SelectDeParser in project JSqlParser by JSQLParser.

the class TestUtils method assertExpressionCanBeDeparsedAs.

public static void assertExpressionCanBeDeparsedAs(final Expression parsed, String expression) {
    ExpressionDeParser expressionDeParser = new ExpressionDeParser();
    StringBuilder stringBuilder = new StringBuilder();
    expressionDeParser.setBuffer(stringBuilder);
    SelectDeParser selectDeParser = new SelectDeParser(expressionDeParser, stringBuilder);
    expressionDeParser.setSelectVisitor(selectDeParser);
    parsed.accept(expressionDeParser);
    assertEquals(expression, stringBuilder.toString());
}
Also used : SelectDeParser(net.sf.jsqlparser.util.deparser.SelectDeParser) ExpressionDeParser(net.sf.jsqlparser.util.deparser.ExpressionDeParser)

Aggregations

ExpressionDeParser (net.sf.jsqlparser.util.deparser.ExpressionDeParser)1 SelectDeParser (net.sf.jsqlparser.util.deparser.SelectDeParser)1