WriteWorkbook.java 3.2 KB
Newer Older
Z
zhuangjiaju 已提交
1
package com.alibaba.excel.write.metadata;
Z
zhuangjiaju 已提交
2

Z
zhuangjiaju 已提交
3
import java.io.File;
Z
zhuangjiaju 已提交
4 5 6 7 8 9 10 11 12 13 14
import java.io.InputStream;
import java.io.OutputStream;

import com.alibaba.excel.support.ExcelTypeEnum;
import com.alibaba.excel.write.handler.WriteHandler;

/**
 * Workbook
 *
 * @author zhuangjiaju
 **/
Z
zhuangjiaju 已提交
15
public class WriteWorkbook extends WriteBasicParameter {
Z
zhuangjiaju 已提交
16 17 18 19 20
    /**
     * Excel type
     */
    private ExcelTypeEnum excelType;
    /**
Z
zhuangjiaju 已提交
21
     * Final output stream
Z
zhuangjiaju 已提交
22 23 24
     */
    private OutputStream outputStream;
    /**
Z
zhuangjiaju 已提交
25 26 27 28 29
     * <li>write: Template input stream
     * <li>read: Read InputStream
     * <p>
     * If 'inputStream' and 'file' all not empty,file first
     */
Z
zhuangjiaju 已提交
30
    private InputStream templateInputStream;
Z
zhuangjiaju 已提交
31 32 33 34 35 36

    /**
     * <li>write: Template file
     * <li>read: Read file
     * <p>
     * If 'inputStream' and 'file' all not empty,file first
Z
zhuangjiaju 已提交
37
     */
Z
zhuangjiaju 已提交
38
    private File templateFile;
Z
zhuangjiaju 已提交
39
    /**
40
     * Default true
Z
zhuangjiaju 已提交
41
     */
42
    private Boolean autoCloseStream;
Z
zhuangjiaju 已提交
43
    /**
Z
zhuangjiaju 已提交
44
     * Mandatory use 'inputStream' .Default is false
Z
zhuangjiaju 已提交
45
     */
Z
zhuangjiaju 已提交
46
    private Boolean mandatoryUseInputStream;
Z
zhuangjiaju 已提交
47
    /**
Z
zhuangjiaju 已提交
48 49 50
     * The default is all excel objects.Default is true.
     * <li>if true , you can use {@link com.alibaba.excel.annotation.ExcelIgnore} ignore a field.
     * <li>if false , you must use {@link com.alibaba.excel.annotation.ExcelProperty} to use a filed.
Z
zhuangjiaju 已提交
51 52 53 54 55
     * 
     * @deprecated Just to be compatible with historical data, The default is always going to be convert all filed.
     */
    @Deprecated
    private Boolean convertAllFiled;
Z
zhuangjiaju 已提交
56 57 58 59 60 61 62
    /**
     * Write handler
     * 
     * @deprecated please use {@link WriteHandler}
     */
    @Deprecated
    private com.alibaba.excel.event.WriteHandler writeHandler;
Z
zhuangjiaju 已提交
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79

    public ExcelTypeEnum getExcelType() {
        return excelType;
    }

    public void setExcelType(ExcelTypeEnum excelType) {
        this.excelType = excelType;
    }

    public OutputStream getOutputStream() {
        return outputStream;
    }

    public void setOutputStream(OutputStream outputStream) {
        this.outputStream = outputStream;
    }

Z
zhuangjiaju 已提交
80 81
    public InputStream getTemplateInputStream() {
        return templateInputStream;
Z
zhuangjiaju 已提交
82 83
    }

Z
zhuangjiaju 已提交
84 85
    public void setTemplateInputStream(InputStream templateInputStream) {
        this.templateInputStream = templateInputStream;
Z
zhuangjiaju 已提交
86 87
    }

Z
zhuangjiaju 已提交
88 89
    public File getTemplateFile() {
        return templateFile;
Z
zhuangjiaju 已提交
90 91
    }

Z
zhuangjiaju 已提交
92 93
    public void setTemplateFile(File templateFile) {
        this.templateFile = templateFile;
Z
zhuangjiaju 已提交
94
    }
95 96 97 98 99 100 101 102

    public Boolean getAutoCloseStream() {
        return autoCloseStream;
    }

    public void setAutoCloseStream(Boolean autoCloseStream) {
        this.autoCloseStream = autoCloseStream;
    }
Z
zhuangjiaju 已提交
103

Z
zhuangjiaju 已提交
104 105
    public Boolean getMandatoryUseInputStream() {
        return mandatoryUseInputStream;
Z
zhuangjiaju 已提交
106 107
    }

Z
zhuangjiaju 已提交
108 109
    public void setMandatoryUseInputStream(Boolean mandatoryUseInputStream) {
        this.mandatoryUseInputStream = mandatoryUseInputStream;
Z
zhuangjiaju 已提交
110 111
    }

Z
zhuangjiaju 已提交
112 113
    public Boolean getConvertAllFiled() {
        return convertAllFiled;
Z
zhuangjiaju 已提交
114 115
    }

Z
zhuangjiaju 已提交
116 117
    public void setConvertAllFiled(Boolean convertAllFiled) {
        this.convertAllFiled = convertAllFiled;
Z
zhuangjiaju 已提交
118 119
    }

Z
zhuangjiaju 已提交
120 121
    public com.alibaba.excel.event.WriteHandler getWriteHandler() {
        return writeHandler;
Z
zhuangjiaju 已提交
122 123
    }

Z
zhuangjiaju 已提交
124 125
    public void setWriteHandler(com.alibaba.excel.event.WriteHandler writeHandler) {
        this.writeHandler = writeHandler;
Z
zhuangjiaju 已提交
126
    }
Z
zhuangjiaju 已提交
127
}