io.micronaut.starter.feature.cli Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of micronaut-starter-core Show documentation
Show all versions of micronaut-starter-core Show documentation
Generates Micronaut applications
package io.micronaut.starter.feature;
import java.io.IOException;
import com.fizzed.rocker.ForIterator;
import com.fizzed.rocker.RenderingException;
import com.fizzed.rocker.RockerContent;
import com.fizzed.rocker.RockerOutput;
import com.fizzed.rocker.runtime.DefaultRockerTemplate;
import com.fizzed.rocker.runtime.PlainTextUnloadedClassLoader;
// import @ [1:1]
import io.micronaut.starter.options.Language;
// import @ [2:1]
import io.micronaut.starter.options.TestFramework;
// import @ [3:1]
import io.micronaut.starter.options.BuildTool;
// import @ [4:1]
import io.micronaut.starter.application.Project;
// import @ [5:1]
import io.micronaut.starter.application.ApplicationType;
// import @ [6:1]
import java.util.List;
/*
* Auto generated code to render template io/micronaut/starter/feature/cli.rocker.raw
* Do not edit this file. Changes will eventually be overwritten by Rocker parser!
*/
@SuppressWarnings("unused")
public class cli extends com.fizzed.rocker.runtime.DefaultRockerModel {
static public com.fizzed.rocker.ContentType getContentType() { return com.fizzed.rocker.ContentType.RAW; }
static public String getTemplateName() { return "cli.rocker.raw"; }
static public String getTemplatePackageName() { return "io.micronaut.starter.feature"; }
static public String getHeaderHash() { return "-227511011"; }
static public String[] getArgumentNames() { return new String[] { "language", "testFramework", "buildTool", "project", "features", "applicationType" }; }
// argument @ [9:2]
private Language language;
// argument @ [9:2]
private TestFramework testFramework;
// argument @ [9:2]
private BuildTool buildTool;
// argument @ [9:2]
private Project project;
// argument @ [9:2]
private List features;
// argument @ [9:2]
private ApplicationType applicationType;
public cli language(Language language) {
this.language = language;
return this;
}
public Language language() {
return this.language;
}
public cli testFramework(TestFramework testFramework) {
this.testFramework = testFramework;
return this;
}
public TestFramework testFramework() {
return this.testFramework;
}
public cli buildTool(BuildTool buildTool) {
this.buildTool = buildTool;
return this;
}
public BuildTool buildTool() {
return this.buildTool;
}
public cli project(Project project) {
this.project = project;
return this;
}
public Project project() {
return this.project;
}
public cli features(List features) {
this.features = features;
return this;
}
public List features() {
return this.features;
}
public cli applicationType(ApplicationType applicationType) {
this.applicationType = applicationType;
return this;
}
public ApplicationType applicationType() {
return this.applicationType;
}
static public cli template(Language language, TestFramework testFramework, BuildTool buildTool, Project project, List features, ApplicationType applicationType) {
return new cli()
.language(language)
.testFramework(testFramework)
.buildTool(buildTool)
.project(project)
.features(features)
.applicationType(applicationType);
}
@Override
protected DefaultRockerTemplate buildTemplate() throws RenderingException {
// optimized for performance (via rocker.optimize flag; no auto reloading)
return new Template(this);
}
static public class Template extends com.fizzed.rocker.runtime.DefaultRockerTemplate {
// applicationType:
static private final String PLAIN_TEXT_0_0 = "applicationType: ";
// \ndefaultPackage:
static private final String PLAIN_TEXT_1_0 = "\ndefaultPackage: ";
// \ntestFramework:
static private final String PLAIN_TEXT_2_0 = "\ntestFramework: ";
// \nsourceLanguage:
static private final String PLAIN_TEXT_3_0 = "\nsourceLanguage: ";
// \nbuildTool:
static private final String PLAIN_TEXT_4_0 = "\nbuildTool: ";
// \nfeatures:
static private final String PLAIN_TEXT_5_0 = "\nfeatures: ";
// \n
static private final String PLAIN_TEXT_6_0 = "\n";
// argument @ [9:2]
protected final Language language;
// argument @ [9:2]
protected final TestFramework testFramework;
// argument @ [9:2]
protected final BuildTool buildTool;
// argument @ [9:2]
protected final Project project;
// argument @ [9:2]
protected final List features;
// argument @ [9:2]
protected final ApplicationType applicationType;
public Template(cli model) {
super(model);
__internal.setCharset("UTF-8");
__internal.setContentType(getContentType());
__internal.setTemplateName(getTemplateName());
__internal.setTemplatePackageName(getTemplatePackageName());
this.language = model.language();
this.testFramework = model.testFramework();
this.buildTool = model.buildTool();
this.project = model.project();
this.features = model.features();
this.applicationType = model.applicationType();
}
@Override
protected void __doRender() throws IOException, RenderingException {
// PlainText @ [16:2]
__internal.aboutToExecutePosInTemplate(16, 2);
__internal.writeValue(PLAIN_TEXT_0_0);
// ValueExpression @ [18:18]
__internal.aboutToExecutePosInTemplate(18, 18);
__internal.renderValue(applicationType.getName(), false);
// PlainText @ [18:44]
__internal.aboutToExecutePosInTemplate(18, 44);
__internal.writeValue(PLAIN_TEXT_1_0);
// ValueExpression @ [19:17]
__internal.aboutToExecutePosInTemplate(19, 17);
__internal.renderValue(project.getPackageName(), false);
// PlainText @ [19:42]
__internal.aboutToExecutePosInTemplate(19, 42);
__internal.writeValue(PLAIN_TEXT_2_0);
// ValueExpression @ [20:16]
__internal.aboutToExecutePosInTemplate(20, 16);
__internal.renderValue(testFramework.getName(), false);
// PlainText @ [20:40]
__internal.aboutToExecutePosInTemplate(20, 40);
__internal.writeValue(PLAIN_TEXT_3_0);
// ValueExpression @ [21:17]
__internal.aboutToExecutePosInTemplate(21, 17);
__internal.renderValue(language.getName(), false);
// PlainText @ [21:36]
__internal.aboutToExecutePosInTemplate(21, 36);
__internal.writeValue(PLAIN_TEXT_4_0);
// ValueExpression @ [22:12]
__internal.aboutToExecutePosInTemplate(22, 12);
__internal.renderValue(buildTool.getName(), false);
// PlainText @ [22:32]
__internal.aboutToExecutePosInTemplate(22, 32);
__internal.writeValue(PLAIN_TEXT_5_0);
// ValueExpression @ [23:11]
__internal.aboutToExecutePosInTemplate(23, 11);
__internal.renderValue(features.toString(), false);
// PlainText @ [23:31]
__internal.aboutToExecutePosInTemplate(23, 31);
__internal.writeValue(PLAIN_TEXT_6_0);
}
}
}