public final class TemplateUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
deleteGeneratedFiles(net.roboconf.core.model.beans.Application app,
File outputDirectory)
Deletes the generated files for a given application.
|
static String |
findApplicationName(File templateDir,
File templateFile)
Finds an application name from a template file.
|
static Collection<TemplateEntry> |
findTemplatesForApplication(String appName,
Collection<TemplateEntry> templates)
Finds the templates that can apply to a given application.
|
static void |
generate(net.roboconf.core.model.beans.Application app,
File outputDirectory,
Collection<TemplateEntry> templates,
Logger logger)
Generates files from templates for a given application.
|
public static String findApplicationName(File templateDir, File templateFile)
templateDir - the templates root directory, the one being watched by the TemplateWatchertemplateFile - the template filenull for a template global to all applicationsIllegalStateException - if the provided templateFile does not matchpublic static void generate(net.roboconf.core.model.beans.Application app,
File outputDirectory,
Collection<TemplateEntry> templates,
Logger logger)
throws IOException
All the generated files for a given application are located
under outputDirectory/application-name. Even global templates
are output there.
app - an application (not null)outputDirectory - the output directory (not null)templates - a non-null collection of templateslogger - a loggerIOException - if something went wrongpublic static void deleteGeneratedFiles(net.roboconf.core.model.beans.Application app,
File outputDirectory)
app - an application (not null)outputDirectory - the output directory (not null)public static Collection<TemplateEntry> findTemplatesForApplication(String appName, Collection<TemplateEntry> templates)
appName - an application name (can be null to match all)templates - a non-null collection of templatesCopyright © 2017. All rights reserved.