@CompileStatic class GroovyPageCompiler extends java.lang.Object
Used to compile GSP files into a specified target directory. The compiler creates 3 files per page. Firstly, it generates a GroovyPage derived class which is then compiled to a .class file. It also will generate a "_html.data" and a "_linenumbers.data" file which contain the static HTML parts of the page. These are read at runtime by the GroovyPagesTemplateEngine class.
| Type | Name and description |
|---|---|
GroovyClassLoader |
classLoader |
CompilerConfiguration |
compilerConfig |
ConfigMap |
configMap |
java.lang.String[] |
configs |
java.lang.String |
encoding |
java.lang.String |
expressionCodec |
java.io.File |
generatedGroovyPagesDirectory |
java.util.List<java.io.File> |
generatedViewsDirsDirectories of pages the build generated, compiled with those under viewsDir in the same compilation: a page among srcFiles under one of them is compiled, registered and named by its path under that directory, as though it were under viewsDir. |
java.util.Map<java.lang.String, java.lang.String> |
leftOutThe optional pages left out because they did not compile, each with the reason. |
GroovyPageInjectionOperation |
operation |
java.util.Set<java.lang.String> |
optionalPagesPages, by their paths under viewsDir or the generated directory holding them, that may be left out: one of these that does not compile is left out with a warning instead of failing the compilation. |
java.lang.String |
packagePrefix |
java.util.List<java.io.File> |
srcFiles |
java.io.File |
targetDir |
java.util.concurrent.ExecutorService |
threadPool |
java.lang.String |
viewPrefix |
java.io.File |
viewsDir |
| Constructor and description |
|---|
GroovyPageCompiler() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
java.util.Map |
compile()Compiles the given GSP pages and returns a Map of URI to classname mappings |
|
protected java.util.Map |
compileGSP(java.io.File viewsDir, java.io.File gspfile, java.lang.String viewPrefix, java.lang.String packagePrefix, java.util.Map compileGSPResults)Compiles an individual GSP file |
|
protected java.lang.Object |
generateJavaName(java.lang.String str) |
|
protected java.lang.String |
relativePath(java.io.File relbase, java.io.File file) |
|
void |
setCleanCompilerConfig(CompilerConfiguration c) |
|
void |
setCompilerConfig(CompilerConfiguration c) |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |
Directories of pages the build generated, compiled with those under viewsDir in the
same compilation: a page among srcFiles under one of them is compiled, registered and
named by its path under that directory, as though it were under viewsDir. A page
under viewsDir at the same path takes precedence, and the generated one is left out.
The optional pages left out because they did not compile, each with the reason.
Pages, by their paths under viewsDir or the generated directory holding them, that may be left out: one of these that does not compile is left out with a warning instead of failing the compilation.
Compiles the given GSP pages and returns a Map of URI to classname mappings
Compiles an individual GSP file
viewsDir - The base directory that contains the GSP viewgspfile - The actual GSP file referenceviewPrefix - The prefix to use for the path to the viewpackagePrefix - The package prefix to use which allows scoping for different applications and plugins