Ignore:
Timestamp:
2021-03-20T23:07:04+01:00 (4 years ago)
Author:
simon04
Message:

see #18949 - Tagging presets: value_template="..." for <text>

Use value_template to generate the value automatically based on other <text> values of this preset. For instance, "Bus {ref}: {from} → {to}" can be used to generate the name of a bus route relation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/template_engine/TemplateEntry.java

    r13003 r17610  
    1010 */
    1111public interface TemplateEntry {
     12
     13    /**
     14     * Execute this template by generating text for a given data provider.
     15     * @param dataProvider the data provider from which information should be compiled to a string
     16     * @return the generated text
     17     */
     18    default String getText(TemplateEngineDataProvider dataProvider) {
     19        StringBuilder sb = new StringBuilder();
     20        appendText(sb, dataProvider);
     21        return sb.toString();
     22    }
     23
    1224    /**
    1325     * Execute this template by generating text for a given data provider.
Note: See TracChangeset for help on using the changeset viewer.