templates.graphql.schemaClassExample Maven / Gradle / Ivy
package templates.graphql;
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;
/*
* Auto generated code to render template templates/graphql/schemaClassExample.rocker.raw
* Do not edit this file. Changes will eventually be overwritten by Rocker parser!
*/
@SuppressWarnings("unused")
public class schemaClassExample extends com.fizzed.rocker.runtime.DefaultRockerModel {
static public com.fizzed.rocker.ContentType getContentType() { return com.fizzed.rocker.ContentType.RAW; }
static public String getTemplateName() { return "schemaClassExample.rocker.raw"; }
static public String getTemplatePackageName() { return "templates.graphql"; }
static public String getHeaderHash() { return "-1193733343"; }
static public long getModifiedAt() { return 1645995245871L; }
static public String[] getArgumentNames() { return new String[] { "schemaPackage", "schemaClass" }; }
// argument @ [1:2]
private String schemaPackage;
// argument @ [1:2]
private String schemaClass;
public schemaClassExample schemaPackage(String schemaPackage) {
this.schemaPackage = schemaPackage;
return this;
}
public String schemaPackage() {
return this.schemaPackage;
}
public schemaClassExample schemaClass(String schemaClass) {
this.schemaClass = schemaClass;
return this;
}
public String schemaClass() {
return this.schemaClass;
}
static public schemaClassExample template(String schemaPackage, String schemaClass) {
return new schemaClassExample()
.schemaPackage(schemaPackage)
.schemaClass(schemaClass);
}
@Override
protected DefaultRockerTemplate buildTemplate() throws RenderingException {
// optimized for convenience (runtime auto reloading enabled if rocker.reloading=true)
return com.fizzed.rocker.runtime.RockerRuntime.getInstance().getBootstrap().template(this.getClass(), this);
}
static public class Template extends com.fizzed.rocker.runtime.DefaultRockerTemplate {
// \npackage
static private final byte[] PLAIN_TEXT_0_0;
// ;\n\nimport com.networknt.graphql.router.SchemaProvider;\nimport graphql.schema.GraphQLObjectType;\nimport graphql.schema.GraphQLSchema;\n\nimport static graphql.Scalars.GraphQLString;\nimport static graphql.schema.GraphQLFieldDefinition.newFieldDefinition;\nimport static graphql.schema.GraphQLObjectType.newObject;\n\n/**\n * Created by steve on 25/03/17.\n */\npublic class
static private final byte[] PLAIN_TEXT_1_0;
// implements SchemaProvider {\n @Override\n public GraphQLSchema getSchema() {\n GraphQLObjectType queryType = newObject()\n .name(\"helloWorldQuery\")\n .field(newFieldDefinition()\n .type(GraphQLString)\n .name(\"hello\")\n .staticValue(\"world\"))\n .build();\n\n return GraphQLSchema.newSchema()\n .query(queryType)\n .build();\n ...
static private final byte[] PLAIN_TEXT_2_0;
static {
PlainTextUnloadedClassLoader loader = PlainTextUnloadedClassLoader.tryLoad(schemaClassExample.class.getClassLoader(), schemaClassExample.class.getName() + "$PlainText", "UTF-8");
PLAIN_TEXT_0_0 = loader.tryGet("PLAIN_TEXT_0_0");
PLAIN_TEXT_1_0 = loader.tryGet("PLAIN_TEXT_1_0");
PLAIN_TEXT_2_0 = loader.tryGet("PLAIN_TEXT_2_0");
}
// argument @ [1:2]
protected final String schemaPackage;
// argument @ [1:2]
protected final String schemaClass;
public Template(schemaClassExample model) {
super(model);
__internal.setCharset("UTF-8");
__internal.setContentType(getContentType());
__internal.setTemplateName(getTemplateName());
__internal.setTemplatePackageName(getTemplatePackageName());
this.schemaPackage = model.schemaPackage();
this.schemaClass = model.schemaClass();
}
@Override
protected void __doRender() throws IOException, RenderingException {
// PlainText @ [1:49]
__internal.aboutToExecutePosInTemplate(1, 49);
__internal.writeValue(PLAIN_TEXT_0_0);
// ValueExpression @ [2:9]
__internal.aboutToExecutePosInTemplate(2, 9);
__internal.renderValue(schemaPackage, false);
// PlainText @ [2:23]
__internal.aboutToExecutePosInTemplate(2, 23);
__internal.writeValue(PLAIN_TEXT_1_0);
// ValueExpression @ [15:14]
__internal.aboutToExecutePosInTemplate(15, 14);
__internal.renderValue(schemaClass, false);
// PlainText @ [15:26]
__internal.aboutToExecutePosInTemplate(15, 26);
__internal.writeValue(PLAIN_TEXT_2_0);
}
}
private static class PlainText {
static private final String PLAIN_TEXT_0_0 = "\npackage ";
static private final String PLAIN_TEXT_1_0 = ";\n\nimport com.networknt.graphql.router.SchemaProvider;\nimport graphql.schema.GraphQLObjectType;\nimport graphql.schema.GraphQLSchema;\n\nimport static graphql.Scalars.GraphQLString;\nimport static graphql.schema.GraphQLFieldDefinition.newFieldDefinition;\nimport static graphql.schema.GraphQLObjectType.newObject;\n\n/**\n * Created by steve on 25/03/17.\n */\npublic class ";
static private final String PLAIN_TEXT_2_0 = " implements SchemaProvider {\n @Override\n public GraphQLSchema getSchema() {\n GraphQLObjectType queryType = newObject()\n .name(\"helloWorldQuery\")\n .field(newFieldDefinition()\n .type(GraphQLString)\n .name(\"hello\")\n .staticValue(\"world\"))\n .build();\n\n return GraphQLSchema.newSchema()\n .query(queryType)\n .build();\n }\n}\n\n";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy