source: josm/trunk/src/org/openstreetmap/josm/tools/template_engine/SearchExpressionCondition.java@ 12656

Last change on this file since 12656 was 12656, checked in by Don-vip, 7 years ago

see #15182 - move SearchCompiler from actions.search to data.osm.search

  • Property svn:eol-style set to native
File size: 867 bytes
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.tools.template_engine;
3
4import org.openstreetmap.josm.data.osm.search.SearchCompiler.Match;
5
6public class SearchExpressionCondition implements TemplateEntry {
7
8 private final Match condition;
9 private final TemplateEntry text;
10
11 public SearchExpressionCondition(Match condition, TemplateEntry text) {
12 this.condition = condition;
13 this.text = text;
14 }
15
16 @Override
17 public void appendText(StringBuilder result, TemplateEngineDataProvider dataProvider) {
18 text.appendText(result, dataProvider);
19 }
20
21 @Override
22 public boolean isValid(TemplateEngineDataProvider dataProvider) {
23 return dataProvider.evaluateCondition(condition);
24 }
25
26 @Override
27 public String toString() {
28 return condition + " '" + text + '\'';
29 }
30}
Note: See TracBrowser for help on using the repository browser.