Class HandlebarsEngineAdapter
- java.lang.Object
-
- org.openapitools.codegen.api.AbstractTemplatingEngineAdapter
-
- org.openapitools.codegen.templating.HandlebarsEngineAdapter
-
- All Implemented Interfaces:
TemplatingEngineAdapter
public class HandlebarsEngineAdapter extends AbstractTemplatingEngineAdapter
-
-
Constructor Summary
Constructors Constructor Description HandlebarsEngineAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
compileTemplate(TemplatingExecutor executor, Map<String,Object> bundle, String templateFile)
com.github.jknack.handlebars.io.TemplateSource
findTemplate(TemplatingExecutor generator, String templateFile)
String[]
getFileExtensions()
String
getIdentifier()
Provides an identifier used to load the adapter.boolean
handlesFile(String filename)
Determine if the adapter handles compilation of the fileHandlebarsEngineAdapter
infiniteLoops(boolean infiniteLoops)
Enable/disable infiniteLoops setting for the Handlebars engine.void
setPrettyPrint(boolean prettyPrint)
-
Methods inherited from class org.openapitools.codegen.api.AbstractTemplatingEngineAdapter
getModifiedFileLocation
-
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
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.- Returns:
- A string identifier.
-
compileTemplate
public String compileTemplate(TemplatingExecutor executor, Map<String,Object> bundle, String templateFile) throws IOException
- Throws:
IOException
-
findTemplate
public com.github.jknack.handlebars.io.TemplateSource findTemplate(TemplatingExecutor generator, String templateFile)
-
getFileExtensions
public String[] getFileExtensions()
-
handlesFile
public boolean handlesFile(String filename)
Determine if the adapter handles compilation of the file- Parameters:
filename
- The template filename- Returns:
- True if the file should be compiled by this adapter, else false.
-
infiniteLoops
public HandlebarsEngineAdapter infiniteLoops(boolean infiniteLoops)
Enable/disable infiniteLoops setting for the Handlebars engine. Enabling this allows for recursive partial inclusion.- Parameters:
infiniteLoops
- Whether to enable (true) or disable (false)- Returns:
- this object
-
setPrettyPrint
public void setPrettyPrint(boolean prettyPrint)
-
-