public class CompositeTemplateLoader extends java.lang.Object implements TemplateLoader
Combine two or more TemplateLoader as a single TemplateLoader.
TemplateLoaders are executed in the order they are provided.
Execution is as follows:
TemplateLoader is able to resolve a TemplateSource, that
TemplateSource is considered the response.TemplateLoader throws a IOException exception the next
TemplateLoader in the chain will be used.DEFAULT_PREFIX, DEFAULT_SUFFIX| Constructor and Description |
|---|
CompositeTemplateLoader(TemplateLoader... loaders)
Creates a new
CompositeTemplateLoader. |
| Modifier and Type | Method and Description |
|---|---|
java.nio.charset.Charset |
getCharset() |
java.lang.Iterable<TemplateLoader> |
getDelegates()
Returns the delegates template loaders.
|
java.lang.String |
getPrefix() |
java.lang.String |
getSuffix() |
java.lang.String |
resolve(java.lang.String location)
Resolve a relative location to an absolute location.
|
void |
setCharset(java.nio.charset.Charset charset)
Set the default charset.
|
void |
setPrefix(java.lang.String prefix)
Set the prefix that gets prepended to view names when building a URI.
|
void |
setSuffix(java.lang.String suffix)
Set the suffix that gets appended to view names when building a URI.
|
TemplateSource |
sourceAt(java.lang.String location)
Get a template source from location.
|
public CompositeTemplateLoader(TemplateLoader... loaders)
CompositeTemplateLoader.loaders - The template loader chain. At least two loaders must be provided.public TemplateSource sourceAt(java.lang.String location) throws java.io.IOException
TemplateLoadersourceAt in interface TemplateLoaderlocation - The location of the template source. Required.java.io.IOException - If the template's source can't be resolved.public java.lang.String resolve(java.lang.String location)
TemplateLoaderresolve in interface TemplateLoaderlocation - The candidate location.public java.lang.String getPrefix()
getPrefix in interface TemplateLoaderpublic java.lang.String getSuffix()
getSuffix in interface TemplateLoaderpublic void setPrefix(java.lang.String prefix)
TemplateLoadersetPrefix in interface TemplateLoaderprefix - The prefix that gets prepended to view names when building a
URI.public void setSuffix(java.lang.String suffix)
TemplateLoadersetSuffix in interface TemplateLoadersuffix - The suffix that gets appended to view names when building a URI.public void setCharset(java.nio.charset.Charset charset)
TemplateLoadersetCharset in interface TemplateLoadercharset - Charset.public java.nio.charset.Charset getCharset()
getCharset in interface TemplateLoaderpublic java.lang.Iterable<TemplateLoader> getDelegates()
Copyright © 2010 - 2023 Adobe. All Rights Reserved