groovy.xml.StreamingMarkupBuilder to generate XML/XHTML.
| Modifier and Type | Class and Description |
|---|---|
| public static class | MarkupTemplateEngine.
A template resolver which avoids calling |
| public static class | |
| private class | MarkupTemplateEngine.
Implements the |
| pack-priv static class | MarkupTemplateEngine.
A specialized GroovyClassLoader which will support passing values to the type checking extension thanks to a thread local. |
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| private final Map | |
| private final CompilerConfiguration | |
| private static final AtomicLong | |
| private static final boolean | |
| private final MarkupTemplateEngine. | |
| private static final Pattern | |
| pack-priv static final ClassNode | |
| pack-priv static final String | |
| private final TemplateConfiguration | |
| private final TemplateResolver |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public | MarkupTemplateEngine(final ClassLoader parentLoader, final TemplateConfiguration config, final TemplateResolver resolver)
|
| public | MarkupTemplateEngine(final ClassLoader parentLoader, final File
directory where to find templates templateDirectory, TemplateConfiguration template engine configuration tplConfig)Convenience constructor to build a template engine which searches for templates into a directory |
| Modifier and Type | Method and Description |
|---|---|
| private static URL[] | |
| public Template | createTemplate(final Reader reader)
Implements abstract groovy. Creates a template by reading content from the Reader. |
| public Template | |
| public Template | createTemplate(final URL resource)
Overrides groovy. Creates a template from the content found at the URL using the default encoding. |
| public Template | |
| public Template | |
| public Template | |
| public Template | |
| public Template | |
| public Template | |
| public Template | |
| public CompilerConfiguration | |
| public TemplateConfiguration | |
| public GroovyClassLoader | |
| public URL |
| codeSourceCache | back to summary |
|---|---|
| private final Map<String, GroovyCodeSource> codeSourceCache | |
| compilerConfiguration | back to summary |
|---|---|
| private final CompilerConfiguration compilerConfiguration | |
| counter | back to summary |
|---|---|
| private static final AtomicLong counter | |
| DEBUG_BYTECODE | back to summary |
|---|---|
| private static final boolean DEBUG_BYTECODE | |
| groovyClassLoader | back to summary |
|---|---|
| private final MarkupTemplateEngine. | |
| LOCALIZED_RESOURCE_PATTERN | back to summary |
|---|---|
| private static final Pattern LOCALIZED_RESOURCE_PATTERN | |
| MARKUPTEMPLATEENGINE_CLASSNODE | back to summary |
|---|---|
| pack-priv static final ClassNode MARKUPTEMPLATEENGINE_CLASSNODE | |
| MODELTYPES_ASTKEY | back to summary |
|---|---|
| pack-priv static final String MODELTYPES_ASTKEY | |
| templateConfiguration | back to summary |
|---|---|
| private final TemplateConfiguration templateConfiguration | |
| templateResolver | back to summary |
|---|---|
| private final TemplateResolver templateResolver | |
| MarkupTemplateEngine | back to summary |
|---|---|
| public MarkupTemplateEngine() | |
| MarkupTemplateEngine | back to summary |
|---|---|
| public MarkupTemplateEngine(final TemplateConfiguration config) | |
| MarkupTemplateEngine | back to summary |
|---|---|
| public MarkupTemplateEngine(final ClassLoader parentLoader, final TemplateConfiguration config) | |
| MarkupTemplateEngine | back to summary |
|---|---|
| public MarkupTemplateEngine(final ClassLoader parentLoader, final TemplateConfiguration config, final TemplateResolver resolver) | |
| MarkupTemplateEngine | back to summary |
|---|---|
| public MarkupTemplateEngine(final ClassLoader parentLoader, final File templateDirectory, TemplateConfiguration tplConfig) Convenience constructor to build a template engine which searches for templates into a directory
| |
| buildURLs | back to summary |
|---|---|
| private static URL[] buildURLs(final File templateDirectory) | |
| createTemplate | back to summary |
|---|---|
| public Template createTemplate(final Reader reader) throws CompilationFailedException, ClassNotFoundException, IOException Implements abstract groovy. Doc from groovy. Creates a template by reading content from the Reader. | |
| createTemplate | back to summary |
|---|---|
| public Template createTemplate(final Reader reader, String sourceName) throws CompilationFailedException, ClassNotFoundException, IOException | |
| createTemplate | back to summary |
|---|---|
| public Template createTemplate(final URL resource) throws CompilationFailedException, ClassNotFoundException, IOException Overrides groovy. Doc from groovy. Creates a template from the content found at the URL using the default encoding.
Please consider using
| |
| createTemplateByPath | back to summary |
|---|---|
| public Template createTemplateByPath(final String templatePath) throws CompilationFailedException, ClassNotFoundException, IOException | |
| createTypeCheckedModelTemplate | back to summary |
|---|---|
| public Template createTypeCheckedModelTemplate(final String source, Map<String, String> modelTypes) throws CompilationFailedException, ClassNotFoundException, IOException | |
| createTypeCheckedModelTemplate | back to summary |
|---|---|
| public Template createTypeCheckedModelTemplate(final String source, String sourceName, Map<String, String> modelTypes) throws CompilationFailedException, ClassNotFoundException, IOException | |
| createTypeCheckedModelTemplate | back to summary |
|---|---|
| public Template createTypeCheckedModelTemplate(final Reader reader, Map<String, String> modelTypes) throws CompilationFailedException, ClassNotFoundException, IOException | |
| createTypeCheckedModelTemplate | back to summary |
|---|---|
| public Template createTypeCheckedModelTemplate(final Reader reader, String sourceName, Map<String, String> modelTypes) throws CompilationFailedException, ClassNotFoundException, IOException | |
| createTypeCheckedModelTemplate | back to summary |
|---|---|
| public Template createTypeCheckedModelTemplate(final URL resource, Map<String, String> modelTypes) throws CompilationFailedException, ClassNotFoundException, IOException | |
| createTypeCheckedModelTemplateByPath | back to summary |
|---|---|
| public Template createTypeCheckedModelTemplateByPath(final String templatePath, Map<String, String> modelTypes) throws CompilationFailedException, ClassNotFoundException, IOException | |
| getCompilerConfiguration | back to summary |
|---|---|
| public CompilerConfiguration getCompilerConfiguration() | |
| getTemplateConfiguration | back to summary |
|---|---|
| public TemplateConfiguration getTemplateConfiguration() | |
| getTemplateLoader | back to summary |
|---|---|
| public GroovyClassLoader getTemplateLoader() | |
| resolveTemplate | back to summary |
|---|---|
| public URL resolveTemplate(String templatePath) throws IOException | |
ClassLoader#getResource(String) if a template path already has
been queried before. This improves performance if caching is enabled in the configuration.
| Modifier and Type | Field and Description |
|---|---|
| protected final Map | |
| protected boolean |
| Access | Constructor and Description |
|---|---|
| public | CachingTemplateResolver(final Map<String, URL>
the backing cache cache)Creates a new caching template resolver. |
| public | CachingTemplateResolver()
Creates a new caching template resolver using a concurrent hash map as the backing cache. |
| Modifier and Type | Method and Description |
|---|---|
| public void | configure(final ClassLoader
the classloader where templates will be searched for templateClassLoader, final TemplateConfiguration the configuration of the template engine configuration)Overrides groovy. Implements groovy. This method is called once the template engine is initialized, providing the resolver with the template engine configuration and its template class loader. |
| public URL | resolveTemplate(final String
path to the template templatePath)Overrides groovy. Implements groovy. Resolvers must implement this method in order to resolve a template, given a template path. |
| cache | back to summary |
|---|---|
| protected final Map<String, URL> cache | |
| useCache | back to summary |
|---|---|
| protected boolean useCache | |
| CachingTemplateResolver | back to summary |
|---|---|
| public CachingTemplateResolver(final Map<String, URL> cache) Creates a new caching template resolver. The cache implementation being used depends on the use of the template engine. If multiple templates can be rendered in parallel, it must be using a thread-safe cache. | |
| CachingTemplateResolver | back to summary |
|---|---|
| public CachingTemplateResolver() Creates a new caching template resolver using a concurrent hash map as the backing cache. | |
| configure | back to summary |
|---|---|
| public void configure(final ClassLoader templateClassLoader, final TemplateConfiguration configuration) Overrides groovy. Implements groovy. Doc from groovy. This method is called once the template engine is initialized, providing the resolver with the template engine configuration and its template class loader.
| |
| resolveTemplate | back to summary |
|---|---|
| public URL resolveTemplate(final String templatePath) throws IOException Overrides groovy. Implements groovy. Doc from groovy. Resolvers must implement this method in order to resolve a template, given a template path. They must return a valid URL or an IOException. | |
| Modifier and Type | Field and Description |
|---|---|
| private ClassLoader | |
| private TemplateConfiguration |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | configure(final ClassLoader
the classloader where templates will be searched for templateClassLoader, final TemplateConfiguration the configuration of the template engine configuration)Implements groovy. This method is called once the template engine is initialized, providing the resolver with the template engine configuration and its template class loader. |
| public URL | resolveTemplate(final String
path to the template templatePath)Implements groovy. Resolvers must implement this method in order to resolve a template, given a template path. |
| templateClassLoader | back to summary |
|---|---|
| private ClassLoader templateClassLoader | |
| templateConfiguration | back to summary |
|---|---|
| private TemplateConfiguration templateConfiguration | |
| DefaultTemplateResolver | back to summary |
|---|---|
| public DefaultTemplateResolver() | |
| configure | back to summary |
|---|---|
| public void configure(final ClassLoader templateClassLoader, final TemplateConfiguration configuration) Implements groovy. Doc from groovy. This method is called once the template engine is initialized, providing the resolver with the template engine configuration and its template class loader.
| |
| resolveTemplate | back to summary |
|---|---|
| public URL resolveTemplate(final String templatePath) throws IOException Implements groovy. Doc from groovy. Resolvers must implement this method in order to resolve a template, given a template path. They must return a valid URL or an IOException. | |
groovy.text.Template interface by caching a compiled template script and keeping a
reference to the optional map of types of the model elements.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final Map | |
| pack-priv final Class |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| modeltypes | back to summary |
|---|---|
| pack-priv final Map<String, String> modeltypes | |
| templateClass | back to summary |
|---|---|
| pack-priv final Class<BaseTemplate> templateClass | |
| MarkupTemplateMaker | back to summary |
|---|---|
public MarkupTemplateMaker(final Reader reader, String sourceName, Map<String, String> modelTypes)
| |
| MarkupTemplateMaker | back to summary |
|---|---|
public MarkupTemplateMaker(final URL resource, Map<String, String> modelTypes) throws IOException
| |
| make | back to summary |
|---|---|
| public Writable make() Implements groovy. | |
| make | back to summary |
|---|---|
| public Writable make(final Map<K, V> binding) Implements groovy. | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final ThreadLocal |
| Access | Constructor and Description |
|---|---|
| public | TemplateGroovyClassLoader(final ClassLoader parentLoader, final CompilerConfiguration compilerConfiguration)
|
| Modifier and Type | Method and Description |
|---|---|
| public Class |
| modelTypes | back to summary |
|---|---|
| pack-priv static final ThreadLocal<Map<String, String>> modelTypes | |
| TemplateGroovyClassLoader | back to summary |
|---|---|
| public TemplateGroovyClassLoader(final ClassLoader parentLoader, final CompilerConfiguration compilerConfiguration) | |
| parseClass | back to summary |
|---|---|
| public Class | |
| Modifier and Type | Field and Description |
|---|---|
| private final String | |
| private final String | |
| private final String |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public static MarkupTemplateEngine. | |
| public String | |
| public MarkupTemplateEngine. |
| baseName | back to summary |
|---|---|
| private final String baseName | |
| extension | back to summary |
|---|---|
| private final String extension | |
| locale | back to summary |
|---|---|
| private final String locale | |
| TemplateResource | back to summary |
|---|---|
| private TemplateResource(final String baseName, final String locale, final String extension) | |
| hasLocale | back to summary |
|---|---|
| public boolean hasLocale() | |
| parse | back to summary |
|---|---|
| public static MarkupTemplateEngine. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
| withLocale | back to summary |
|---|---|
| public MarkupTemplateEngine. | |