Browse Source

update: 根据pr意见进行处理。

pull/1/head
zjz1993 5 years ago
parent
commit
560e1d63c8
  1. 19
      src/main/java/com/fanruan/api/design/ui/container/NameObjectCreator.java
  2. 13
      src/main/java/com/fanruan/api/session/SessionKit.java
  3. 9
      src/main/java/com/fanruan/api/util/ArrayKit.java
  4. 10
      src/main/java/com/fanruan/api/util/RenderKit.java
  5. 17
      src/main/java/com/fanruan/api/web/WebKit.java

19
src/main/java/com/fanruan/api/design/ui/container/NameObjectCreator.java

@ -1,19 +0,0 @@
package com.fanruan.api.design.ui.container;
import com.fr.design.beans.BasicBeanPane;
/**
* 创建一个名称空间对象
* */
public class NameObjectCreator extends com.fr.design.gui.controlpane.NameObjectCreator{
public NameObjectCreator(String menuName, Class clazz, Class<? extends BasicBeanPane> updatePane) {
super(menuName, clazz, updatePane);
}
public NameObjectCreator(String menuName, String iconPath, Class clazz) {
super(menuName, iconPath, clazz);
}
public NameObjectCreator(String menuName, String iconPath, Class clazz, Class<? extends BasicBeanPane> updatePane) {
super(menuName, iconPath, clazz, updatePane);
}
}

13
src/main/java/com/fanruan/api/session/SessionKit.java

@ -5,9 +5,13 @@ import com.fr.stable.web.SessionProvider;
import com.fr.web.core.ReportSessionIDInfor;
import com.fr.web.core.SessionPoolManager;
import com.fr.web.session.SessionIDInfo;
import com.fr.web.utils.WebUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;
/**
* @author richie
* @version 10.0
@ -32,4 +36,13 @@ public class SessionKit {
public static NameSpace asNameSpace(String sessionId) {
return SessionIDInfo.asNameSpace(sessionId);
}
/**
* 将HTTPServletRequest中的所有参数都读取出来,存储在一个Map中,返回出去
* @param req 请求
* @return 参数的map
* */
public static Map<String, Object> parameters4SessionIDInfor(HttpServletRequest req){
return WebUtils.parameters4SessionIDInfor(req);
}
}

9
src/main/java/com/fanruan/api/util/ArrayKit.java

@ -58,6 +58,15 @@ public class ArrayKit {
public static <T> boolean isEmpty(T[] array) {
return ArrayUtils.isEmpty(array);
}
/**
* 判断数组是否为空
*
* @param array 源数组
* @return 返回数组判断为空的结果
*/
public static boolean isEmpty(boolean[] array) {
return ArrayUtils.isEmpty(array);
}
/**
* 移除目标数组中对应下标的元素
*

10
src/main/java/com/fanruan/api/util/RenderKit.java

@ -33,14 +33,4 @@ public class RenderKit {
public static String render(String s, Calculator c) throws Exception {
return TemplateUtils.render(s, c);
}
/**
* 根据参数, 来计算文档字符串
* @param string 待渲染的文本模板
* @return 返回渲染后的文本
* @throws Exception 渲染过程中出现错误则抛出此异常
*/
public static String render(String string) throws Exception {
return TemplateUtils.render(string);
}
}

17
src/main/java/com/fanruan/api/web/WebKit.java

@ -1,17 +0,0 @@
package com.fanruan.api.web;
import com.fr.web.utils.WebUtils;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;
public class WebKit {
/**
* 将HTTPServletRequest中的所有参数都读取出来,存储在一个Map中,返回出去
* @param req 请求
* @return 参数的map
* */
public static Map<String, Object> parameters4SessionIDInfor(HttpServletRequest req){
return WebUtils.parameters4SessionIDInfor(req);
}
}
Loading…
Cancel
Save