From 9d543ca184e961fbf33b7a22eacf58f7e88390ab Mon Sep 17 00:00:00 2001 From: Daniel Quathamer Date: Mon, 16 Mar 2026 10:17:58 +0100 Subject: [PATCH] =?UTF-8?q?Freemarker=20Parser=20bekommt=20Parametrisierun?= =?UTF-8?q?g=20#11=C2=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/de/superx/bin/FMParser.java | 10 ++++++++++ superx-build/build.xml | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/de/superx/bin/FMParser.java b/src/de/superx/bin/FMParser.java index 5235a92..9c5e358 100644 --- a/src/de/superx/bin/FMParser.java +++ b/src/de/superx/bin/FMParser.java @@ -43,6 +43,7 @@ public class FMParser extends TemplateProcessor { private Statement stm; private String isSimpleParser; + private String myParams=""; private static String sqlDialect; FMParser() { @@ -58,7 +59,16 @@ public class FMParser extends TemplateProcessor { outfile = GetOpts.getValue("-out:"); if (GetOpts.isPresent("-simpleParser")) isSimpleParser = GetOpts.getValue("-simpleParser:"); + if (GetOpts.isPresent("-params")) + myParams = GetOpts.getValue("-params"); + String input = StringUtils.readFile(new File(infile)); + if(myParams !="") + { + String paramName = "<<" +myParams.substring(0, myParams.indexOf("="))+">>"; + String paramVal = "'"+myParams.substring(myParams.indexOf("=") + 1)+"'"; + input=de.memtext.util.StringUtils.replace(input, paramName, paramVal); + } String output = ""; if (isSimpleParser != null && isSimpleParser.equalsIgnoreCase("true")) { output = simpleParser(dbprop, input); diff --git a/superx-build/build.xml b/superx-build/build.xml index 7784ceb..233ebe1 100644 --- a/superx-build/build.xml +++ b/superx-build/build.xml @@ -33,7 +33,7 @@ classname="org.codehaus.groovy.ant.Groovy" classpathref="classpath"/> - +