public class CompositeTemplateLoader extends java.lang.Object implements TemplateLoader
Combine two or more TemplateLoader
as a single TemplateLoader
.
TemplateLoader
s 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.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 |
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
TemplateLoader
sourceAt
in interface TemplateLoader
location
- 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)
TemplateLoader
resolve
in interface TemplateLoader
location
- The candidate location.public java.lang.String getPrefix()
getPrefix
in interface TemplateLoader
public java.lang.String getSuffix()
getSuffix
in interface TemplateLoader
public void setPrefix(java.lang.String prefix)
TemplateLoader
setPrefix
in interface TemplateLoader
prefix
- The prefix that gets prepended to view names when building a
URI.public void setSuffix(java.lang.String suffix)
TemplateLoader
setSuffix
in interface TemplateLoader
suffix
- The suffix that gets appended to view names when building a
URI.public java.lang.Iterable<TemplateLoader> getDelegates()
Copyright © 2010 - 2020 Adobe. All Rights Reserved