public class DefaultGenerator extends AbstractGenerator implements Generator
| Modifier and Type | Field and Description |
|---|---|
protected CodegenConfig |
config |
protected CodegenIgnoreProcessor |
ignoreProcessor |
protected org.slf4j.Logger |
LOGGER |
protected io.swagger.v3.oas.models.OpenAPI |
openAPI |
protected ClientOptInput |
opts |
protected TemplatingEngineAdapter |
templatingEngine |
dryRun, dryRunStatusMap| Constructor and Description |
|---|
DefaultGenerator() |
DefaultGenerator(Boolean dryRun) |
| Modifier and Type | Method and Description |
|---|---|
List<File> |
generate() |
boolean |
getEnableMinimalUpdate()
Is the minimal-file-update option enabled?
|
String |
getFullTemplateContents(String templateName) |
Path |
getFullTemplatePath(String name)
Returns the path of a template, allowing access to the template where consuming literal contents aren't desirable or possible.
|
Generator |
opts(ClientOptInput opts) |
Map<String,List<CodegenOperation>> |
processPaths(io.swagger.v3.oas.models.Paths paths) |
protected File |
processTemplateToFile(Map<String,Object> templateData,
String templateName,
String outputFilename) |
void |
setGenerateMetadata(Boolean generateMetadata)
Programmatically disable the output of .openapi-generator/VERSION, .openapi-generator-ignore,
or other metadata files used by OpenAPI Generator.
|
void |
setGeneratorPropertyDefault(String key,
String value)
Set generator properties otherwise pulled from system properties.
|
protected File |
writeInputStreamToFile(String filename,
InputStream in,
String templateFile) |
File |
writeToFile(String filename,
byte[] contents)
Write bytes to a file
|
embeddedTemplateExists, getCPResourcePath, getFullTemplateFile, getTemplateReader, readResourceContents, readTemplate, writeToFileprotected final org.slf4j.Logger LOGGER
protected CodegenConfig config
protected ClientOptInput opts
protected io.swagger.v3.oas.models.OpenAPI openAPI
protected CodegenIgnoreProcessor ignoreProcessor
protected TemplatingEngineAdapter templatingEngine
public DefaultGenerator()
public DefaultGenerator(Boolean dryRun)
public boolean getEnableMinimalUpdate()
AbstractGeneratorgetEnableMinimalUpdate in class AbstractGeneratorpublic Generator opts(ClientOptInput opts)
public void setGenerateMetadata(Boolean generateMetadata)
generateMetadata - true: enable outputs, false: disable outputspublic void setGeneratorPropertyDefault(String key, String value)
key - The system property keyvalue - The system property valuepublic String getFullTemplateContents(String templateName)
getFullTemplateContents in interface TemplatingGeneratorpublic Path getFullTemplatePath(String name)
getFullTemplatePath in interface TemplatingGeneratorname - the template name (e.g. model.mustache)Path to the templateprotected File processTemplateToFile(Map<String,Object> templateData, String templateName, String outputFilename) throws IOException
IOExceptionpublic Map<String,List<CodegenOperation>> processPaths(io.swagger.v3.oas.models.Paths paths)
protected File writeInputStreamToFile(String filename, InputStream in, String templateFile) throws IOException
IOExceptionpublic File writeToFile(String filename, byte[] contents) throws IOException
writeToFile in class AbstractGeneratorfilename - The name of file to writecontents - The contents bytes. Typically this is a UTF-8 formatted string.IOException - If file cannot be written.Copyright © 2020. All rights reserved.