Package org.openbravo.client.kernel
Interface TemplateProcessor
-
- All Known Implementing Classes:
BaseTemplateProcessor
,FreemarkerTemplateProcessor
public interface TemplateProcessor
Processes a template with data passed into it. A template processor is used as a singleton so multiple threads may use one template processor at the same time.- Author:
- mtaal
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
TemplateProcessor.Qualifier
Defines the qualifier for instance selection.static class
TemplateProcessor.Registry
static class
TemplateProcessor.Selector
A class used to select the correct implementation.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clearCache()
Is called by the kernel to signal that a template has changed and that TemplateProcessors should clear their cache and reload the templates.String
getTemplateLanguage()
String
process(Template template, Map<String,Object> data)
Processes a template and returns the result as a string.void
validate(Template template)
Validates if a certain template object is valid.
-
-
-
Method Detail
-
validate
void validate(Template template) throws ValidationException
Validates if a certain template object is valid. If not valid then aValidationException
is thrown.- Parameters:
template
- the template to validate- Throws:
ValidationException
-
process
String process(Template template, Map<String,Object> data)
Processes a template and returns the result as a string.- Parameters:
template
- the template to process.data
- the data to use in the template- Returns:
- the template process result.
-
clearCache
void clearCache()
Is called by the kernel to signal that a template has changed and that TemplateProcessors should clear their cache and reload the templates.
-
getTemplateLanguage
String getTemplateLanguage()
- Returns:
- the template language supported by this template processor
-
-