修改目录结构
This commit is contained in:
parent
e6b6d2a07b
commit
1372952139
@ -15,6 +15,10 @@
|
||||
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>easyexcel-support</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi</artifactId>
|
||||
|
@ -1,103 +1,3 @@
|
||||
package com.alibaba.excel.metadata;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.excel.converters.Converter;
|
||||
import com.alibaba.excel.converters.ConverterKeyBuild.ConverterKey;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* Write/read holder
|
||||
*
|
||||
* @author Jiaju Zhuang
|
||||
* Documents have been migrated to https://github.com/alibaba/easyexcel/blob/master/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/fill/FillTest.java
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@EqualsAndHashCode
|
||||
@NoArgsConstructor
|
||||
public abstract class AbstractHolder implements ConfigurationHolder {
|
||||
/**
|
||||
* Record whether it's new or from cache
|
||||
*/
|
||||
private Boolean newInitialization;
|
||||
/**
|
||||
* You can only choose one of the {@link AbstractHolder#head} and {@link AbstractHolder#clazz}
|
||||
*/
|
||||
private List<List<String>> head;
|
||||
/**
|
||||
* You can only choose one of the {@link AbstractHolder#head} and {@link AbstractHolder#clazz}
|
||||
*/
|
||||
private Class<?> clazz;
|
||||
/**
|
||||
* Some global variables
|
||||
*/
|
||||
private GlobalConfiguration globalConfiguration;
|
||||
/**
|
||||
* <p>
|
||||
* Read key:
|
||||
* <p>
|
||||
* Write key:
|
||||
*/
|
||||
private Map<ConverterKey, Converter<?>> converterMap;
|
||||
|
||||
public AbstractHolder(BasicParameter basicParameter, AbstractHolder prentAbstractHolder) {
|
||||
this.newInitialization = Boolean.TRUE;
|
||||
if (basicParameter.getHead() == null && basicParameter.getClazz() == null && prentAbstractHolder != null) {
|
||||
this.head = prentAbstractHolder.getHead();
|
||||
} else {
|
||||
this.head = basicParameter.getHead();
|
||||
}
|
||||
if (basicParameter.getHead() == null && basicParameter.getClazz() == null && prentAbstractHolder != null) {
|
||||
this.clazz = prentAbstractHolder.getClazz();
|
||||
} else {
|
||||
this.clazz = basicParameter.getClazz();
|
||||
}
|
||||
this.globalConfiguration = new GlobalConfiguration();
|
||||
if (basicParameter.getAutoTrim() == null) {
|
||||
if (prentAbstractHolder != null) {
|
||||
globalConfiguration.setAutoTrim(prentAbstractHolder.getGlobalConfiguration().getAutoTrim());
|
||||
}
|
||||
} else {
|
||||
globalConfiguration.setAutoTrim(basicParameter.getAutoTrim());
|
||||
}
|
||||
|
||||
if (basicParameter.getUse1904windowing() == null) {
|
||||
if (prentAbstractHolder != null) {
|
||||
globalConfiguration.setUse1904windowing(
|
||||
prentAbstractHolder.getGlobalConfiguration().getUse1904windowing());
|
||||
}
|
||||
} else {
|
||||
globalConfiguration.setUse1904windowing(basicParameter.getUse1904windowing());
|
||||
}
|
||||
|
||||
if (basicParameter.getLocale() == null) {
|
||||
if (prentAbstractHolder != null) {
|
||||
globalConfiguration.setLocale(prentAbstractHolder.getGlobalConfiguration().getLocale());
|
||||
}
|
||||
} else {
|
||||
globalConfiguration.setLocale(basicParameter.getLocale());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<ConverterKey, Converter<?>> converterMap() {
|
||||
return getConverterMap();
|
||||
}
|
||||
|
||||
@Override
|
||||
public GlobalConfiguration globalConfiguration() {
|
||||
return getGlobalConfiguration();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNew() {
|
||||
return getNewInitialization();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,8 +1,7 @@
|
||||
package com.alibaba.excel.util;
|
||||
|
||||
import net.sf.cglib.beans.BeanMap;
|
||||
import net.sf.cglib.beans.BeanMap.Generator;
|
||||
import net.sf.cglib.core.DefaultNamingPolicy;
|
||||
import org.springframework.cglib.beans.BeanMap;
|
||||
import org.springframework.cglib.core.DefaultNamingPolicy;
|
||||
|
||||
/**
|
||||
* bean utils
|
||||
@ -23,9 +22,10 @@ public class BeanMapUtils {
|
||||
* @return a new <code>BeanMap</code> instance
|
||||
*/
|
||||
public static BeanMap create(Object bean) {
|
||||
Generator gen = new Generator();
|
||||
gen.setBean(bean);
|
||||
gen.setNamingPolicy(EasyExcelNamingPolicy.INSTANCE);
|
||||
BeanMap.Generator gen = new BeanMap.Generator();
|
||||
//gen.setBean(student);
|
||||
//gen.setContextClass(Student.class);
|
||||
BeanMap beanMap = gen.create();
|
||||
return gen.create();
|
||||
}
|
||||
|
||||
|
@ -34,9 +34,19 @@
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<createSourcesJar>true</createSourcesJar>
|
||||
<shadedArtifactAttached>false</shadedArtifactAttached>
|
||||
<createDependencyReducedPom>true</createDependencyReducedPom>
|
||||
<!-- Make sure the transitive dependencies are written to the generated pom under <dependencies> -->
|
||||
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
|
||||
<artifactSet>
|
||||
<includes>
|
||||
<include>org.springframework:spring-core</include>
|
||||
</includes>
|
||||
</artifactSet>
|
||||
<filters>
|
||||
<filter>
|
||||
<artifact>cglib:cglib</artifact>
|
||||
<artifact>org.springframework:spring-core</artifact>
|
||||
<includes>
|
||||
<include>org/springframework/asm/**</include>
|
||||
<include>org/springframework/cglib/**</include>
|
||||
@ -53,6 +63,10 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>flatten-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
@ -0,0 +1,4 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package com.alibaba.excel.support;
|
23
easyexcel/pom.xml
Normal file
23
easyexcel/pom.xml
Normal file
@ -0,0 +1,23 @@
|
||||
<?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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>easyexcel-parent</artifactId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>easyexcel</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>easyexcel-core</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
@ -0,0 +1,4 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package com.alibaba.excel;
|
23
pom.xml
23
pom.xml
@ -14,6 +14,7 @@
|
||||
<modules>
|
||||
<module>easyexcel-core</module>
|
||||
<module>easyexcel-support</module>
|
||||
<module>easyexcel</module>
|
||||
</modules>
|
||||
|
||||
|
||||
@ -67,6 +68,24 @@
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>easyexcel</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>easyexcel-core</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>easyexcel-support</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi</artifactId>
|
||||
@ -347,12 +366,12 @@
|
||||
<artifactId>flatten-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<updatePomFile>true</updatePomFile>
|
||||
<flattenMode>oss</flattenMode>
|
||||
<flattenMode>resolveCiFriendliesOnly</flattenMode>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>flatten</id>
|
||||
<phase>process-resources</phase>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>flatten</goal>
|
||||
</goals>
|
||||
|
@ -0,0 +1,3 @@
|
||||
/**
|
||||
* Documents have been migrated to https://github.com/alibaba/easyexcel/blob/master/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/fill/FillTest.java
|
||||
*/
|
@ -0,0 +1,3 @@
|
||||
/**
|
||||
* Documents have been migrated to https://github.com/alibaba/easyexcel/blob/master/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/read/ReadTest.java
|
||||
*/
|
@ -0,0 +1,3 @@
|
||||
/**
|
||||
* Documents have been migrated to https://github.com/alibaba/easyexcel/blob/master/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/web/WebTest.java
|
||||
*/
|
@ -0,0 +1,3 @@
|
||||
/**
|
||||
* Documents have been migrated to https://github.com/alibaba/easyexcel/blob/master/easyexcel-core/src/test/java/com/alibaba/easyexcel/test/demo/write/WriteTest.java
|
||||
*/
|
Loading…
x
Reference in New Issue
Block a user