All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.micronaut.starter.template.api.starterApi Maven / Gradle / Ivy

There is a newer version: 4.7.0
Show newest version
package io.micronaut.starter.template.api;

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.ApplicationType;
// import @ [2:1]
import java.util.List;

/*
 * Auto generated code to render template io/micronaut/starter/template/api/starterApi.rocker.raw
 * Do not edit this file. Changes will eventually be overwritten by Rocker parser!
 */
@SuppressWarnings("unused")
public class starterApi extends com.fizzed.rocker.runtime.DefaultRockerModel {

    static public com.fizzed.rocker.ContentType getContentType() { return com.fizzed.rocker.ContentType.RAW; }
    static public String getTemplateName() { return "starterApi.rocker.raw"; }
    static public String getTemplatePackageName() { return "io.micronaut.starter.template.api"; }
    static public String getHeaderHash() { return "-2098718559"; }
    static public String[] getArgumentNames() { return new String[] { "micronautVersion", "serverURL" }; }

    // argument @ [4:2]
    private String micronautVersion;
    // argument @ [4:2]
    private String serverURL;

    public starterApi micronautVersion(String micronautVersion) {
        this.micronautVersion = micronautVersion;
        return this;
    }

    public String micronautVersion() {
        return this.micronautVersion;
    }

    public starterApi serverURL(String serverURL) {
        this.serverURL = serverURL;
        return this;
    }

    public String serverURL() {
        return this.serverURL;
    }

    static public starterApi template(String micronautVersion, String serverURL) {
        return new starterApi()
            .micronautVersion(micronautVersion)
            .serverURL(serverURL);
    }

    @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 {

        // === Micronaut Starter 
        static private final String PLAIN_TEXT_0_0 = "=== Micronaut Starter ";
        //  (
        static private final String PLAIN_TEXT_1_0 = " (";
        // )\n\nMicronaut Starter generates example project for the Micronaut framework (https://micronaut.io).\n\nThe API is defined by the OpenAPI 3 specification 
        static private final String PLAIN_TEXT_2_0 = ")\n\nMicronaut Starter generates example project for the Micronaut framework (https://micronaut.io).\n\nThe API is defined by the OpenAPI 3 specification ";
        // /swagger/views/swagger-ui/index.html\n\nThe primary API for generating application is 
        static private final String PLAIN_TEXT_3_0 = "/swagger/views/swagger-ui/index.html\n\nThe primary API for generating application is ";
        // /create/{type}/{name}.\n\nThe application type can be one of the following:\n\n+-----------------+------------------------------------------+\n| ID              | Description                              |\n+-----------------+------------------------------------------+\n
        static private final String PLAIN_TEXT_4_0 = "/create/{type}/{name}.\n\nThe application type can be one of the following:\n\n+-----------------+------------------------------------------+\n| ID              | Description                              |\n+-----------------+------------------------------------------+\n";
        // | 
        static private final String PLAIN_TEXT_5_0 = "| ";
        //  | 
        static private final String PLAIN_TEXT_6_0 = " | ";
        //  |\n
        static private final String PLAIN_TEXT_7_0 = " |\n";
        // +-----------------+------------------------------------------+\n\nThe \"name\" can be whatever you choose.\n\nAvailable query parameters include:\n\n+-----------------+------------------------------------------+------------------------------+\n| Parameter       | Description                              | Default value                |\n+-----------------+------------------------------------------+------------------------------+\n| build           | The build system                         | ...
        static private final String PLAIN_TEXT_8_0 = "+-----------------+------------------------------------------+\n\nThe \"name\" can be whatever you choose.\n\nAvailable query parameters include:\n\n+-----------------+------------------------------------------+------------------------------+\n| Parameter       | Description                              | Default value                |\n+-----------------+------------------------------------------+------------------------------+\n| build           | The build system                         | gradle                       |\n| lang            | The target language                      | java                         |\n| test            | The test framework                       | junit                        |\n| features        | The features you wish to include         | defaults                     |\n+-----------------+------------------------------------------+------------------------------+\n\nTo view the possible features and their descriptions visit:\n\n";
        // /application-types/{type}/features\n\n=== Examples\n\nTo create a default application:\n\n    $ curl 
        static private final String PLAIN_TEXT_9_0 = "/application-types/{type}/features\n\n=== Examples\n\nTo create a default application:\n\n    $ curl ";
        // /create/DEFAULT/example -o example.zip\n\nTo create a Maven application:\n\n    $ curl 
        static private final String PLAIN_TEXT_10_0 = "/create/DEFAULT/example -o example.zip\n\nTo create a Maven application:\n\n    $ curl ";
        // /create/DEFAULT/example?build=maven -o example.zip\n\nTo create a Kotlin application:\n\n    $ curl 
        static private final String PLAIN_TEXT_11_0 = "/create/DEFAULT/example?build=maven -o example.zip\n\nTo create a Kotlin application:\n\n    $ curl ";
        // /create/DEFAULT/example?lang=kotlin -o example.zip\n
        static private final String PLAIN_TEXT_12_0 = "/create/DEFAULT/example?lang=kotlin -o example.zip\n";

        // argument @ [4:2]
        protected final String micronautVersion;
        // argument @ [4:2]
        protected final String serverURL;

        public Template(starterApi model) {
            super(model);
            __internal.setCharset("UTF-8");
            __internal.setContentType(getContentType());
            __internal.setTemplateName(getTemplateName());
            __internal.setTemplatePackageName(getTemplatePackageName());
            this.micronautVersion = model.micronautVersion();
            this.serverURL = model.serverURL();
        }

        @Override
        protected void __doRender() throws IOException, RenderingException {
            // PlainText @ [7:2]
            __internal.aboutToExecutePosInTemplate(7, 2);
            __internal.writeValue(PLAIN_TEXT_0_0);
            // ValueExpression @ [9:23]
            __internal.aboutToExecutePosInTemplate(9, 23);
            __internal.renderValue(micronautVersion, false);
            // PlainText @ [9:40]
            __internal.aboutToExecutePosInTemplate(9, 40);
            __internal.writeValue(PLAIN_TEXT_1_0);
            // ValueExpression @ [9:42]
            __internal.aboutToExecutePosInTemplate(9, 42);
            __internal.renderValue(serverURL, false);
            // PlainText @ [9:52]
            __internal.aboutToExecutePosInTemplate(9, 52);
            __internal.writeValue(PLAIN_TEXT_2_0);
            // ValueExpression @ [13:51]
            __internal.aboutToExecutePosInTemplate(13, 51);
            __internal.renderValue(serverURL, false);
            // PlainText @ [13:61]
            __internal.aboutToExecutePosInTemplate(13, 61);
            __internal.writeValue(PLAIN_TEXT_3_0);
            // ValueExpression @ [15:47]
            __internal.aboutToExecutePosInTemplate(15, 47);
            __internal.renderValue(serverURL, false);
            // PlainText @ [15:57]
            __internal.aboutToExecutePosInTemplate(15, 57);
            __internal.writeValue(PLAIN_TEXT_4_0);
            // ForBlockBegin @ [22:1]
            __internal.aboutToExecutePosInTemplate(22, 1);
            try {
                final com.fizzed.rocker.runtime.IterableForIterator __forIterator0 = new com.fizzed.rocker.runtime.IterableForIterator(ApplicationType.values());
                while (__forIterator0.hasNext()) {
                    final ApplicationType type = __forIterator0.next();
                    try {
                        // PlainText @ [22:57]
                        __internal.aboutToExecutePosInTemplate(22, 57);
                        __internal.writeValue(PLAIN_TEXT_5_0);
                        // ValueExpression @ [23:3]
                        __internal.aboutToExecutePosInTemplate(23, 3);
                        __internal.renderValue(String.format("%-" + 15 + "s",type.name()), false);
                        // PlainText @ [23:46]
                        __internal.aboutToExecutePosInTemplate(23, 46);
                        __internal.writeValue(PLAIN_TEXT_6_0);
                        // ValueExpression @ [23:49]
                        __internal.aboutToExecutePosInTemplate(23, 49);
                        __internal.renderValue(String.format("%-" + 40 + "s",type.getDescription()), false);
                        // PlainText @ [23:102]
                        __internal.aboutToExecutePosInTemplate(23, 102);
                        __internal.writeValue(PLAIN_TEXT_7_0);
                        // ForBlockEnd @ [22:1]
                        __internal.aboutToExecutePosInTemplate(22, 1);
                    } catch (com.fizzed.rocker.runtime.ContinueException e) {
                        // support for continuing for loops
                    }
                } // for end @ [22:1]
            } catch (com.fizzed.rocker.runtime.BreakException e) {
                // support for breaking for loops
            }
            // PlainText @ [24:2]
            __internal.aboutToExecutePosInTemplate(24, 2);
            __internal.writeValue(PLAIN_TEXT_8_0);
            // ValueExpression @ [42:1]
            __internal.aboutToExecutePosInTemplate(42, 1);
            __internal.renderValue(serverURL, false);
            // PlainText @ [42:11]
            __internal.aboutToExecutePosInTemplate(42, 11);
            __internal.writeValue(PLAIN_TEXT_9_0);
            // ValueExpression @ [48:12]
            __internal.aboutToExecutePosInTemplate(48, 12);
            __internal.renderValue(serverURL, false);
            // PlainText @ [48:22]
            __internal.aboutToExecutePosInTemplate(48, 22);
            __internal.writeValue(PLAIN_TEXT_10_0);
            // ValueExpression @ [52:12]
            __internal.aboutToExecutePosInTemplate(52, 12);
            __internal.renderValue(serverURL, false);
            // PlainText @ [52:22]
            __internal.aboutToExecutePosInTemplate(52, 22);
            __internal.writeValue(PLAIN_TEXT_11_0);
            // ValueExpression @ [56:12]
            __internal.aboutToExecutePosInTemplate(56, 12);
            __internal.renderValue(serverURL, false);
            // PlainText @ [56:22]
            __internal.aboutToExecutePosInTemplate(56, 22);
            __internal.writeValue(PLAIN_TEXT_12_0);
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy