Modifiers | Name | Description |
---|---|---|
protected File |
baseDir |
|
protected CommandLine |
commandLine |
|
protected GrailsConsole |
console |
|
protected FileSystemInteraction |
fileSystemInteraction |
|
protected GenerationContext |
generationContext |
|
protected TemplateRenderer |
templateRenderer |
Constructor and description |
---|
AbstractGenerator() |
Type Params | Return Type | Name and description |
---|---|---|
|
File |
call(Closure spec) |
|
void |
copyFile(String source, String destination) |
|
protected void |
createFile(String source, String destination, Map<String, Object> model, boolean overwrite) |
|
File |
dir(String name) Creates a new empty directory |
|
File |
dir(String name, Closure spec) Creates a new directory and allows to specify a subdirectory structure using the closure as a specification |
|
File |
file(Object path) |
|
File |
file(String name, CharSequence contents) Creates a file with the specified name and the text contents using the system default encoding. |
|
File |
file(String name, byte[] contents) Creates a file with the specified name and the specified binary contents |
|
File |
file(String name, File source) Creates a file with the specified name and the contents from the source file (copy). |
|
File |
file(String name, Closure spec) Creates a new file in the current directory, whose contents is going to be generated in the closure. |
|
protected File |
getBaseDir() |
|
protected String |
getDefaultPackageName() |
|
protected String |
getDefaultPackagePath() |
|
protected FileSystemInteraction |
getFileSystemInteraction() |
|
protected TemplateRenderer |
getTemplateRenderer() |
|
protected String |
getTemplateRoot() |
|
void |
init(GenerationContext generationContext) |
|
protected CodeGenConfig |
loadApplicationConfig() |
|
Object |
methodMissing(String name, Object args) |
|
void |
prependToFile(String destination, String text, Map<String, Object> args) |
|
void |
removeFile(String destination) |
|
void |
template(String source, String destination) |
|
void |
template(String source, String destination, Map<String, Object> model) |
|
void |
template(String source, String destination, Map<String, Object> model, boolean overwrite) |
Creates a new empty directory
name
- the name of the directory to createCreates a new directory and allows to specify a subdirectory structure using the closure as a specification
name
- name of the directory to be createdspec
- specification of the subdirectory structureCreates a file with the specified name and the text contents using the system default encoding.
name
- name of the file to be createdcontents
- the contents of the file, written using the system default encodingCreates a file with the specified name and the specified binary contents
name
- name of the file to be createdcontents
- the contents of the fileCreates a file with the specified name and the contents from the source file (copy).
name
- name of the file to be createdcontents
- the contents of the fileCreates a new file in the current directory, whose contents is going to be generated in the closure. The delegate of the closure is the file being created.
name
- name of the file to createspec
- closure for generating the file contents