From 64ea8befd0b2651a72c2b7ff439bd887ee1d2434 Mon Sep 17 00:00:00 2001 From: "Mars.Ma" Date: Thu, 5 Sep 2019 11:50:19 +0800 Subject: [PATCH 1/7] =?UTF-8?q?KERNEL-1198=20JSON=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E7=AC=AC=E4=B8=80=E6=B3=A2FineKit=E6=8F=90=E4=BA=A4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fanruan/api/cal/Parameter.java | 4 ++++ .../com/fanruan/api/data/TableDataKit.java | 9 +++++++++ .../api/data/impl/NameDatabaseConnection.java | 11 +++++++++++ .../ui/component/UITableEditorPane.java | 17 +++++++++++++++++ .../ui/container/AbstractTableDataPane.java | 10 ++++++++++ .../design/ui/container/UISQLEditPane.java | 11 +++++++++++ .../com/fanruan/api/util/TemplateKit.java | 19 +++++++++++++++++++ 7 files changed, 81 insertions(+) create mode 100644 src/main/java/com/fanruan/api/cal/Parameter.java create mode 100644 src/main/java/com/fanruan/api/data/impl/NameDatabaseConnection.java create mode 100644 src/main/java/com/fanruan/api/design/ui/component/UITableEditorPane.java create mode 100644 src/main/java/com/fanruan/api/design/ui/container/AbstractTableDataPane.java create mode 100644 src/main/java/com/fanruan/api/design/ui/container/UISQLEditPane.java create mode 100644 src/main/java/com/fanruan/api/util/TemplateKit.java diff --git a/src/main/java/com/fanruan/api/cal/Parameter.java b/src/main/java/com/fanruan/api/cal/Parameter.java new file mode 100644 index 0000000..6375a76 --- /dev/null +++ b/src/main/java/com/fanruan/api/cal/Parameter.java @@ -0,0 +1,4 @@ +package com.fanruan.api.cal; + +public class Parameter extends com.fr.base.Parameter { +} diff --git a/src/main/java/com/fanruan/api/data/TableDataKit.java b/src/main/java/com/fanruan/api/data/TableDataKit.java index 333245f..90eacfb 100644 --- a/src/main/java/com/fanruan/api/data/TableDataKit.java +++ b/src/main/java/com/fanruan/api/data/TableDataKit.java @@ -3,6 +3,7 @@ package com.fanruan.api.data; import com.fr.base.TableData; import com.fr.data.TableDataSource; import com.fr.data.api.TableDataAssist; +import com.fr.design.data.datapane.preview.PreviewTablePane; import com.fr.file.TableDataConfig; import com.fr.script.Calculator; import com.fr.stable.script.CalculatorProvider; @@ -74,4 +75,12 @@ public class TableDataKit { public static void renameTableData(@NotNull String oldName, @NotNull String newName) { TableDataConfig.getInstance().renameTableData(oldName, newName); } + + /** + * 直接预览数据集,没有实际值和显示值 + * @param tableData 数据集 + */ + public static void previewTableData(TableData tableData) { + PreviewTablePane.previewTableData(tableData); + } } diff --git a/src/main/java/com/fanruan/api/data/impl/NameDatabaseConnection.java b/src/main/java/com/fanruan/api/data/impl/NameDatabaseConnection.java new file mode 100644 index 0000000..8751618 --- /dev/null +++ b/src/main/java/com/fanruan/api/data/impl/NameDatabaseConnection.java @@ -0,0 +1,11 @@ +package com.fanruan.api.data.impl; + +/** + * 列表数据连接组件 + */ +public class NameDatabaseConnection extends com.fr.data.impl.NameDatabaseConnection { + public NameDatabaseConnection() { super();} + public NameDatabaseConnection(String name) { + super(name); + } +} diff --git a/src/main/java/com/fanruan/api/design/ui/component/UITableEditorPane.java b/src/main/java/com/fanruan/api/design/ui/component/UITableEditorPane.java new file mode 100644 index 0000000..2c6d5c3 --- /dev/null +++ b/src/main/java/com/fanruan/api/design/ui/component/UITableEditorPane.java @@ -0,0 +1,17 @@ +package com.fanruan.api.design.ui.component; + +import com.fr.design.gui.itableeditorpane.UITableModelAdapter; + +/** + * 表格编辑面板 + * @param + */ +public class UITableEditorPane extends com.fr.design.gui.itableeditorpane.UITableEditorPane { + public UITableEditorPane(UITableModelAdapter model){ + super(model); + } + + public UITableEditorPane(UITableModelAdapter model, String string){ + super(model, string); + } +} diff --git a/src/main/java/com/fanruan/api/design/ui/container/AbstractTableDataPane.java b/src/main/java/com/fanruan/api/design/ui/container/AbstractTableDataPane.java new file mode 100644 index 0000000..0ff1eab --- /dev/null +++ b/src/main/java/com/fanruan/api/design/ui/container/AbstractTableDataPane.java @@ -0,0 +1,10 @@ +package com.fanruan.api.design.ui.container; + +import com.fr.base.TableData; + +/** + * 表格面板 + * @param + */ +public abstract class AbstractTableDataPane extends com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane { +} diff --git a/src/main/java/com/fanruan/api/design/ui/container/UISQLEditPane.java b/src/main/java/com/fanruan/api/design/ui/container/UISQLEditPane.java new file mode 100644 index 0000000..2113b93 --- /dev/null +++ b/src/main/java/com/fanruan/api/design/ui/container/UISQLEditPane.java @@ -0,0 +1,11 @@ +package com.fanruan.api.design.ui.container; + +/** + * SQL编辑面板 + */ +public class UISQLEditPane extends com.fr.design.data.datapane.sqlpane.SQLEditPane { + public UISQLEditPane(){ super();} + public UISQLEditPane(boolean bool) { + super(bool); + } +} diff --git a/src/main/java/com/fanruan/api/util/TemplateKit.java b/src/main/java/com/fanruan/api/util/TemplateKit.java new file mode 100644 index 0000000..1244c49 --- /dev/null +++ b/src/main/java/com/fanruan/api/util/TemplateKit.java @@ -0,0 +1,19 @@ +package com.fanruan.api.util; + +import com.fr.base.TemplateUtils; + +import java.util.Map; + +public class TemplateKit { + + /** + * 根据参数, 来计算文档字符串 + * @param tpl 文档来源 + * @param context 参数map + * @return 计算后结果 + * @throws Exception + */ + public static String renderParameter4Tpl(String tpl, Map context) throws Exception { + return TemplateUtils.renderParameter4Tpl(tpl, context); + } +} From 3f0d694707f040d545dc780197fda62c12f40bef Mon Sep 17 00:00:00 2001 From: "Mars.Ma" Date: Thu, 5 Sep 2019 14:28:18 +0800 Subject: [PATCH 2/7] =?UTF-8?q?KERNEL-1198=20=E6=B6=88=E9=99=A4=E4=B8=8D?= =?UTF-8?q?=E5=BF=85=E8=A6=81=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/data/impl/NameDatabaseConnection.java | 11 ----------- .../ui/component/UITableEditorPane.java | 17 ----------------- .../ui/container/AbstractTableDataPane.java | 10 ---------- .../design/ui/container/UISQLEditPane.java | 11 ----------- .../com/fanruan/api/util/TemplateKit.java | 19 ------------------- 5 files changed, 68 deletions(-) delete mode 100644 src/main/java/com/fanruan/api/data/impl/NameDatabaseConnection.java delete mode 100644 src/main/java/com/fanruan/api/design/ui/component/UITableEditorPane.java delete mode 100644 src/main/java/com/fanruan/api/design/ui/container/AbstractTableDataPane.java delete mode 100644 src/main/java/com/fanruan/api/design/ui/container/UISQLEditPane.java delete mode 100644 src/main/java/com/fanruan/api/util/TemplateKit.java diff --git a/src/main/java/com/fanruan/api/data/impl/NameDatabaseConnection.java b/src/main/java/com/fanruan/api/data/impl/NameDatabaseConnection.java deleted file mode 100644 index 8751618..0000000 --- a/src/main/java/com/fanruan/api/data/impl/NameDatabaseConnection.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.fanruan.api.data.impl; - -/** - * 列表数据连接组件 - */ -public class NameDatabaseConnection extends com.fr.data.impl.NameDatabaseConnection { - public NameDatabaseConnection() { super();} - public NameDatabaseConnection(String name) { - super(name); - } -} diff --git a/src/main/java/com/fanruan/api/design/ui/component/UITableEditorPane.java b/src/main/java/com/fanruan/api/design/ui/component/UITableEditorPane.java deleted file mode 100644 index 2c6d5c3..0000000 --- a/src/main/java/com/fanruan/api/design/ui/component/UITableEditorPane.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.fanruan.api.design.ui.component; - -import com.fr.design.gui.itableeditorpane.UITableModelAdapter; - -/** - * 表格编辑面板 - * @param - */ -public class UITableEditorPane extends com.fr.design.gui.itableeditorpane.UITableEditorPane { - public UITableEditorPane(UITableModelAdapter model){ - super(model); - } - - public UITableEditorPane(UITableModelAdapter model, String string){ - super(model, string); - } -} diff --git a/src/main/java/com/fanruan/api/design/ui/container/AbstractTableDataPane.java b/src/main/java/com/fanruan/api/design/ui/container/AbstractTableDataPane.java deleted file mode 100644 index 0ff1eab..0000000 --- a/src/main/java/com/fanruan/api/design/ui/container/AbstractTableDataPane.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.fanruan.api.design.ui.container; - -import com.fr.base.TableData; - -/** - * 表格面板 - * @param - */ -public abstract class AbstractTableDataPane extends com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane { -} diff --git a/src/main/java/com/fanruan/api/design/ui/container/UISQLEditPane.java b/src/main/java/com/fanruan/api/design/ui/container/UISQLEditPane.java deleted file mode 100644 index 2113b93..0000000 --- a/src/main/java/com/fanruan/api/design/ui/container/UISQLEditPane.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.fanruan.api.design.ui.container; - -/** - * SQL编辑面板 - */ -public class UISQLEditPane extends com.fr.design.data.datapane.sqlpane.SQLEditPane { - public UISQLEditPane(){ super();} - public UISQLEditPane(boolean bool) { - super(bool); - } -} diff --git a/src/main/java/com/fanruan/api/util/TemplateKit.java b/src/main/java/com/fanruan/api/util/TemplateKit.java deleted file mode 100644 index 1244c49..0000000 --- a/src/main/java/com/fanruan/api/util/TemplateKit.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.fanruan.api.util; - -import com.fr.base.TemplateUtils; - -import java.util.Map; - -public class TemplateKit { - - /** - * 根据参数, 来计算文档字符串 - * @param tpl 文档来源 - * @param context 参数map - * @return 计算后结果 - * @throws Exception - */ - public static String renderParameter4Tpl(String tpl, Map context) throws Exception { - return TemplateUtils.renderParameter4Tpl(tpl, context); - } -} From 852b32943a8258830ff167d0758ef3b3f8f0b7eb Mon Sep 17 00:00:00 2001 From: "Mars.Ma" Date: Fri, 6 Sep 2019 11:38:04 +0800 Subject: [PATCH 3/7] =?UTF-8?q?KERNEL-1198=20JSON=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E7=AC=AC=E4=BA=8C=E6=AC=A1=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fanruan/api/cal/Parameter.java | 4 ---- .../com/fanruan/api/cal/ParameterKit.java | 8 +++++++ .../fanruan/api/conf/ConfigurationKit.java | 10 +++++++++ .../fanruan/api/data/AbstractDataModel.java | 4 ++++ .../api/data/AbstractDatabaseConnection.java | 4 ++++ .../api/data/AbstractParameterTableData.java | 4 ++++ .../com/fanruan/api/net/http/EntityKit.java | 21 +++++++++++++++++++ .../net/http/message/BasicNameValuePair.java | 9 ++++++++ .../java/com/fanruan/api/util/CodeKit.java | 10 +++++++++ .../com/fanruan/api/util/ComparatorKit.java | 15 +++++++++++++ src/main/java/com/fanruan/api/xml/XmlKit.java | 16 +++++++++----- 11 files changed, 96 insertions(+), 9 deletions(-) delete mode 100644 src/main/java/com/fanruan/api/cal/Parameter.java create mode 100644 src/main/java/com/fanruan/api/data/AbstractDataModel.java create mode 100644 src/main/java/com/fanruan/api/data/AbstractDatabaseConnection.java create mode 100644 src/main/java/com/fanruan/api/data/AbstractParameterTableData.java create mode 100644 src/main/java/com/fanruan/api/net/http/EntityKit.java create mode 100644 src/main/java/com/fanruan/api/net/http/message/BasicNameValuePair.java create mode 100644 src/main/java/com/fanruan/api/util/ComparatorKit.java diff --git a/src/main/java/com/fanruan/api/cal/Parameter.java b/src/main/java/com/fanruan/api/cal/Parameter.java deleted file mode 100644 index 6375a76..0000000 --- a/src/main/java/com/fanruan/api/cal/Parameter.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.fanruan.api.cal; - -public class Parameter extends com.fr.base.Parameter { -} diff --git a/src/main/java/com/fanruan/api/cal/ParameterKit.java b/src/main/java/com/fanruan/api/cal/ParameterKit.java index 471d9fe..c1e1b68 100644 --- a/src/main/java/com/fanruan/api/cal/ParameterKit.java +++ b/src/main/java/com/fanruan/api/cal/ParameterKit.java @@ -136,4 +136,12 @@ public class ParameterKit { return parameters; } + /** + * 将ParameterProvider转化为Parameter + * @param providers 需要转换的ParameterProvider + * @return 转换后的Parameter + */ + public static Parameter[] providers2Parameter(ParameterProvider[] providers) { + return Parameter.providers2Parameter(providers); + } } diff --git a/src/main/java/com/fanruan/api/conf/ConfigurationKit.java b/src/main/java/com/fanruan/api/conf/ConfigurationKit.java index b433465..43625ed 100644 --- a/src/main/java/com/fanruan/api/conf/ConfigurationKit.java +++ b/src/main/java/com/fanruan/api/conf/ConfigurationKit.java @@ -1,5 +1,6 @@ package com.fanruan.api.conf; +import com.fr.config.ConfigContext; import com.fr.config.Configuration; import com.fr.config.holder.ConfigChangeListener; import com.fr.transaction.Configurations; @@ -38,4 +39,13 @@ public class ConfigurationKit { }); } + /** + * 返回config实例,且config实例只存在一个 + * @param configuration Configuration类 + * @param + * @return config实例 + */ + public static T getConfigInstance(final Class configuration) { + return ConfigContext.getConfigInstance(configuration); + } } diff --git a/src/main/java/com/fanruan/api/data/AbstractDataModel.java b/src/main/java/com/fanruan/api/data/AbstractDataModel.java new file mode 100644 index 0000000..7ee273f --- /dev/null +++ b/src/main/java/com/fanruan/api/data/AbstractDataModel.java @@ -0,0 +1,4 @@ +package com.fanruan.api.data; + +public abstract class AbstractDataModel extends com.fr.data.AbstractDataModel { +} diff --git a/src/main/java/com/fanruan/api/data/AbstractDatabaseConnection.java b/src/main/java/com/fanruan/api/data/AbstractDatabaseConnection.java new file mode 100644 index 0000000..925da74 --- /dev/null +++ b/src/main/java/com/fanruan/api/data/AbstractDatabaseConnection.java @@ -0,0 +1,4 @@ +package com.fanruan.api.data; + +public abstract class AbstractDatabaseConnection extends com.fr.data.impl.AbstractDatabaseConnection { +} diff --git a/src/main/java/com/fanruan/api/data/AbstractParameterTableData.java b/src/main/java/com/fanruan/api/data/AbstractParameterTableData.java new file mode 100644 index 0000000..23c1f05 --- /dev/null +++ b/src/main/java/com/fanruan/api/data/AbstractParameterTableData.java @@ -0,0 +1,4 @@ +package com.fanruan.api.data; + +public abstract class AbstractParameterTableData extends com.fr.data.AbstractParameterTableData { +} diff --git a/src/main/java/com/fanruan/api/net/http/EntityKit.java b/src/main/java/com/fanruan/api/net/http/EntityKit.java new file mode 100644 index 0000000..d1d7b3f --- /dev/null +++ b/src/main/java/com/fanruan/api/net/http/EntityKit.java @@ -0,0 +1,21 @@ +package com.fanruan.api.net.http; + +import com.fr.third.org.apache.http.HttpEntity; +import com.fr.third.org.apache.http.ParseException; +import com.fr.third.org.apache.http.util.EntityUtils; + +import java.io.IOException; + +public class EntityKit { + /** + * 利用defaultCharset字符集将HttpEntity对象转化为String对象 + * @param entity 需要转化为String的HttpEntity对象 + * @param defaultCharset 传入的字符集 + * @return HttpEntity对象转化为的String对象 + * @throws IOException + * @throws ParseException + */ + public static String toString(HttpEntity entity, String defaultCharset) throws IOException, ParseException { + return EntityUtils.toString(entity, defaultCharset); + } +} diff --git a/src/main/java/com/fanruan/api/net/http/message/BasicNameValuePair.java b/src/main/java/com/fanruan/api/net/http/message/BasicNameValuePair.java new file mode 100644 index 0000000..82ffb80 --- /dev/null +++ b/src/main/java/com/fanruan/api/net/http/message/BasicNameValuePair.java @@ -0,0 +1,9 @@ +package com.fanruan.api.net.http.message; +/** + * 键值对类 + */ +public class BasicNameValuePair extends com.fr.third.org.apache.http.message.BasicNameValuePair { + public BasicNameValuePair(String name, String value) { + super(name, value); + } +} diff --git a/src/main/java/com/fanruan/api/util/CodeKit.java b/src/main/java/com/fanruan/api/util/CodeKit.java index b819eb4..5c89421 100644 --- a/src/main/java/com/fanruan/api/util/CodeKit.java +++ b/src/main/java/com/fanruan/api/util/CodeKit.java @@ -12,4 +12,14 @@ public class CodeKit { public static String passwordDecode(String passwordText) { return CodeUtils.passwordDecode(passwordText); } + + /** + * 将经过处理的中日韩文字符串解码成原先的中日韩文 + * @param text 经过处理的中日韩文字 + * @return 中日韩文字 + * @throws Exception + */ + public static String cjkDecode(String text) throws Exception { + return CodeUtils.cjkDecode(text); + } } diff --git a/src/main/java/com/fanruan/api/util/ComparatorKit.java b/src/main/java/com/fanruan/api/util/ComparatorKit.java new file mode 100644 index 0000000..39fddff --- /dev/null +++ b/src/main/java/com/fanruan/api/util/ComparatorKit.java @@ -0,0 +1,15 @@ +package com.fanruan.api.util; + +import com.fr.general.ComparatorUtils; + +public class ComparatorKit { + /** + * 比较两个Object对象是否相等 + * @param object1 第一个Object对象 + * @param object2 第二个Object对象 + * @return 相等返回True 不相等返回False + */ + public static boolean equals(Object object1, Object object2){ + return ComparatorUtils.equals(object1, object2); + } +} diff --git a/src/main/java/com/fanruan/api/xml/XmlKit.java b/src/main/java/com/fanruan/api/xml/XmlKit.java index 89de42a..bcc1ae0 100644 --- a/src/main/java/com/fanruan/api/xml/XmlKit.java +++ b/src/main/java/com/fanruan/api/xml/XmlKit.java @@ -3,11 +3,8 @@ package com.fanruan.api.xml; import com.fr.data.core.DataCoreXmlUtils; import com.fr.data.impl.Connection; import com.fr.general.xml.GeneralXMLTools; -import com.fr.stable.xml.XMLPrintWriter; -import com.fr.stable.xml.XMLReadable; -import com.fr.stable.xml.XMLTools; -import com.fr.stable.xml.XMLable; -import com.fr.stable.xml.XMLableReader; +import com.fr.stable.ParameterProvider; +import com.fr.stable.xml.*; import java.io.InputStream; @@ -76,4 +73,13 @@ public class XmlKit { DataCoreXmlUtils.writeXMLConnection(writer, connection); } + /** + *读出xml参数 + * @param reader xml读出对象 + * @return 返回保存参数数组 + */ + public static ParameterProvider readParameter(XMLableReader reader) { + return StableXMLUtils.readParameter(reader); + } + } From 056141604d2ff53eff0dc26e4509c582c8476a00 Mon Sep 17 00:00:00 2001 From: "Mars.Ma" Date: Fri, 6 Sep 2019 11:55:52 +0800 Subject: [PATCH 4/7] =?UTF-8?q?KERNEL-1198=20=E6=8C=89=E8=A6=81=E6=B1=82?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fanruan/api/cal/ParameterKit.java | 9 ---- .../fanruan/api/conf/ConfigurationKit.java | 51 ------------------- 2 files changed, 60 deletions(-) delete mode 100644 src/main/java/com/fanruan/api/conf/ConfigurationKit.java diff --git a/src/main/java/com/fanruan/api/cal/ParameterKit.java b/src/main/java/com/fanruan/api/cal/ParameterKit.java index c1e1b68..388726f 100644 --- a/src/main/java/com/fanruan/api/cal/ParameterKit.java +++ b/src/main/java/com/fanruan/api/cal/ParameterKit.java @@ -135,13 +135,4 @@ public class ParameterKit { return parameters; } - - /** - * 将ParameterProvider转化为Parameter - * @param providers 需要转换的ParameterProvider - * @return 转换后的Parameter - */ - public static Parameter[] providers2Parameter(ParameterProvider[] providers) { - return Parameter.providers2Parameter(providers); - } } diff --git a/src/main/java/com/fanruan/api/conf/ConfigurationKit.java b/src/main/java/com/fanruan/api/conf/ConfigurationKit.java deleted file mode 100644 index 43625ed..0000000 --- a/src/main/java/com/fanruan/api/conf/ConfigurationKit.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.fanruan.api.conf; - -import com.fr.config.ConfigContext; -import com.fr.config.Configuration; -import com.fr.config.holder.ConfigChangeListener; -import com.fr.transaction.Configurations; -import com.fr.transaction.ValidateProxy; -import com.fr.transaction.WorkerFacade; - -/** - * @author richie - * @version 10.0 - * Created by richie on 2019-08-30 - * 配置监听管理器 - */ -public class ConfigurationKit { - - /** - * 注册监听配置变化的监听器 - * - * @param listener 监听器 - */ - public static void registerListener(ConfigChangeListener listener) { - ValidateProxy.getInstance().getValidateManager().registerListener(listener); - } - - /** - * 保存配置 - * - * @param type 配置的类型 - * @param action 保存动作 - */ - public static void modify(Class type, Runner action) { - Configurations.modify(new WorkerFacade(type) { - @Override - public void run() { - action.run(); - } - }); - } - - /** - * 返回config实例,且config实例只存在一个 - * @param configuration Configuration类 - * @param - * @return config实例 - */ - public static T getConfigInstance(final Class configuration) { - return ConfigContext.getConfigInstance(configuration); - } -} From 3bc58139f8f40d92adbcd73348420df1b27fc977 Mon Sep 17 00:00:00 2001 From: "Mars.Ma" Date: Sat, 7 Sep 2019 08:36:18 +0800 Subject: [PATCH 5/7] =?UTF-8?q?KERNEL-1198=20=E5=8E=BB=E9=99=A4=E4=B8=8D?= =?UTF-8?q?=E5=BF=85=E8=A6=81=E4=BF=AE=E6=94=B9=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fanruan/api/data/AbstractDataModel.java | 4 ---- .../api/data/AbstractDatabaseConnection.java | 4 ---- .../api/data/AbstractParameterTableData.java | 4 ---- .../com/fanruan/api/data/TableDataKit.java | 7 ------- .../com/fanruan/api/net/http/EntityKit.java | 21 ------------------- .../net/http/message/BasicNameValuePair.java | 9 -------- .../com/fanruan/api/util/ComparatorKit.java | 15 ------------- src/main/java/com/fanruan/api/xml/XmlKit.java | 7 ++++++- 8 files changed, 6 insertions(+), 65 deletions(-) delete mode 100644 src/main/java/com/fanruan/api/data/AbstractDataModel.java delete mode 100644 src/main/java/com/fanruan/api/data/AbstractDatabaseConnection.java delete mode 100644 src/main/java/com/fanruan/api/data/AbstractParameterTableData.java delete mode 100644 src/main/java/com/fanruan/api/net/http/EntityKit.java delete mode 100644 src/main/java/com/fanruan/api/net/http/message/BasicNameValuePair.java delete mode 100644 src/main/java/com/fanruan/api/util/ComparatorKit.java diff --git a/src/main/java/com/fanruan/api/data/AbstractDataModel.java b/src/main/java/com/fanruan/api/data/AbstractDataModel.java deleted file mode 100644 index 7ee273f..0000000 --- a/src/main/java/com/fanruan/api/data/AbstractDataModel.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.fanruan.api.data; - -public abstract class AbstractDataModel extends com.fr.data.AbstractDataModel { -} diff --git a/src/main/java/com/fanruan/api/data/AbstractDatabaseConnection.java b/src/main/java/com/fanruan/api/data/AbstractDatabaseConnection.java deleted file mode 100644 index 925da74..0000000 --- a/src/main/java/com/fanruan/api/data/AbstractDatabaseConnection.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.fanruan.api.data; - -public abstract class AbstractDatabaseConnection extends com.fr.data.impl.AbstractDatabaseConnection { -} diff --git a/src/main/java/com/fanruan/api/data/AbstractParameterTableData.java b/src/main/java/com/fanruan/api/data/AbstractParameterTableData.java deleted file mode 100644 index 23c1f05..0000000 --- a/src/main/java/com/fanruan/api/data/AbstractParameterTableData.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.fanruan.api.data; - -public abstract class AbstractParameterTableData extends com.fr.data.AbstractParameterTableData { -} diff --git a/src/main/java/com/fanruan/api/data/TableDataKit.java b/src/main/java/com/fanruan/api/data/TableDataKit.java index 90eacfb..955bc32 100644 --- a/src/main/java/com/fanruan/api/data/TableDataKit.java +++ b/src/main/java/com/fanruan/api/data/TableDataKit.java @@ -76,11 +76,4 @@ public class TableDataKit { TableDataConfig.getInstance().renameTableData(oldName, newName); } - /** - * 直接预览数据集,没有实际值和显示值 - * @param tableData 数据集 - */ - public static void previewTableData(TableData tableData) { - PreviewTablePane.previewTableData(tableData); - } } diff --git a/src/main/java/com/fanruan/api/net/http/EntityKit.java b/src/main/java/com/fanruan/api/net/http/EntityKit.java deleted file mode 100644 index d1d7b3f..0000000 --- a/src/main/java/com/fanruan/api/net/http/EntityKit.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.fanruan.api.net.http; - -import com.fr.third.org.apache.http.HttpEntity; -import com.fr.third.org.apache.http.ParseException; -import com.fr.third.org.apache.http.util.EntityUtils; - -import java.io.IOException; - -public class EntityKit { - /** - * 利用defaultCharset字符集将HttpEntity对象转化为String对象 - * @param entity 需要转化为String的HttpEntity对象 - * @param defaultCharset 传入的字符集 - * @return HttpEntity对象转化为的String对象 - * @throws IOException - * @throws ParseException - */ - public static String toString(HttpEntity entity, String defaultCharset) throws IOException, ParseException { - return EntityUtils.toString(entity, defaultCharset); - } -} diff --git a/src/main/java/com/fanruan/api/net/http/message/BasicNameValuePair.java b/src/main/java/com/fanruan/api/net/http/message/BasicNameValuePair.java deleted file mode 100644 index 82ffb80..0000000 --- a/src/main/java/com/fanruan/api/net/http/message/BasicNameValuePair.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.fanruan.api.net.http.message; -/** - * 键值对类 - */ -public class BasicNameValuePair extends com.fr.third.org.apache.http.message.BasicNameValuePair { - public BasicNameValuePair(String name, String value) { - super(name, value); - } -} diff --git a/src/main/java/com/fanruan/api/util/ComparatorKit.java b/src/main/java/com/fanruan/api/util/ComparatorKit.java deleted file mode 100644 index 39fddff..0000000 --- a/src/main/java/com/fanruan/api/util/ComparatorKit.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.fanruan.api.util; - -import com.fr.general.ComparatorUtils; - -public class ComparatorKit { - /** - * 比较两个Object对象是否相等 - * @param object1 第一个Object对象 - * @param object2 第二个Object对象 - * @return 相等返回True 不相等返回False - */ - public static boolean equals(Object object1, Object object2){ - return ComparatorUtils.equals(object1, object2); - } -} diff --git a/src/main/java/com/fanruan/api/xml/XmlKit.java b/src/main/java/com/fanruan/api/xml/XmlKit.java index bcc1ae0..dc2cfc1 100644 --- a/src/main/java/com/fanruan/api/xml/XmlKit.java +++ b/src/main/java/com/fanruan/api/xml/XmlKit.java @@ -4,7 +4,12 @@ import com.fr.data.core.DataCoreXmlUtils; import com.fr.data.impl.Connection; import com.fr.general.xml.GeneralXMLTools; import com.fr.stable.ParameterProvider; -import com.fr.stable.xml.*; +import com.fr.stable.xml.XMLReadable; +import com.fr.stable.xml.XMLTools; +import com.fr.stable.xml.XMLable; +import com.fr.stable.xml.XMLableReader; +import com.fr.stable.xml.XMLPrintWriter; +import com.fr.stable.xml.StableXMLUtils; import java.io.InputStream; From c4076bda6c48e61712cf8f31e072f92b9d3164fb Mon Sep 17 00:00:00 2001 From: "Mars.Ma" Date: Sat, 7 Sep 2019 13:05:55 +0800 Subject: [PATCH 6/7] =?UTF-8?q?KERNEL-1198=20=E6=8C=89=E8=A6=81=E6=B1=82?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/fanruan/api/data/TableDataKit.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/com/fanruan/api/data/TableDataKit.java b/src/main/java/com/fanruan/api/data/TableDataKit.java index 955bc32..63a7d91 100644 --- a/src/main/java/com/fanruan/api/data/TableDataKit.java +++ b/src/main/java/com/fanruan/api/data/TableDataKit.java @@ -3,7 +3,6 @@ package com.fanruan.api.data; import com.fr.base.TableData; import com.fr.data.TableDataSource; import com.fr.data.api.TableDataAssist; -import com.fr.design.data.datapane.preview.PreviewTablePane; import com.fr.file.TableDataConfig; import com.fr.script.Calculator; import com.fr.stable.script.CalculatorProvider; From fc36f997c76474ba8ae2d6ba81cce4d50f24b81f Mon Sep 17 00:00:00 2001 From: "Mars.Ma" Date: Mon, 9 Sep 2019 14:22:03 +0800 Subject: [PATCH 7/7] =?UTF-8?q?KERNEL-1198=20=E6=96=B0=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E7=9A=84=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fanruan/api/util/CodeKitTest.java | 14 +++++++ .../java/com/fanruan/api/xml/XmlKitTest.java | 38 +++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 src/test/java/com/fanruan/api/xml/XmlKitTest.java diff --git a/src/test/java/com/fanruan/api/util/CodeKitTest.java b/src/test/java/com/fanruan/api/util/CodeKitTest.java index 10853e6..5224324 100644 --- a/src/test/java/com/fanruan/api/util/CodeKitTest.java +++ b/src/test/java/com/fanruan/api/util/CodeKitTest.java @@ -1,5 +1,6 @@ package com.fanruan.api.util; +import com.fr.stable.CodeUtils; import com.fr.stable.CommonCodeUtils; import org.junit.Assert; import org.junit.Test; @@ -9,4 +10,17 @@ public class CodeKitTest { public void passwordDecode(String passwordText) { Assert.assertEquals(CodeKit.passwordDecode(passwordText), 123); } + + @Test + public void cjkDecode() { + String s = "中文 한글 日本語"; + String encode = CodeUtils.cjkEncode(s); + + try { + String decode = CodeKit.cjkDecode(encode); + Assert.assertTrue(s.equals(decode)); + } catch (Exception e) { + + } + } } diff --git a/src/test/java/com/fanruan/api/xml/XmlKitTest.java b/src/test/java/com/fanruan/api/xml/XmlKitTest.java new file mode 100644 index 0000000..2c33d4d --- /dev/null +++ b/src/test/java/com/fanruan/api/xml/XmlKitTest.java @@ -0,0 +1,38 @@ +package com.fanruan.api.xml; + +import com.fr.base.Parameter; +import com.fr.base.TableData; +import com.fr.plugin.db.json.core.JSONTableData; +import com.fr.stable.ParameterProvider; +import com.fr.stable.bridge.StableFactory; +import com.fr.stable.xml.StableXMLUtils; +import com.fr.stable.xml.XMLPrintWriter; +import com.fr.stable.xml.XMLUtils; +import com.fr.stable.xml.XMLableReader; +import com.fr.third.javax.xml.stream.XMLStreamException; +import org.junit.Assert; +import org.junit.Test; + +import static org.junit.Assert.*; + +public class XmlKitTest { + + @Test + public void readParameter() { + try { + XMLableReader xml = XMLableReader.createXMLableReader("\n" + + "\n" + + "Tove\n" + + "Jani\n" + + "Reminder\n" + + "Don't forget me this weekend!\n" + + ""); + Parameter parameter = new Parameter("test", 1); + StableFactory.registerXMLDescription("Parameter",parameter); + Parameter p = (Parameter)XmlKit.readParameter(xml); + Assert.assertTrue(p.getName().equals("test")); + } catch (XMLStreamException e) { + e.printStackTrace(); + } + } +} \ No newline at end of file