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.3 KB
|
Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.tools.template_engine;
|
---|
3 |
|
---|
4 | import java.util.Collection;
|
---|
5 |
|
---|
6 | import org.openstreetmap.josm.data.osm.search.SearchCompiler.Match;
|
---|
7 |
|
---|
8 | /**
|
---|
9 | * Interface for objects that can be used with a template to generate a string.
|
---|
10 | * <p>
|
---|
11 | * Provides the necessary information for the template to be applied.
|
---|
12 | */
|
---|
13 | public interface TemplateEngineDataProvider {
|
---|
14 | /**
|
---|
15 | * Get the collection of all keys that can be mapped to values.
|
---|
16 | * @return all keys that can be mapped to values
|
---|
17 | */
|
---|
18 | Collection<String> getTemplateKeys();
|
---|
19 |
|
---|
20 | /**
|
---|
21 | * Map a key to a value given the properties of the object.
|
---|
22 | * @param key the key to map
|
---|
23 | * @param special if the key is a "special:*" keyword that is used
|
---|
24 | * to get certain information or automated behavior
|
---|
25 | * @return a value that the key is mapped to or "special" information in case {@code special} is true
|
---|
26 | */
|
---|
27 | Object getTemplateValue(String key, boolean special);
|
---|
28 |
|
---|
29 | /**
|
---|
30 | * Check if a condition holds for the object represented by this {@link TemplateEngineDataProvider}.
|
---|
31 | * @param condition the condition to check (which is a search expression)
|
---|
32 | * @return true if the condition holds
|
---|
33 | */
|
---|
34 | boolean evaluateCondition(Match condition);
|
---|
35 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.