Support several templates
This commit is contained in:
parent
145a8672ab
commit
92098b1a3b
1 changed files with 6 additions and 1 deletions
|
@ -19,6 +19,7 @@ public class TargetGenerator {
|
|||
public static String ENDPOINTS_TEMPLATE_NAME = "endpoints.ftl";
|
||||
private final List<EndpointNode> endpoints;
|
||||
private final List<DataTypeNode> dataTypes;
|
||||
private final boolean verbose ;
|
||||
|
||||
public static class TargetGeneratorException extends Exception {
|
||||
public TargetGeneratorException(Exception cause) {
|
||||
|
@ -27,12 +28,13 @@ public class TargetGenerator {
|
|||
}
|
||||
|
||||
public TargetGenerator(
|
||||
final boolean verbose,
|
||||
boolean verbose,
|
||||
Path outputPath,
|
||||
Path templatePath,
|
||||
List<EndpointNode> endpoints,
|
||||
List<DataTypeNode> dataTypes
|
||||
) {
|
||||
this.verbose = verbose;
|
||||
this.outputPath = Objects.requireNonNull(
|
||||
outputPath,
|
||||
"Output path is required"
|
||||
|
@ -66,6 +68,9 @@ public class TargetGenerator {
|
|||
StandardOpenOption.CREATE,
|
||||
StandardOpenOption.TRUNCATE_EXISTING
|
||||
)) {
|
||||
if (this.verbose) {
|
||||
System.out.println("Processing " + template);
|
||||
}
|
||||
HashMap<String, Object> templateData = new HashMap<>();
|
||||
templateData.put("endpoints", endpoints);
|
||||
templateData.put("datatypes", dataTypes);
|
||||
|
|
Loading…
Add table
Reference in a new issue