public class ConditionalTemplateConfigurationFactory extends TemplateConfigurationFactory
TemplateConfiguration
directly, or another TemplateConfigurationFactory
's result, when
the specified matcher matches the template source.Constructor and Description |
---|
ConditionalTemplateConfigurationFactory(TemplateSourceMatcher matcher,
TemplateConfiguration templateConfiguration) |
ConditionalTemplateConfigurationFactory(TemplateSourceMatcher matcher,
TemplateConfigurationFactory templateConfigurationFactory) |
Modifier and Type | Method and Description |
---|---|
TemplateConfiguration |
get(java.lang.String sourceName,
java.lang.Object templateSource)
Returns (maybe creates) the
TemplateConfiguration for the given template source. |
protected void |
setConfigurationOfChildren(Configuration cfg)
Calls
TemplateConfiguration.setParentConfiguration(Configuration) on each enclosed
TemplateConfiguration and TemplateConfigurationFactory.setConfiguration(Configuration)
on each enclosed TemplateConfigurationFactory objects. |
getConfiguration, setConfiguration
public ConditionalTemplateConfigurationFactory(TemplateSourceMatcher matcher, TemplateConfigurationFactory templateConfigurationFactory)
public ConditionalTemplateConfigurationFactory(TemplateSourceMatcher matcher, TemplateConfiguration templateConfiguration)
public TemplateConfiguration get(java.lang.String sourceName, java.lang.Object templateSource) throws java.io.IOException, TemplateConfigurationFactoryException
TemplateConfigurationFactory
TemplateConfiguration
for the given template source.get
in class TemplateConfigurationFactory
sourceName
- The name (path) that was used for TemplateLoader.findTemplateSource(String)
. See
Template.getSourceName()
for details.templateSource
- The object returned by TemplateLoader.findTemplateSource(String)
.TemplateConfiguration
to apply, or null
if the there's no TemplateConfiguration
for
this template source.java.io.IOException
- Typically, if there factory needs further I/O to find out more about the template source, but that
fails.TemplateConfigurationFactoryException
- If there's a problem that's specific to the factory logic.protected void setConfigurationOfChildren(Configuration cfg)
TemplateConfigurationFactory
TemplateConfiguration.setParentConfiguration(Configuration)
on each enclosed
TemplateConfiguration
and TemplateConfigurationFactory.setConfiguration(Configuration)
on each enclosed TemplateConfigurationFactory
objects. It only supposed to call these on the direct
"children" of this object, not on the children of the children.setConfigurationOfChildren
in class TemplateConfigurationFactory