Skip to content

Commit 9d309d8

Browse files
committed
处理一些小问题
1 parent 7e7712c commit 9d309d8

10 files changed

Lines changed: 25 additions & 20 deletions

File tree

src/main/java/seven/wapperInt/Wrapper.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import org.apache.poi.ss.usermodel.Cell;
66
import seven.wapperInt.callBack.DataFilterColumnInterface;
77
import seven.wapperInt.callBack.DataFilterInterface;
8-
import seven.wapperInt.callBack.DataProcessInterface;
8+
import seven.wapperInt.callBack.DataFilterProcessInterface;
99

1010
import java.io.Serializable;
1111
import java.text.DecimalFormat;
@@ -226,10 +226,10 @@ public void setEnd_sheet(Integer end_sheet) {
226226
/**
227227
*此处传入每一行打包好的数据。对应一个实体\n
228228
* 在process方法里可对属性进行处理加工
229-
* @param process {@link DataProcessInterface}
229+
* @param process {@link DataFilterProcessInterface}
230230
* @return
231231
*/
232-
public abstract Wrapper Process(DataProcessInterface<?> process);
232+
public abstract Wrapper Process(DataFilterProcessInterface<?> process);
233233

234234
/**
235235
* 对结果的List进行排序

src/main/java/seven/wapperInt/callBack/DataFilterColumnInterface.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ public interface DataFilterColumnInterface {
1313
* 如果加入后,将不对实体进行赋值
1414
* @return
1515
*/
16-
public String[] Filter();
16+
public String[] filter();
1717
}

src/main/java/seven/wapperInt/callBack/DataProcessInterface.java renamed to src/main/java/seven/wapperInt/callBack/DataFilterProcessInterface.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* 此处传入每一行打包好的数据。对应一个实体
1010
* T为实体Bean类型
1111
*/
12-
public interface DataProcessInterface<T>{
12+
public interface DataFilterProcessInterface<T>{
1313
/***
1414
* 此处传入每一行打包好的数据。对应一个实体,
1515
* 在process方法里可对属性进行处理加工

src/main/java/seven/wapperInt/callBack/imp/DefaultDataFiter.java renamed to src/main/java/seven/wapperInt/callBack/imp/DefaultDataFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* [Bolg]https://matrixseven.github.io/
88
* Created by seven on 2016/10/18.
99
*/
10-
public class DefaultDataFiter<T> implements DataFilterInterface<T>{
10+
public class DefaultDataFilter<T> implements DataFilterInterface<T>{
1111
@Override
1212
public Boolean filter(T o) {
1313
return true;

src/main/java/seven/wapperInt/callBack/imp/DefaultProcess.java renamed to src/main/java/seven/wapperInt/callBack/imp/DefaultDataProFilter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
package seven.wapperInt.callBack.imp;
22

3-
import seven.wapperInt.callBack.DataProcessInterface;
3+
import seven.wapperInt.callBack.DataFilterProcessInterface;
44

55
/**
66
* [Github]https://github.com/MatrixSeven
77
* [Bolg]https://matrixseven.github.io/
88
* Created by seven on 2016/10/18.
99
*/
1010
@SuppressWarnings("unchecked")
11-
public class DefaultProcess<T> implements DataProcessInterface<T>{
11+
public class DefaultDataProFilter<T> implements DataFilterProcessInterface<T> {
1212
@Override
1313
public void process(T o) {
1414

src/main/java/seven/wapperInt/callBack/imp/DefaultDateColFiter.java renamed to src/main/java/seven/wapperInt/callBack/imp/DefaultDateColFilter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
* [Bolg]https://matrixseven.github.io/
88
* Created by seven on 2016/10/19.
99
*/
10-
public class DefaultDateColFiter implements DataFilterColumnInterface {
10+
public class DefaultDateColFilter implements DataFilterColumnInterface {
1111

1212
@Override
13-
public String[] Filter() {
13+
public String[] filter() {
1414
return new String[0];
1515
}
1616
}

src/main/java/seven/wapperInt/wapperRef/WrapperObj.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
import seven.wapperInt.Wrapper;
2626
import seven.wapperInt.callBack.DataFilterInterface;
2727
import seven.wapperInt.callBack.DataFilterColumnInterface;
28-
import seven.wapperInt.callBack.DataProcessInterface;
29-
import seven.wapperInt.callBack.imp.DefaultDataFiter;
30-
import seven.wapperInt.callBack.imp.DefaultProcess;
28+
import seven.wapperInt.callBack.DataFilterProcessInterface;
29+
import seven.wapperInt.callBack.imp.DefaultDataFilter;
30+
import seven.wapperInt.callBack.imp.DefaultDataProFilter;
3131

3232
import java.io.File;
3333
import java.util.*;
@@ -37,8 +37,8 @@
3737
* @date 2016年4月12日-下午4:07:57
3838
*/
3939
public abstract class WrapperObj<T> extends Wrapper {
40-
protected DataFilterInterface filter=new DefaultDataFiter<Object>();
41-
protected DataProcessInterface process=new DefaultProcess<Object>();
40+
protected DataFilterInterface filter=new DefaultDataFilter<Object>();
41+
protected DataFilterProcessInterface process=new DefaultDataProFilter<Object>();
4242
protected List<String> filterColBy_key=new ArrayList<>();
4343
protected List<String> filterColBy_value=new ArrayList<>();
4444
protected Comparator<? super Object> c;
@@ -58,7 +58,7 @@ protected boolean isNull(Map<String, String> map) {
5858

5959

6060
public Wrapper FilterCol(DataFilterColumnInterface df) {
61-
for (String s:df.Filter() ) {
61+
for (String s:df.filter() ) {
6262
filterColBy_key.add(s);
6363
}
6464
return this;
@@ -103,7 +103,7 @@ public <T> T CreateMap(String key)throws Exception {
103103
public Wrapper Filter(DataFilterInterface<?> filter) {
104104
this.filter = filter;return this;
105105
}
106-
public Wrapper Process(DataProcessInterface<?> process) {
106+
public Wrapper Process(DataFilterProcessInterface<?> process) {
107107
this.process = process;return this;
108108
}
109109
}

src/main/java/seven/wapperInt/wapperRef/sysWppers/ResWrapperMap.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
// .--(^)(^^)---/#\
1919
// .' @ /###\
2020
// : , #####
21+
// : , #####
2122
// `-..__.-' _.-\###/
2223
// `;_: `"'
2324
// .'"""""`.

src/test/java/Demo.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,21 @@
3434
public class Demo {
3535
@Test
3636
public void Test_01() throws Exception {
37-
getBeans(System.getProperty("user.dir").concat("\\测试.xls"),
37+
ExcelFactory.getBeans(System.getProperty("user.dir").concat("\\测试.xls"),
3838
new ResWrapperMap() {
3939
@Override
4040
protected void LoadConfig(Config config) {
4141
config.setContent_row_start(3);
4242
config.setTitle_row(2);
4343
}
44-
}).
44+
}).//这里能够处理每一行数据
4545
Process((HashMap<String, String> o) -> System.out.println(o + "\n")
46+
//这里能够处理时候过滤某一列
4647
).FilterCol(() -> new String[]{}
47-
).Filter((HashMap<String, String> o) -> o.get("创建人") != null && o.get("创建人").length() > 5).Create();
48+
//这里能根据某一行的某一列的内容来取舍这行数据
49+
).Filter((HashMap<String, String> o) -> o.get("创建人") != null && o.get("创建人").length() > 5
50+
//排序
51+
).Sort((o1, o2) -> o1.hashCode()>o2.hashCode()?1:hashCode()==o2.hashCode()?0:-1).Create();
4852

4953
System.out.println(
5054
getBeans(System.getProperty("user.dir").concat("\\测试.xls"),

关系.png

740 Bytes
Loading

0 commit comments

Comments
 (0)