相关代码
${column.nullableString?string("N","Y")?right_pad(5," ")}错误信息
五月 11, 2017 5:09:23 下午 freemarker.log._JULLoggerFactory$JULLogger error 严重: Error executing FreeMarker template FreeMarker template error: For "...(...)" callee: Expected a method, but this has evaluated to a string (wrapper: f.t.SimpleScalar): ==> column.nullableString?string [in template "baseTemplate/java_src/${basepackage_dir}/interfaceDoc/${className}Doc.html" at line 101, column 86] ---- FTL stack trace ("~" means nesting-related): - Failed at: ${column.nullableString?string("N", "... [in template "baseTemplate/java_src/${basepackage_dir}/interfaceDoc/${className}Doc.html" at line 101, column 84] ---- Java stack trace (for programmers): ---- freemarker.core.NonMethodException: [... Exception message was already printed; see it above ...] at freemarker.core.MethodCall._eval(MethodCall.java:85) at freemarker.core.Expression.eval(Expression.java:81) at freemarker.core.Expression.evalAndCoerceToStringOrUnsupportedMarkup(Expression.java:107) at freemarker.core.BuiltInForString.getTargetString(BuiltInForString.java:34) at freemarker.core.BuiltInForString._eval(BuiltInForString.java:29) at freemarker.core.Expression.eval(Expression.java:81) at freemarker.core.MethodCall._eval(MethodCall.java:58) at freemarker.core.Expression.eval(Expression.java:81) at freemarker.core.DollarVariable.calculateInterpolatedStringOrMarkup(DollarVariable.java:96) at freemarker.core.DollarVariable.accept(DollarVariable.java:59) at freemarker.core.Environment.visit(Environment.java:362) at freemarker.core.IteratorBlock$IterationContext.executedNestedContentForCollOrSeqListing(IteratorBlock.java:315) at freemarker.core.IteratorBlock$IterationContext.executeNestedContent(IteratorBlock.java:271) at freemarker.core.IteratorBlock$IterationContext.accept(IteratorBlock.java:242) at freemarker.core.Environment.visitIteratorBlock(Environment.java:595) at freemarker.core.IteratorBlock.acceptWithResult(IteratorBlock.java:107) at freemarker.core.IteratorBlock.accept(IteratorBlock.java:93) at freemarker.core.Environment.visit(Environment.java:326) at freemarker.core.Environment.visit(Environment.java:332) at freemarker.core.Environment.process(Environment.java:305) at freemarker.template.Template.process(Template.java:378) at cn.org.rapid_framework.generator.Generator.saveNewOutputFileContent(Generator.java:233) at cn.org.rapid_framework.generator.Generator.generateNewFileOrInsertIntoFile(Generator.java:167) at cn.org.rapid_framework.generator.Generator.generateByModelProvider(Generator.java:126) at cn.org.rapid_framework.generator.Generator.generateByModelProvider(Generator.java:83) at cn.org.rapid_framework.generator.GeneratorFacade.generateByTable(GeneratorFacade.java:117) at cn.org.rapid_framework.generator.GeneratorMain.main(GeneratorMain.java:76) Exception in thread "main" java.lang.RuntimeException: generate 'Database Table:equipment to ClassName:Equipment' oucur error,template is:baseTemplate/java_src/${basepackage_dir}/interfaceDoc/${className}Doc.html at cn.org.rapid_framework.generator.Generator.generateByModelProvider(Generator.java:128) at cn.org.rapid_framework.generator.Generator.generateByModelProvider(Generator.java:83) at cn.org.rapid_framework.generator.GeneratorFacade.generateByTable(GeneratorFacade.java:117) at cn.org.rapid_framework.generator.GeneratorMain.main(GeneratorMain.java:76) Caused by: freemarker.core.NonMethodException: For "...(...)" callee: Expected a method, but this has evaluated to a string (wrapper: f.t.SimpleScalar): ==> column.nullableString?string [in template "baseTemplate/java_src/${basepackage_dir}/interfaceDoc/${className}Doc.html" at line 101, column 86] ---- FTL stack trace ("~" means nesting-related): - Failed at: ${column.nullableString?string("N", "... [in template "baseTemplate/java_src/${basepackage_dir}/interfaceDoc/${className}Doc.html" at line 101, column 84] ---- at freemarker.core.MethodCall._eval(MethodCall.java:85) at freemarker.core.Expression.eval(Expression.java:81) at freemarker.core.Expression.evalAndCoerceToStringOrUnsupportedMarkup(Expression.java:107) at freemarker.core.BuiltInForString.getTargetString(BuiltInForString.java:34) at freemarker.core.BuiltInForString._eval(BuiltInForString.java:29) at freemarker.core.Expression.eval(Expression.java:81) at freemarker.core.MethodCall._eval(MethodCall.java:58) at freemarker.core.Expression.eval(Expression.java:81) at freemarker.core.DollarVariable.calculateInterpolatedStringOrMarkup(DollarVariable.java:96) at freemarker.core.DollarVariable.accept(DollarVariable.java:59) at freemarker.core.Environment.visit(Environment.java:362) at freemarker.core.IteratorBlock$IterationContext.executedNestedContentForCollOrSeqListing(IteratorBlock.java:315) at freemarker.core.IteratorBlock$IterationContext.executeNestedContent(IteratorBlock.java:271) at freemarker.core.IteratorBlock$IterationContext.accept(IteratorBlock.java:242) at freemarker.core.Environment.visitIteratorBlock(Environment.java:595) at freemarker.core.IteratorBlock.acceptWithResult(IteratorBlock.java:107) at freemarker.core.IteratorBlock.accept(IteratorBlock.java:93) at freemarker.core.Environment.visit(Environment.java:326) at freemarker.core.Environment.visit(Environment.java:332) at freemarker.core.Environment.process(Environment.java:305) at freemarker.template.Template.process(Template.java:378) at cn.org.rapid_framework.generator.Generator.saveNewOutputFileContent(Generator.java:233) at cn.org.rapid_framework.generator.Generator.generateNewFileOrInsertIntoFile(Generator.java:167) at cn.org.rapid_framework.generator.Generator.generateByModelProvider(Generator.java:126) ... 3 more
必须使用单引号,双引号都不行;
${column.nullable?string('N','Y')?right_pad(5," ")}