formatting
[yosql.git] / yosql-codegen / src / main / java / wtf / metio / yosql / codegen / files / DefaultFileParser.java
blob310d5e90e2eae05e8aaad7d96c45c535ebb252e1
1 /*
2 * This file is part of yosql. It is subject to the license terms in the LICENSE file found in the top-level
3 * directory of this distribution and at https://creativecommons.org/publicdomain/zero/1.0/. No part of yosql,
4 * including this file, may be copied, modified, propagated, or distributed except according to the terms contained
5 * in the LICENSE file.
6 */
8 package wtf.metio.yosql.codegen.files;
10 import wtf.metio.yosql.models.immutables.SqlStatement;
12 import java.util.List;
14 import static java.util.stream.Collectors.toList;
16 public final class DefaultFileParser implements FileParser {
18 private final FileResolver fileResolver;
19 private final SqlStatementParser fileParser;
21 public DefaultFileParser(final FileResolver fileResolver, final SqlStatementParser fileParser) {
22 this.fileResolver = fileResolver;
23 this.fileParser = fileParser;
26 @Override
27 public List<SqlStatement> parseFiles() {
28 return fileResolver.resolveFiles()
29 .flatMap(fileParser::parse)
30 .collect(toList());