Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
dangdang01234 committed Feb 6, 2018
1 parent 5efd57d commit 15745fa
Show file tree
Hide file tree
Showing 31 changed files with 215 additions and 72 deletions.
172 changes: 163 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.alibaba</groupId>
<artifactId>a2m.china</artifactId>
<version>3</version>
</parent>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>1.0.0-RELEASE</version>
<version>1.0.0</version>
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
</parent>
<packaging>jar</packaging>
<name>easyexcel</name>
<description>easyexcel is a excel handle tools written in Java</description>

<url>https://github.com/alibaba/easyexcel</url>
<inceptionYear>2018</inceptionYear>

<properties>
<junit.version>4.12</junit.version>
<gpg.skip>true</gpg.skip>
<javadoc.skip>false</javadoc.skip>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jdk.version>1.7</jdk.version>
</properties>

<scm>
<url>https://github.com/alibaba/easyexcel</url>
<connection>scm:git:https://git@github.com/alibaba/easyexcel.git</connection>
</scm>

<repositories>
<repository>
<id>local-file</id>
<url>file://${basedir}/lib/</url>
<layout>default</layout>
</repository>
</repositories>

<organization>
<name>Alibaba Group</name>
<url>https://github.com/alibaba</url>
</organization>

<developers>
<developer>
<id>jipengfei</id>
<name>jipengfei</name>
<email>1558143046@qq.com</email>
</developer>
</developers>

<licenses>
<license>
<name>Apache 2</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
<comments>A business-friendly OSS license</comments>
</license>
</licenses>

<dependencies>
<dependency>
Expand Down Expand Up @@ -40,4 +88,110 @@
<version>1.14</version>
</dependency>
</dependencies>
<build>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-webdav</artifactId>
<version>1.0-beta-2</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>

<version>3.5.1</version>
<configuration>
<encoding>UTF-8</encoding>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-javac</artifactId>
<version>2.7</version>
</dependency>
</dependencies>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
<configuration>
<attach>true</attach>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<include>**/bvt/**/*.java</include>
</includes>
</configuration>
</plugin>

<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>attach-javadoc</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<skip>${javadoc.skip}</skip>
<show>public</show>
<charset>UTF-8</charset>
<encoding>UTF-8</encoding>
<docencoding>UTF-8</docencoding>
<links>
<link>http://docs.oracle.com/javase/6/docs/api</link>
</links>
</configuration>
</plugin>

<plugin>
<artifactId>maven-gpg-plugin</artifactId>
<configuration>
<skip>${gpg.skip}</skip>
</configuration>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<distributionManagement>
<repository>
<id>oss</id>
<name>jipengfei</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
<snapshotRepository>
<id>oss</id>
<name>jipengfei</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>

</distributionManagement>
</project>
2 changes: 1 addition & 1 deletion src/main/java/com/alibaba/excel/ExcelReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void read(Sheet sheet) {
/**
* 读取excel中包含哪些sheet
*
* @return
* @return Sheets
*/
public List<Sheet> getSheets() {
return analyser.getSheets();
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/com/alibaba/excel/ExcelWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public ExcelWriter(OutputStream outputStream, ExcelTypeEnum typeEnum) {
*
* @param outputStream 文件输出流
* @param typeEnum 输出文件类型03或07,强烈建议使用07版(可以输出超大excel而不内存溢出)
* @param needHead 是否需要表头
*/
public ExcelWriter(OutputStream outputStream, ExcelTypeEnum typeEnum, boolean needHead) {
excelBuilder = new ExcelBuilderImpl();
Expand All @@ -55,7 +56,7 @@ public ExcelWriter write(List<? extends BaseRowModel> data, Sheet sheet) {
/**
* 生成多sheet,每个sheet一张表
*
* @param data List<String>代表一行数据
* @param data List代表一行数据
* @param sheet data写入某个sheet
* @return this(当前引用)
*/
Expand All @@ -67,7 +68,7 @@ public ExcelWriter write0(List<List<String>> data, Sheet sheet) {
/**
* 可生成多sheet,每个sheet多张表
*
* @param data type is <? extends BaseRowModel> 一个java模型一行数据
* @param data type 一个java模型一行数据
* @param sheet data写入某个sheet
* @param table data写入某个table
* @return this(当前引用)
Expand All @@ -80,7 +81,7 @@ public ExcelWriter write(List<? extends BaseRowModel> data, Sheet sheet, Table t
/**
* 可生成多sheet,每个sheet多张表
*
* @param data List<String> 代表一行数据
* @param data List 代表一行数据
* @param sheet data写入某个sheet
* @param table data写入某个table
* @return this(当前引用)
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/alibaba/excel/analysis/ExcelAnalyser.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,29 @@ public interface ExcelAnalyser {
* @param excelTypeEnum 解析文件类型
* @param custom 用户自定义参数用户回调时候可以获取到
* @param eventListener 解析器需要的监听器
* @param trim
* @param trim 是否去空格
*/
void init(InputStream inputStream, ExcelTypeEnum excelTypeEnum, Object custom, AnalysisEventListener eventListener,
boolean trim);

/**
* 解析指定sheet,{@link AnalysisEventListener}监听中使用
*
* @param sheetParam
* @param sheetParam 入参
*/
void analysis(Sheet sheetParam);


/**
*
* 默认解析第一个sheet,解析结果以List<String> 的格式在 {@link AnalysisEventListener}监听中使用
* 默认解析第一个sheet,解析结果在 {@link AnalysisEventListener}监听中使用
*/
void analysis();

/**
* 返回excel中包含哪些sheet
*
* @return
* @return 返回所有sheet
*/
List<Sheet> getSheets();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

/**
* @author jipengfei
* @date 2017/08/27
*
*/
public class SaxAnalyserV07 extends BaseSaxAnalyser {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

/**
* @author jipengfei
* @date 2017/08/23
*
*/
public class RowHandler extends DefaultHandler {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/**
* @author jipengfei
* @date 2017/10/13
*
*/
public class XMLTempFile {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

/**
* @author jipengfei
* @date 2017/10/13
*
*/
public class XmlParserFactory {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Field column num at excel head
*
* @author jipengfei
* @date 2017/03/19
*
*/
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
Expand All @@ -20,7 +20,7 @@

/**
* col num
* @return
* @return col num
*/
int value();

Expand All @@ -29,7 +29,7 @@
* Default @see com.alibaba.TypeUtil
* if default is not meet you can set format
*
* @return
* @return format
*/
String format() default "";
}
6 changes: 3 additions & 3 deletions src/main/java/com/alibaba/excel/annotation/ExcelProperty.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@

/**
* 某列表头值
* @return
* @return 表头值
*/
String[] value() default {""};


/**
* 列顺序,越小越靠前
* @return
* @return 列顺序
*/
int index() default 99999;

Expand All @@ -32,7 +32,7 @@
* default @see com.alibaba.TypeUtil
* if default is not meet you can set format
*
* @return
* @return 日期格式化
*/
String format() default "";
}
2 changes: 1 addition & 1 deletion src/main/java/com/alibaba/excel/annotation/FieldType.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
*
* @author jipengfei
* @date 2017/03/15
*
*/
public enum FieldType {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/**
* @author jipengfei
* @date 2017/08/24
*
*/
public class ExcelXmlConstants {
public static final String DIMENSION = "dimension";
Expand Down
Loading

0 comments on commit 15745fa

Please sign in to comment.