Class MustacheEngineAdapter
- java.lang.Object
-
- org.openapitools.codegen.templating.MustacheEngineAdapter
-
- All Implemented Interfaces:
TemplatingEngineAdapter
public class MustacheEngineAdapter extends Object implements TemplatingEngineAdapter
-
-
Constructor Summary
Constructors Constructor Description MustacheEngineAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
compileTemplate(TemplatingExecutor executor, Map<String,Object> bundle, String templateFile)
Compiles a template into a stringReader
findTemplate(TemplatingExecutor generator, String name)
com.samskivert.mustache.Mustache.Compiler
getCompiler()
String[]
getFileExtensions()
String
getIdentifier()
Provides an identifier used to load the adapter.void
setCompiler(com.samskivert.mustache.Mustache.Compiler compiler)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openapitools.codegen.api.TemplatingEngineAdapter
handlesFile, templateExists
-
-
-
-
Method Detail
-
getIdentifier
public String getIdentifier()
Provides an identifier used to load the adapter. This could be a name, uuid, or any other string.- Specified by:
getIdentifier
in interfaceTemplatingEngineAdapter
- Returns:
- A string identifier.
-
compileTemplate
public String compileTemplate(TemplatingExecutor executor, Map<String,Object> bundle, String templateFile) throws IOException
Compiles a template into a string- Specified by:
compileTemplate
in interfaceTemplatingEngineAdapter
- Parameters:
executor
- From where we can fetch the templates content (e.g. an instance of DefaultGenerator)bundle
- The map of values to pass to the templatetemplateFile
- The name of the template (e.g. model.mustache )- Returns:
- the processed template result
- Throws:
IOException
- an error occurred in the template processing
-
findTemplate
public Reader findTemplate(TemplatingExecutor generator, String name)
-
getCompiler
public com.samskivert.mustache.Mustache.Compiler getCompiler()
-
setCompiler
public void setCompiler(com.samskivert.mustache.Mustache.Compiler compiler)
-
getFileExtensions
public String[] getFileExtensions()
- Specified by:
getFileExtensions
in interfaceTemplatingEngineAdapter
-
-