io.micronaut.starter.cli.feature.server.websocket.groovyWebsocketServer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of micronaut-micronaut-cli Show documentation
Show all versions of micronaut-micronaut-cli Show documentation
Generates Micronaut applications
package io.micronaut.starter.cli.feature.server.websocket;
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.application.Project;
/*
* Auto generated code to render template io/micronaut/starter/cli/feature/server/websocket/groovyWebsocketServer.rocker.raw
* Do not edit this file. Changes will eventually be overwritten by Rocker parser!
*/
@SuppressWarnings("unused")
public class groovyWebsocketServer extends com.fizzed.rocker.runtime.DefaultRockerModel {
static public com.fizzed.rocker.ContentType getContentType() { return com.fizzed.rocker.ContentType.RAW; }
static public String getTemplateName() { return "groovyWebsocketServer.rocker.raw"; }
static public String getTemplatePackageName() { return "io.micronaut.starter.cli.feature.server.websocket"; }
static public String getHeaderHash() { return "-1654727492"; }
static public String[] getArgumentNames() { return new String[] { "project" }; }
// argument @ [3:2]
private Project project;
public groovyWebsocketServer project(Project project) {
this.project = project;
return this;
}
public Project project() {
return this.project;
}
static public groovyWebsocketServer template(Project project) {
return new groovyWebsocketServer()
.project(project);
}
@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 {
// package
static private final String PLAIN_TEXT_0_0 = "package ";
// \n
static private final String PLAIN_TEXT_1_0 = "\n";
// \nimport io.micronaut.websocket.WebSocketBroadcaster\nimport io.micronaut.websocket.annotation.OnClose\nimport io.micronaut.websocket.annotation.OnMessage\nimport io.micronaut.websocket.annotation.OnOpen\nimport io.micronaut.websocket.annotation.ServerWebSocket\n\n@ServerWebSocket(\"/
static private final String PLAIN_TEXT_2_0 = "\nimport io.micronaut.websocket.WebSocketBroadcaster\nimport io.micronaut.websocket.annotation.OnClose\nimport io.micronaut.websocket.annotation.OnMessage\nimport io.micronaut.websocket.annotation.OnOpen\nimport io.micronaut.websocket.annotation.ServerWebSocket\n\n@ServerWebSocket(\"/";
// /{topic}\")\nclass
static private final String PLAIN_TEXT_3_0 = "/{topic}\")\nclass ";
// Server {\n\n private WebSocketBroadcaster broadcaster\n\n
static private final String PLAIN_TEXT_4_0 = "Server {\n\n private WebSocketBroadcaster broadcaster\n\n ";
// Server(WebSocketBroadcaster broadcaster) {\n this.broadcaster = broadcaster\n }\n\n @OnOpen\n void onOpen() {}\n\n @OnMessage\n void onMessage() {}\n\n @OnClose\n void onClose() {}\n}
static private final String PLAIN_TEXT_5_0 = "Server(WebSocketBroadcaster broadcaster) {\n this.broadcaster = broadcaster\n }\n\n @OnOpen\n void onOpen() {}\n\n @OnMessage\n void onMessage() {}\n\n @OnClose\n void onClose() {}\n}";
// argument @ [3:2]
protected final Project project;
public Template(groovyWebsocketServer model) {
super(model);
__internal.setCharset("UTF-8");
__internal.setContentType(getContentType());
__internal.setTemplateName(getTemplateName());
__internal.setTemplatePackageName(getTemplatePackageName());
this.project = model.project();
}
@Override
protected void __doRender() throws IOException, RenderingException {
// IfBlockBegin @ [7:1]
__internal.aboutToExecutePosInTemplate(7, 1);
if (project.getPackageName() != null) {
// PlainText @ [7:41]
__internal.aboutToExecutePosInTemplate(7, 41);
__internal.writeValue(PLAIN_TEXT_0_0);
// ValueExpression @ [8:9]
__internal.aboutToExecutePosInTemplate(8, 9);
__internal.renderValue(project.getPackageName(), false);
// PlainText @ [8:34]
__internal.aboutToExecutePosInTemplate(8, 34);
__internal.writeValue(PLAIN_TEXT_1_0);
// IfBlockEnd @ [7:1]
__internal.aboutToExecutePosInTemplate(7, 1);
} // if end @ [7:1]
// PlainText @ [9:2]
__internal.aboutToExecutePosInTemplate(9, 2);
__internal.writeValue(PLAIN_TEXT_2_0);
// ValueExpression @ [18:21]
__internal.aboutToExecutePosInTemplate(18, 21);
__internal.renderValue(project.getPropertyName(), false);
// PlainText @ [18:47]
__internal.aboutToExecutePosInTemplate(18, 47);
__internal.writeValue(PLAIN_TEXT_3_0);
// ValueExpression @ [19:7]
__internal.aboutToExecutePosInTemplate(19, 7);
__internal.renderValue(project.getClassName(), false);
// PlainText @ [19:30]
__internal.aboutToExecutePosInTemplate(19, 30);
__internal.writeValue(PLAIN_TEXT_4_0);
// ValueExpression @ [23:5]
__internal.aboutToExecutePosInTemplate(23, 5);
__internal.renderValue(project.getClassName(), false);
// PlainText @ [23:28]
__internal.aboutToExecutePosInTemplate(23, 28);
__internal.writeValue(PLAIN_TEXT_5_0);
}
}
}