Skip to content

Commit

Permalink
snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
looly committed Aug 17, 2017
1 parent 70ab390 commit decae5c
Show file tree
Hide file tree
Showing 23 changed files with 113 additions and 85 deletions.
2 changes: 1 addition & 1 deletion hutool-all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.xiaoleilu</groupId>
<artifactId>hutool-parent</artifactId>
<version>3.1.0</version>
<version>3.1.0-SNAPSHOT</version>
</parent>

<artifactId>hutool-all</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion hutool-aop/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.xiaoleilu</groupId>
<artifactId>hutool-parent</artifactId>
<version>3.1.0</version>
<version>3.1.0-SNAPSHOT</version>
</parent>

<artifactId>hutool-aop</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion hutool-bloomFilter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.xiaoleilu</groupId>
<artifactId>hutool-parent</artifactId>
<version>3.1.0</version>
<version>3.1.0-SNAPSHOT</version>
</parent>

<artifactId>hutool-bloomFilter</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion hutool-cache/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.xiaoleilu</groupId>
<artifactId>hutool-parent</artifactId>
<version>3.1.0</version>
<version>3.1.0-SNAPSHOT</version>
</parent>

<artifactId>hutool-cache</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion hutool-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.xiaoleilu</groupId>
<artifactId>hutool-parent</artifactId>
<version>3.1.0</version>
<version>3.1.0-SNAPSHOT</version>
</parent>

<artifactId>hutool-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public DateTime step(DateTime current, DateTime end, int index) {
if(current.isAfterOrEquals(end)) {
return null;
}
return current.offset(DateField.DAY_OF_YEAR, 1);
return current.offsetNew(DateField.DAY_OF_YEAR, 1);
}

});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import org.junit.Assert;
import org.junit.Test;

import com.xiaoleilu.hutool.lang.Console;
import com.xiaoleilu.hutool.lang.Dict;
import com.xiaoleilu.hutool.util.StrUtil;

Expand Down Expand Up @@ -41,7 +40,7 @@ public void cleanBlankTest(){
public void cutTest(){
String str = "aaabbbcccdddaadfdfsdfsdf0";
String[] cut = StrUtil.cut(str, 4);
Console.log(cut);
Assert.assertArrayEquals(new String[] {"aaab", "bbcc", "cddd", "aadf", "dfsd", "fsdf", "0"}, cut);
}

@Test
Expand All @@ -58,6 +57,6 @@ public void splitTest(){
public void formatTest() {
String template = "你好,我是{name},我的电话是:{phone}";
String result = StrUtil.format(template, Dict.create().set("name", "张三").set("phone", "13888881111"));
Console.log(result);
Assert.assertEquals("你好,我是张三,我的电话是:13888881111", result);
}
}
2 changes: 1 addition & 1 deletion hutool-cron/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.xiaoleilu</groupId>
<artifactId>hutool-parent</artifactId>
<version>3.1.0</version>
<version>3.1.0-SNAPSHOT</version>
</parent>

<artifactId>hutool-cron</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion hutool-crypto/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.xiaoleilu</groupId>
<artifactId>hutool-parent</artifactId>
<version>3.1.0</version>
<version>3.1.0-SNAPSHOT</version>
</parent>

<artifactId>hutool-crypto</artifactId>
Expand Down
39 changes: 20 additions & 19 deletions hutool-db/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,23 @@
<parent>
<groupId>com.xiaoleilu</groupId>
<artifactId>hutool-parent</artifactId>
<version>3.1.0</version>
<version>3.1.0-SNAPSHOT</version>
</parent>

<artifactId>hutool-db</artifactId>
<name>${project.artifactId}</name>
<description>Hutool 数据库JDBC的ORM封装</description>

<properties>
<!-- versions -->
<tomcat-jdbc.version>8.5.15</tomcat-jdbc.version>
<druid.version>1.0.31</druid.version>
<HikariCP.version>2.4.12</HikariCP.version>
<c3p0.version>0.9.5.2</c3p0.version>
<dbcp2.version>2.1.1</dbcp2.version>
<mongo.version>3.4.2</mongo.version>
<sqlite.version>3.18.0</sqlite.version>
</properties>

<dependencies>
<dependency>
Expand All @@ -30,61 +41,51 @@
<artifactId>hutool-log</artifactId>
<version>${project.parent.version}</version>
</dependency>

<!-- 数据库连接池 -->
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jdbc</artifactId>
<version>8.5.15</version>
<version>${tomcat-jdbc.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.0.31</version>
<version>${druid.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP-java7</artifactId>
<version>2.4.12</version>
<version>${HikariCP.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.mchange</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.5.2</version>
<version>${c3p0.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-dbcp2</artifactId>
<version>2.1.1</version>
<version>${dbcp2.version}</version>
<optional>true</optional>
</dependency>
<!-- MongoDB Java客户端 -->
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>3.4.2</version>
<version>${mongo.version}</version>
<optional>true</optional>
</dependency>

<!-- 测试用依赖 -->
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.18.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.42</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${sqlite.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion hutool-dfa/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.xiaoleilu</groupId>
<artifactId>hutool-parent</artifactId>
<version>3.1.0</version>
<version>3.1.0-SNAPSHOT</version>
</parent>

<artifactId>hutool-dfa</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion hutool-extra/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.xiaoleilu</groupId>
<artifactId>hutool-parent</artifactId>
<version>3.1.0</version>
<version>3.1.0-SNAPSHOT</version>
</parent>

<artifactId>hutool-extra</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion hutool-geo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.xiaoleilu</groupId>
<artifactId>hutool-parent</artifactId>
<version>3.1.0</version>
<version>3.1.0-SNAPSHOT</version>
</parent>

<artifactId>hutool-geo</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion hutool-http/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.xiaoleilu</groupId>
<artifactId>hutool-parent</artifactId>
<version>3.1.0</version>
<version>3.1.0-SNAPSHOT</version>
</parent>

<artifactId>hutool-http</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion hutool-json/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.xiaoleilu</groupId>
<artifactId>hutool-parent</artifactId>
<version>3.1.0</version>
<version>3.1.0-SNAPSHOT</version>
</parent>

<artifactId>hutool-json</artifactId>
Expand Down
19 changes: 18 additions & 1 deletion hutool-log/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,49 +7,66 @@
<parent>
<groupId>com.xiaoleilu</groupId>
<artifactId>hutool-parent</artifactId>
<version>3.1.0</version>
<version>3.1.0-SNAPSHOT</version>
</parent>

<artifactId>hutool-log</artifactId>
<name>${project.artifactId}</name>
<description>Hutool 日志封装</description>

<properties>
<!-- versions -->
<slf4j.version>1.7.25</slf4j.version>
<logback.version>1.2.3</logback.version>
<log4j.version>1.2.17</log4j.version>
<log4j2.version>2.8.2</log4j2.version>
<commons-logging.version>1.2</commons-logging.version>
<tinylog.version>1.2</tinylog.version>
</properties>

<dependencies>
<dependency>
<groupId>com.xiaoleilu</groupId>
<artifactId>hutool-core</artifactId>
<version>${project.parent.version}</version>
</dependency>

<!-- Logs -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
<scope>test</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j2.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>${commons-logging.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.tinylog</groupId>
<artifactId>tinylog</artifactId>
<version>${tinylog.version}</version>
<optional>true</optional>
</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion hutool-poi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.xiaoleilu</groupId>
<artifactId>hutool-parent</artifactId>
<version>3.1.0</version>
<version>3.1.0-SNAPSHOT</version>
</parent>

<artifactId>hutool-poi</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
Expand All @@ -24,13 +25,15 @@
*/
public class ExcelReader {

/** Excel中对应的Sheet */
private Sheet sheet;

/** 是否忽略空行 */
private boolean ignoreEmptyRow;
/** 是否去除单元格元素两边空格 */
private boolean trimCellValue;
/** 标题别名 */
private Map<String, String> headerAlias;
private Sheet sheet;
private Map<String, String> headerAlias = new HashMap<>();

// ------------------------------------------------------------------------------------------------------- Constructor start
/**
Expand Down Expand Up @@ -123,6 +126,44 @@ public ExcelReader setTrimCellValue(boolean trimCellValue) {
this.trimCellValue = trimCellValue;
return this;
}

/**
* 获得标题行的别名Map
* @return 别名Map
*/
public Map<String, String> getHeaderAlias() {
return headerAlias;
}

/**
* 设置标题行的别名Map
* @param headerAlias 别名Map
*/
public ExcelReader setHeaderAlias(Map<String, String> headerAlias) {
this.headerAlias = headerAlias;
return this;
}

/**
* 增加标题别名
* @param header 标题
* @param alias 别名
* @return this
*/
public ExcelReader addHeaderAlias(String header, String alias) {
this.headerAlias.put(header, alias);
return this;
}

/**
* 去除标题别名
* @param header 标题
* @return this
*/
public ExcelReader removeHeaderAlias(String header) {
this.headerAlias.remove(header);
return this;
}
// ------------------------------------------------------------------------------------------------------- Getters and Setters end

/**
Expand Down
Loading

0 comments on commit decae5c

Please sign in to comment.