From 161206536e8d6dc02a56fd664f8d79254c339b60 Mon Sep 17 00:00:00 2001 From: Palin Date: Mon, 9 Sep 2019 23:40:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=89=E8=A6=81=E6=B1=82=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/{ui/container => work}/ReportletPane.java | 2 +- .../java/com/fanruan/api/err/ValidationException.java | 5 ++++- .../java/com/fanruan/api/function/FunctionKit.java | 9 +++++++-- src/main/java/com/fanruan/api/newer/NodeVisitor.java | 4 ---- .../com/fanruan/api/newer/RHFunctionProcessor.java | 4 ---- .../com/fanruan/api/newer/TemplateSessionIDInfo.java | 4 ---- .../com/fanruan/api/report/TemplateSessionIDInfo.java | 9 +++++++++ .../com/fanruan/api/report/analy/data/NodeVisitor.java | 4 ++++ src/main/java/com/fanruan/api/util/RenderKit.java | 8 ++++---- src/test/java/com/fanruan/api/util/RenderKitTest.java | 10 +++++++++- 10 files changed, 38 insertions(+), 21 deletions(-) rename src/main/java/com/fanruan/api/design/{ui/container => work}/ReportletPane.java (66%) delete mode 100644 src/main/java/com/fanruan/api/newer/NodeVisitor.java delete mode 100644 src/main/java/com/fanruan/api/newer/RHFunctionProcessor.java delete mode 100644 src/main/java/com/fanruan/api/newer/TemplateSessionIDInfo.java create mode 100644 src/main/java/com/fanruan/api/report/TemplateSessionIDInfo.java create mode 100644 src/main/java/com/fanruan/api/report/analy/data/NodeVisitor.java diff --git a/src/main/java/com/fanruan/api/design/ui/container/ReportletPane.java b/src/main/java/com/fanruan/api/design/work/ReportletPane.java similarity index 66% rename from src/main/java/com/fanruan/api/design/ui/container/ReportletPane.java rename to src/main/java/com/fanruan/api/design/work/ReportletPane.java index 4337dcd..4671429 100644 --- a/src/main/java/com/fanruan/api/design/ui/container/ReportletPane.java +++ b/src/main/java/com/fanruan/api/design/work/ReportletPane.java @@ -1,4 +1,4 @@ -package com.fanruan.api.design.ui.container; +package com.fanruan.api.design.work; public class ReportletPane extends com.fr.design.gui.itree.filetree.ReportletPane { } diff --git a/src/main/java/com/fanruan/api/err/ValidationException.java b/src/main/java/com/fanruan/api/err/ValidationException.java index 1d8fcad..7da52c4 100644 --- a/src/main/java/com/fanruan/api/err/ValidationException.java +++ b/src/main/java/com/fanruan/api/err/ValidationException.java @@ -1,4 +1,7 @@ package com.fanruan.api.err; -public abstract class ValidationException extends com.fr.design.Exception.ValidationException { +/** + * 验证异常 + */ +public class ValidationException extends com.fr.design.Exception.ValidationException { } diff --git a/src/main/java/com/fanruan/api/function/FunctionKit.java b/src/main/java/com/fanruan/api/function/FunctionKit.java index adb5419..3aa6971 100644 --- a/src/main/java/com/fanruan/api/function/FunctionKit.java +++ b/src/main/java/com/fanruan/api/function/FunctionKit.java @@ -78,6 +78,7 @@ public class FunctionKit { return new NameAndDescription[0]; } + /** * 得到函数管理器实例 * @return 函数管理器 @@ -86,8 +87,12 @@ public class FunctionKit { return com.fr.file.FunctionManager.getInstance(); } - public static int generateFunctionID(String var0) { - return FunctionHelper.generateFunctionID(var0); + /** + * 得到函数标识 + * @return 函数标识 + */ + public static int generateFunctionID(String string) { + return FunctionHelper.generateFunctionID(string); } } \ No newline at end of file diff --git a/src/main/java/com/fanruan/api/newer/NodeVisitor.java b/src/main/java/com/fanruan/api/newer/NodeVisitor.java deleted file mode 100644 index 3abc52c..0000000 --- a/src/main/java/com/fanruan/api/newer/NodeVisitor.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.fanruan.api.newer; - -public abstract class NodeVisitor extends com.fr.stable.core.NodeVisitor { -} diff --git a/src/main/java/com/fanruan/api/newer/RHFunctionProcessor.java b/src/main/java/com/fanruan/api/newer/RHFunctionProcessor.java deleted file mode 100644 index 374e5cf..0000000 --- a/src/main/java/com/fanruan/api/newer/RHFunctionProcessor.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.fanruan.api.newer; - -public abstract class RHFunctionProcessor extends com.fr.plugin.form.widget.monitor.RHFunctionProcessor { -} diff --git a/src/main/java/com/fanruan/api/newer/TemplateSessionIDInfo.java b/src/main/java/com/fanruan/api/newer/TemplateSessionIDInfo.java deleted file mode 100644 index 160fdcd..0000000 --- a/src/main/java/com/fanruan/api/newer/TemplateSessionIDInfo.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.fanruan.api.newer; - -public abstract class TemplateSessionIDInfo extends com.fr.web.core.TemplateSessionIDInfo { -} diff --git a/src/main/java/com/fanruan/api/report/TemplateSessionIDInfo.java b/src/main/java/com/fanruan/api/report/TemplateSessionIDInfo.java new file mode 100644 index 0000000..0a8e8cd --- /dev/null +++ b/src/main/java/com/fanruan/api/report/TemplateSessionIDInfo.java @@ -0,0 +1,9 @@ +package com.fanruan.api.report; + +/** + * @author Palin + * @version 10.0 + * Created by Palin on 2019/9/9 0009 + */ +public abstract class TemplateSessionIDInfo extends com.fr.web.core.TemplateSessionIDInfo{ +} diff --git a/src/main/java/com/fanruan/api/report/analy/data/NodeVisitor.java b/src/main/java/com/fanruan/api/report/analy/data/NodeVisitor.java new file mode 100644 index 0000000..4029665 --- /dev/null +++ b/src/main/java/com/fanruan/api/report/analy/data/NodeVisitor.java @@ -0,0 +1,4 @@ +package com.fanruan.api.report.analy.data; + +public abstract class NodeVisitor extends com.fr.stable.core.NodeVisitor { +} diff --git a/src/main/java/com/fanruan/api/util/RenderKit.java b/src/main/java/com/fanruan/api/util/RenderKit.java index cf5311c..653aab7 100644 --- a/src/main/java/com/fanruan/api/util/RenderKit.java +++ b/src/main/java/com/fanruan/api/util/RenderKit.java @@ -23,13 +23,13 @@ public class RenderKit { /** * 根据参数, 来计算文档字符串 - * @param var0 待渲染的文本模板 - * @param var1 参数集合 + * @param string 待渲染的文本模板 + * @param calculator 参数集合 * @return 返回渲染后的文本 * @throws Exception 渲染过程中出现错误则抛出此异常 */ - public static String render(String var0, Calculator var1) throws Exception { - return TemplateUtils.render(var0, var1); + public static String render(String string, Calculator calculator) throws Exception { + return TemplateUtils.render(string, calculator); } } diff --git a/src/test/java/com/fanruan/api/util/RenderKitTest.java b/src/test/java/com/fanruan/api/util/RenderKitTest.java index 4c53c41..78b498b 100644 --- a/src/test/java/com/fanruan/api/util/RenderKitTest.java +++ b/src/test/java/com/fanruan/api/util/RenderKitTest.java @@ -25,4 +25,12 @@ public class RenderKitTest extends Prepare { String text = "${name} is ${age} years old, he earned ${salary} dollars per month."; Assert.assertEquals("Alex is 20 years old, he earned 100 dollars per month.", RenderKit.renderParameter4Tpl(text, map)); } -} \ No newline at end of file + + @Test + public void render() throws Exception{ + String string = new String("a"); + Calculator calculator = new Calculator("b"); + Assert.assertEquals("a", RenderKit.render(string)); + Assert.assertEquals("b", RenderKit.render(calculator)); + } +}