public class FixedTemplateReplacer extends AbstractTemplateReplacer
TemplateReplacer
which ignores any jamonContext
and replaces templates based on
a fixed list of template passed in at startup. While reflection is used when this class is
constructed, after that it is reflection-free.Constructor and Description |
---|
FixedTemplateReplacer(Collection<Class<? extends AbstractTemplateProxy>> replacements)
Create a new instance.
|
Modifier and Type | Method and Description |
---|---|
protected AbstractTemplateProxy.ReplacementConstructor |
findReplacement(Class<? extends AbstractTemplateProxy> proxyClass,
Object jamonContext)
Find an appropriate
AbstractTemplateProxy.ReplacementConstructor for a template, if there is one. |
getReplacement
public FixedTemplateReplacer(Collection<Class<? extends AbstractTemplateProxy>> replacements)
replacements
- A collection of replacing template classes.IllegalArgumentException
- if any of the passed in classes do not correspond to templates
which replace another template, or if two replacing templates replace the same
template.protected AbstractTemplateProxy.ReplacementConstructor findReplacement(Class<? extends AbstractTemplateProxy> proxyClass, Object jamonContext)
AbstractTemplateReplacer
AbstractTemplateProxy.ReplacementConstructor
for a template, if there is one.findReplacement
in class AbstractTemplateReplacer
proxyClass
- the class to find a replacement for.jamonContext
- the jamonContextReplacementConstructor
for the template which will serve as a replacement,
or null
if there is to be no replacement performed.Copyright © 2003–2016 Jamon developers. All rights reserved.