Enum MustacheProvider
- java.lang.Object
-
- java.lang.Enum<MustacheProvider>
-
- com.github.mjeanroy.springmvc.view.mustache.configuration.MustacheProvider
-
- All Implemented Interfaces:
Serializable
,Comparable<MustacheProvider>
public enum MustacheProvider extends Enum<MustacheProvider>
Set of mustache provider. A mustache provider is an implementation that can be used to render mustache templates.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description AUTO
Option that detect class available on classpath and select the best implementation.HANDLEBARS
Mustache implementation that use handlebar java as internal compiler.JMUSTACHE
Mustache implementation that use jmustache as internal compiler.MUSTACHE_JAVA
Mustache implementation that use mustache.java java as internal compiler.NASHORN
Deprecated.Nashorn will be removed after jdk 11, so nashorn engine ill be removed in the next major version.SPI
Mustache implementation that use implementation registered using the ServiceProvider Interface added with jdk 1.6.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract String
configurationClass()
Get configuration class to import.MustacheCompiler
instantiate(org.springframework.context.ApplicationContext applicationContext)
Instantiate compiler using appropriate implementation.abstract boolean
isAvailable()
Check if implementation is available.static MustacheProvider
valueOf(String name)
Returns the enum constant of this type with the specified name.static MustacheProvider[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SPI
public static final MustacheProvider SPI
Mustache implementation that use implementation registered using the ServiceProvider Interface added with jdk 1.6.
-
JMUSTACHE
public static final MustacheProvider JMUSTACHE
Mustache implementation that use jmustache as internal compiler.
-
HANDLEBARS
public static final MustacheProvider HANDLEBARS
Mustache implementation that use handlebar java as internal compiler.
-
MUSTACHE_JAVA
public static final MustacheProvider MUSTACHE_JAVA
Mustache implementation that use mustache.java java as internal compiler.
-
NASHORN
@Deprecated public static final MustacheProvider NASHORN
Deprecated.Nashorn will be removed after jdk 11, so nashorn engine ill be removed in the next major version.Mustache implementation that use nashorn java as internal compiler.
-
AUTO
public static final MustacheProvider AUTO
Option that detect class available on classpath and select the best implementation.
-
-
Method Detail
-
values
public static MustacheProvider[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (MustacheProvider c : MustacheProvider.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static MustacheProvider valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException
- if the argument is null
-
configurationClass
public abstract String configurationClass()
Get configuration class to import.- Returns:
- Configuration class.
-
instantiate
public MustacheCompiler instantiate(org.springframework.context.ApplicationContext applicationContext) throws Exception
Instantiate compiler using appropriate implementation.- Parameters:
applicationContext
- Application to retrieve dependent beans.- Returns:
- Mustache compiler.
- Throws:
Exception
- If an error occurred while instantiating bean.
-
isAvailable
public abstract boolean isAvailable()
Check if implementation is available.- Returns:
- True if implementation can safely be used, false otherwise.
-
-