public final class ScaffoldedPages extends java.lang.Object
Expands a scaffolding template into a page, and names the page the build compiles from it so that the runtime resolver can find it.
The build and the resolver both come here, so a page is expanded and named by the same code
whichever of them does it. A page is named for the template's path, for readability, and for a
digest of the template and of the value of each name of the model the template mentions. A
template the build did not see, or saw expanded with a different model, so names a page that
does not exist rather than a different one. A name the template never mentions is left out, so
that a value that differs between the machine that built the application and the one running it
- packagePath follows the file separator - does not cost the page; a template that reads
the model without naming what it reads, through binding for instance, is named as though
it did not read it.
| Modifiers | Name | Description |
|---|---|---|
static java.lang.String |
DIRECTORY |
The directory under the views root that holds the compiled pages. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public static java.lang.String |
expand(byte[] template, java.util.Map<java.lang.String, ?> model)Expands a template with a model, as both the build and the resolver do. |
|
public static java.lang.String |
uri(java.lang.String templatePath, java.util.Map<java.lang.String, ?> model, byte[] template)The URI, relative to the views root, of the page expanded from a template with a model. |
| 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) |
The directory under the views root that holds the compiled pages. A controller's views are resolved from a directory named after a Java identifier, which cannot contain a hyphen, so no request for a controller's view reaches a page here.
Expands a template with a model, as both the build and the resolver do. A template is read as UTF-8 wherever it is expanded, so the page the build compiles is the page the resolver would have expanded, whatever encoding either JVM defaults to.
template - the template exactly as it is readmodel - the names the template is expanded withThe URI, relative to the views root, of the page expanded from a template with a model.
templatePath - the template's path under templates/scaffolding, without its
extension, such as show or admin/showmodel - the names the template is expanded with, including fullNametemplate - the template exactly as it is read