001package io.jstach.opt.dropwizard;
002
003import io.jstach.jstache.JStacheConfig;
004import io.jstach.jstache.JStacheInterfaces;
005import io.jstach.jstache.JStachePath;
006
007/**
008 * Opinionated static config for dropwizard based on how dropwizard stores templates for
009 * Mustache.java. Place the below on a <code>package-info.java</code> where your JStache
010 * models are or if in a modular environment <code>module-info.java</code>
011 *
012 * <pre><code class="language-java">
013 * &#64;JStacheConfig(using = DropwizardJStacheConfig.class)
014 * &#47;&#47; some class, package-info, module-info
015 * </code>
016 *
017 * </pre> Assuming you have a JStache model with class name <code>MyView</code> in package
018 * <code>com.company.model</code> The template location if not specified will default to:
019 * <code>src/main/resources/com/company/model/MyModel.mustache</code>.
020 * <p>
021 * This configuration will also enforce and check that your models <code>implements</code>
022 * {@link JStacheViewSupport} which provides {@link JStacheViewSupport#toView()}.
023 * @author agentgt
024 *
025 */
026@JStacheConfig(pathing = @JStachePath(suffix = ".mustache"),
027                interfacing = @JStacheInterfaces(modelImplements = JStacheViewSupport.class,
028                                templateImplements = ViewableTemplate.class))
029public enum DropwizardJStacheConfig {
030
031        // purposely empty
032
033}