source: josm/trunk/src/org/openstreetmap/josm/tools/template_engine/StaticText.java@ 13805

Last change on this file since 13805 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: 905 bytes
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.tools.template_engine;
3
4/**
5 * {@link TemplateEntry} representing a static string.
6 * <p>
7 * When compiling the template result, the given string will simply be inserted at the current position.
8 */
9public class StaticText implements TemplateEntry {
10
11 private final String staticText;
12
13 /**
14 * Create a new {@code StaticText}.
15 * @param staticText the text to insert verbatim
16 */
17 public StaticText(String staticText) {
18 this.staticText = staticText;
19 }
20
21 @Override
22 public void appendText(StringBuilder result, TemplateEngineDataProvider dataProvider) {
23 result.append(staticText);
24 }
25
26 @Override
27 public boolean isValid(TemplateEngineDataProvider dataProvider) {
28 return true;
29 }
30
31 @Override
32 public String toString() {
33 return staticText;
34 }
35}
Note: See TracBrowser for help on using the repository browser.