public class CodegenUtils extends Object
| Constructor and Description |
|---|
CodegenUtils() |
| Modifier and Type | Method and Description |
|---|---|
static com.github.jknack.handlebars.Template |
compileTemplate(String defaultTemplateDir,
String templateName)
Compile given template
|
static String |
resolveValue(String variable)
Resolve variable value from environment variable if $env{} is used.
|
static String |
trim(String key) |
static void |
writeFile(Path filePath,
String content)
Writes a file with content to specified
filePath. |
static void |
writeGeneratedSources(List<GenSrcFile> sources,
Path srcPath,
boolean overwrite)
Write generated templates
|
public static final String ENV
public static void writeFile(Path filePath, String content) throws IOException
filePath.filePath - valid file path to write the contentcontent - content of the fileIOException - when a file operation failspublic static com.github.jknack.handlebars.Template compileTemplate(String defaultTemplateDir, String templateName) throws IOException
defaultTemplateDir - template directorytemplateName - template nameIOException - if file read went wrongpublic static void writeGeneratedSources(List<GenSrcFile> sources, Path srcPath, boolean overwrite) throws IOException
sources - list of source filessrcPath - source locationoverwrite - whether existing files overwrite or notIOException - if file write went wrongCopyright © 2019 WSO2. All rights reserved.