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 StringcompileTemplate(TemplatingExecutor executor, Map<String,Object> bundle, String templateFile)Compiles a template into a stringReaderfindTemplate(TemplatingExecutor generator, String name)String[]getFileExtensions()StringgetIdentifier()Provides an identifier used to load the adapter.-
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:
getIdentifierin 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:
compileTemplatein 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)
-
getFileExtensions
public String[] getFileExtensions()
- Specified by:
getFileExtensionsin interfaceTemplatingEngineAdapter
-
-