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
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
;
27 public List
<SqlStatement
> parseFiles() {
28 return fileResolver
.resolveFiles()
29 .flatMap(fileParser
::parse
)