String sqlStr = "SELECT t1.Key as Key1, t2.Key as Key2 FROM tabel1 as t1, tabel2 as t2 WHERE t1.Key = t2.Key"; Statement statement = CCJSqlParserUtil.parse(sqlStr); System.out.println(statement.toString());
/** * <pre> * Block: * { { Statement } } * </pre> * * @param block the {@link Block block} being recorded (cannot be <code>null</code>) * @param blockNode the parent {@link Node node} where the statements will be added (cannot be <code>null</code>) * @throws Exception if there is a problem */ protected void record( final Block block, final Node blockNode ) throws Exception { if (block != null) { @SuppressWarnings( "unchecked" ) final List<Statement> statements = block.statements(); if ((statements != null) && !statements.isEmpty()) { for (final Statement statement : statements) { // TODO handle each type of statement final Node stmtNode = blockNode.addNode(ClassFileSequencerLexicon.STATEMENT, ClassFileSequencerLexicon.STATEMENT); stmtNode.setProperty(ClassFileSequencerLexicon.CONTENT, statement.toString()); recordSourceReference(statement, stmtNode); } } } }
/** * <pre> * Block: * { { Statement } } * </pre> * * @param block the {@link Block block} being recorded (cannot be <code>null</code>) * @param blockNode the parent {@link Node node} where the statements will be added (cannot be <code>null</code>) * @throws Exception if there is a problem */ protected void record( final Block block, final Node blockNode ) throws Exception { if (block != null) { @SuppressWarnings( "unchecked" ) final List<Statement> statements = block.statements(); if ((statements != null) && !statements.isEmpty()) { for (final Statement statement : statements) { // TODO handle each type of statement final Node stmtNode = blockNode.addNode(ClassFileSequencerLexicon.STATEMENT, ClassFileSequencerLexicon.STATEMENT); stmtNode.setProperty(ClassFileSequencerLexicon.CONTENT, statement.toString()); recordSourceReference(statement, stmtNode); } } } }
this.ternaryOperatorExpressions = visitor.getTernaryOperatorExpressions(); setDepth(depth); if(Visitor.METHOD_INVOCATION_PATTERN.matcher(statement.toString()).matches()) { if(statement instanceof VariableDeclarationStatement) { VariableDeclarationStatement variableDeclarationStatement = (VariableDeclarationStatement)statement; this.statement = statement.toString(); this.statement = statement.toString();