Browse Source

update: 新增一个异常及pluginKit

master
zjz1993 5 years ago
parent
commit
b9b9c7042a
  1. 14
      src/main/java/com/fanruan/api/err/TableDataException.java
  2. 26
      src/main/java/com/fanruan/api/plugin/PluginKit.java
  3. 13
      src/test/java/com/fanruan/api/plugin/PluginKitTest.java
  4. 12
      src/test/java/com/fanruan/api/plugin/TestExtraClass.java
  5. 1
      src/test/java/com/fanruan/api/util/ArrayKitTest.java

14
src/main/java/com/fanruan/api/err/TableDataException.java

@ -0,0 +1,14 @@
package com.fanruan.api.err;
/**
* 和数据集工具有关的异常
* */
public class TableDataException extends com.fr.general.data.TableDataException{
public TableDataException(String msg){
super(msg);
}
public TableDataException (String msg, Throwable error){
super(msg, error);
}
}

26
src/main/java/com/fanruan/api/plugin/PluginKit.java

@ -0,0 +1,26 @@
package com.fanruan.api.plugin;
import com.fr.plugin.ExtraClassManager;
import com.fr.stable.fun.mark.Mutable;
import java.util.Set;
public class PluginKit {
/**
* 返回指定集合的不可变数组
* @param string 字符串
* @return 数组
* */
public <T extends Mutable> Set<T> getArray(String string) {
return ExtraClassManager.getInstance().getArray(string);
}
/**
* 返回指定集合的不可变数组
* @param string 字符串
* @return 数组
* */
public <T extends Mutable> Set<T> getArray(String string, Mutable m) {
return ExtraClassManager.getInstance().getArray(string, m);
}
}

13
src/test/java/com/fanruan/api/plugin/PluginKitTest.java

@ -0,0 +1,13 @@
package com.fanruan.api.plugin;
import org.junit.Assert;
import org.junit.Test;
public class PluginKitTest {
@Test
public void getArray(){
PluginKit p1 = new PluginKit();
TestExtraClass p2 = new TestExtraClass();
Assert.assertEquals(p1.getArray("abcd"), p2.getArray("abcd"));
}
}

12
src/test/java/com/fanruan/api/plugin/TestExtraClass.java

@ -0,0 +1,12 @@
package com.fanruan.api.plugin;
import com.fr.plugin.injectable.PluginSingleInjection;
public class TestExtraClass extends com.fr.plugin.AbstractExtraClassManager{
protected boolean mountSpecific(PluginSingleInjection injection){
return true;
}
protected boolean demountSpecific(PluginSingleInjection injection){
return true;
}
}

1
src/test/java/com/fanruan/api/util/ArrayKitTest.java

@ -3,7 +3,6 @@ package com.fanruan.api.util;
import com.fanruan.api.Prepare;
import java.util.*;
import com.fr.third.org.apache.poi.hssf.record.formula.functions.Int;
import org.junit.Assert;
import org.junit.Test;

Loading…
Cancel
Save