Browse Source

Merge branch 'master' of Palin/finekit into master

pull/1/head
richie 5 years ago committed by Gogs
parent
commit
7ba15bc19e
  1. 10
      src/main/java/com/fanruan/api/util/CodeKit.java
  2. 11
      src/main/java/com/fanruan/api/xml/XmlKit.java
  3. 13
      src/test/java/com/fanruan/api/util/CodeKitTest.java

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

@ -22,4 +22,14 @@ public class CodeKit {
public static String cjkDecode(String text) throws Exception {
return CodeUtils.cjkDecode(text);
}
/**
* 将经过处理字符串解码成原先字符串
* @param text 经过处理的字符串
* @return 字符串
* @throws Exception
*/
public static String encodeURIComponent(String text) {
return CommonCodeUtils.encodeURIComponent(text);
}
}

11
src/main/java/com/fanruan/api/xml/XmlKit.java

@ -61,6 +61,7 @@ public class XmlKit {
/**
* 从xml中读取数据连接对象
*
* @param reader xml读取器
* @return 数据连接对象
*/
@ -79,7 +80,8 @@ public class XmlKit {
}
/**
*读出xml参数
* 读出xml参数
*
* @param reader xml读出对象
* @return 返回保存参数数组
*/
@ -87,4 +89,11 @@ public class XmlKit {
return StableXMLUtils.readParameter(reader);
}
/**
* 读出xml参数
* @param writer xml读出对象
*/
public static void writeParameters(XMLPrintWriter writer, ParameterProvider[] parameter) {
StableXMLUtils.writeParameters(writer,parameter);
}
}

13
src/test/java/com/fanruan/api/util/CodeKitTest.java

@ -23,4 +23,17 @@ public class CodeKitTest {
}
}
@Test
public void encodeURIComponent() {
String s = "123";
String encode = CodeUtils.encodeURIComponent(s);
try {
String decode = CodeKit.encodeURIComponent(encode);
Assert.assertTrue(s.equals(decode));
} catch (Exception e) {
}
}
}

Loading…
Cancel
Save