diff options
author | Håkon Hallingstad <hakon@yahooinc.com> | 2022-01-10 00:00:43 +0100 |
---|---|---|
committer | Håkon Hallingstad <hakon@yahooinc.com> | 2022-01-10 00:00:43 +0100 |
commit | 96ff49a50ce0569e9b7664c9ed3fb87d7e72cf17 (patch) | |
tree | 73f9362af94c7652160094c0e4218bf8187d05df /node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/template/TemplateDescriptor.java | |
parent | 8f58bcc8f3e6e6831bb609ffb72f32785184d2a2 (diff) |
Support comment and per-directive newline removal
Diffstat (limited to 'node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/template/TemplateDescriptor.java')
-rw-r--r-- | node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/template/TemplateDescriptor.java | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/template/TemplateDescriptor.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/template/TemplateDescriptor.java index 40e2c051f6a..568ed20aafb 100644 --- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/template/TemplateDescriptor.java +++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/template/TemplateDescriptor.java @@ -7,16 +7,18 @@ package com.yahoo.vespa.hosted.node.admin.task.util.template; * @author hakonhall */ public class TemplateDescriptor { + private static final char VARIABLE_DIRECTIVE_CHAR = '='; + private static final char REMOVE_NEWLINE_CHAR = '|'; + private static final char COMMENT_CHAR = '#'; + private String startDelimiter = "%{"; private String endDelimiter = "}"; - private boolean removeNewlineAfterSection = true; public TemplateDescriptor() {} public TemplateDescriptor(TemplateDescriptor that) { this.startDelimiter = that.startDelimiter; this.endDelimiter = that.endDelimiter; - this.removeNewlineAfterSection = that.removeNewlineAfterSection; } /** Use these delimiters instead of the standard "%{" and "}" to start and end a template directive. */ @@ -26,13 +28,10 @@ public class TemplateDescriptor { return this; } - /** Whether to remove a newline following each (non-variable) section, by default true. */ - public TemplateDescriptor setRemoveNewlineAfterSection(boolean removeNewlineAfterSection) { - this.removeNewlineAfterSection = removeNewlineAfterSection; - return this; - } - public String startDelimiter() { return startDelimiter; } public String endDelimiter() { return endDelimiter; } - public boolean removeNewlineAfterSection() { return removeNewlineAfterSection; } + + char variableDirectiveChar() { return VARIABLE_DIRECTIVE_CHAR; } + char removeNewlineChar() { return REMOVE_NEWLINE_CHAR; } + char commentChar() { return COMMENT_CHAR; } } |