Browse Source

Freemarker Parser bekommt Parametrisierung #11§

master
Daniel Quathamer 9 hours ago
parent
commit
9d543ca184
  1. 10
      src/de/superx/bin/FMParser.java
  2. 2
      superx-build/build.xml

10
src/de/superx/bin/FMParser.java

@ -43,6 +43,7 @@ public class FMParser extends TemplateProcessor {
private Statement stm; private Statement stm;
private String isSimpleParser; private String isSimpleParser;
private String myParams="";
private static String sqlDialect; private static String sqlDialect;
FMParser() { FMParser() {
@ -58,7 +59,16 @@ public class FMParser extends TemplateProcessor {
outfile = GetOpts.getValue("-out:"); outfile = GetOpts.getValue("-out:");
if (GetOpts.isPresent("-simpleParser")) if (GetOpts.isPresent("-simpleParser"))
isSimpleParser = GetOpts.getValue("-simpleParser:"); isSimpleParser = GetOpts.getValue("-simpleParser:");
if (GetOpts.isPresent("-params"))
myParams = GetOpts.getValue("-params");
String input = StringUtils.readFile(new File(infile)); 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 = ""; String output = "";
if (isSimpleParser != null && isSimpleParser.equalsIgnoreCase("true")) { if (isSimpleParser != null && isSimpleParser.equalsIgnoreCase("true")) {
output = simpleParser(dbprop, input); output = simpleParser(dbprop, input);

2
superx-build/build.xml

@ -33,7 +33,7 @@
classname="org.codehaus.groovy.ant.Groovy" classname="org.codehaus.groovy.ant.Groovy"
classpathref="classpath"/> classpathref="classpath"/>
<property name="version" value="5.2" /> <property name="version" value="5.3b" />
<target name="initTimestamp"> <target name="initTimestamp">

Loading…
Cancel
Save