Enum Class DropwizardJStacheConfig

java.lang.Object
java.lang.Enum<DropwizardJStacheConfig>
io.jstach.opt.dropwizard.DropwizardJStacheConfig
All Implemented Interfaces:
Serializable, Comparable<DropwizardJStacheConfig>, Constable

Opinionated static config for dropwizard based on how dropwizard stores templates for Mustache.java. Place the below on a package-info.java where your JStache models are or if in a modular environment module-info.java

 @JStacheConfig(using = DropwizardJStacheConfig.class)
 // some class, package-info, module-info
 

 
Assuming you have a JStache model with class name MyView in package com.company.model The template location if not specified will default to: src/main/resources/com/company/model/MyModel.mustache.

This configuration will also enforce and check that your models implements JStacheViewSupport which provides JStacheViewSupport.toView().

Author:
agentgt
  • Method Details

    • values

      public static DropwizardJStacheConfig[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static DropwizardJStacheConfig valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null