Last change
on this file since 13003 was 13003, checked in by bastiK, 7 years ago |
see #14794 - add missing top level javadoc; minor refactoring for Condition
|
-
Property svn:eol-style
set to
native
|
File size:
1.2 KB
|
Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.tools.template_engine;
|
---|
3 |
|
---|
4 | /**
|
---|
5 | * Interface for one node in the abstract syntax tree that is the result of parsing a template
|
---|
6 | * string with {@link TemplateParser}.
|
---|
7 | *
|
---|
8 | * The node can either be branching (condition, context switch) or a leaf node (variable, static text).
|
---|
9 | * The root node, representing the entire template is also a {@code TemplateEntry}.
|
---|
10 | */
|
---|
11 | public interface TemplateEntry {
|
---|
12 | /**
|
---|
13 | * Execute this template by generating text for a given data provider.
|
---|
14 | * @param result the {@link StringBuilder} to append the text to
|
---|
15 | * @param dataProvider the data provider from which information should be compiled to a string
|
---|
16 | */
|
---|
17 | void appendText(StringBuilder result, TemplateEngineDataProvider dataProvider);
|
---|
18 |
|
---|
19 | /**
|
---|
20 | * Check if this template is applicable to the given data provider.
|
---|
21 | *
|
---|
22 | * @param dataProvider the data provider to check
|
---|
23 | * @return true if all conditions are fulfilled to apply the template (for instance all
|
---|
24 | * required key=value mappings are present), false otherwise
|
---|
25 | */
|
---|
26 | boolean isValid(TemplateEngineDataProvider dataProvider);
|
---|
27 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.