ReadWorkbook.java 4.2 KB
Newer Older
Z
zhuangjiaju 已提交
1 2 3 4 5
package com.alibaba.excel.read.metadata;

import java.io.File;
import java.io.InputStream;

6
import com.alibaba.excel.cache.ReadCache;
庄家钜's avatar
庄家钜 已提交
7
import com.alibaba.excel.cache.selector.ReadCacheSelector;
8 9
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
Z
zhuangjiaju 已提交
10 11 12 13 14
import com.alibaba.excel.support.ExcelTypeEnum;

/**
 * Workbook
 *
Z
zhuangjiaju 已提交
15
 * @author Jiaju Zhuang
Z
zhuangjiaju 已提交
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
 **/
public class ReadWorkbook extends ReadBasicParameter {
    /**
     * Excel type
     */
    private ExcelTypeEnum excelType;
    /**
     * Read InputStream
     * <p>
     * If 'inputStream' and 'file' all not empty,file first
     */
    private InputStream inputStream;
    /**
     * Read file
     * <p>
     * If 'inputStream' and 'file' all not empty,file first
     */
    private File file;
34 35
    /**
     * Mandatory use 'inputStream' .Default is false.
罗成 已提交
36 37
     * <p>
     * if false,Will transfer 'inputStream' to temporary files to improve efficiency
38 39
     */
    private Boolean mandatoryUseInputStream;
Z
zhuangjiaju 已提交
40 41 42 43 44
    /**
     * Default true
     */
    private Boolean autoCloseStream;
    /**
45 46 47
     * This object can be read in the Listener {@link AnalysisEventListener#invoke(Object, AnalysisContext)}
     * {@link AnalysisContext#getCustom()}
     *
Z
zhuangjiaju 已提交
48
     */
49 50
    private Object customObject;
    /**
庄家钜's avatar
庄家钜 已提交
51
     * A cache that stores temp data to save memory.
52 53
     */
    private ReadCache readCache;
庄家钜's avatar
庄家钜 已提交
54 55 56 57 58 59 60 61
    /**
     * Ignore empty rows.Default is true.
     */
    private Boolean ignoreEmptyRow;
    /**
     * Select the cache.Default use {@link com.alibaba.excel.cache.selector.SimpleReadCacheSelector}
     */
    private ReadCacheSelector readCacheSelector;
Z
zhuangjiaju 已提交
62 63
    /**
     * The default is all excel objects.Default is true.
罗成 已提交
64 65 66 67
     * <p>
     * if true , you can use {@link com.alibaba.excel.annotation.ExcelIgnore} ignore a field.
     * <p>
     * if false , you must use {@link com.alibaba.excel.annotation.ExcelProperty} to use a filed.
Z
zhuangjiaju 已提交
68
     *
Z
zhuangjiaju 已提交
69 70 71 72 73
     * @deprecated Just to be compatible with historical data, The default is always going to be convert all filed.
     */
    @Deprecated
    private Boolean convertAllFiled;

Z
zhuangjiaju 已提交
74 75 76 77 78 79
    /**
     * List is returned by default, now map is returned by default
     */
    @Deprecated
    private Boolean defaultReturnMap;

Z
zhuangjiaju 已提交
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
    public ExcelTypeEnum getExcelType() {
        return excelType;
    }

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

    public InputStream getInputStream() {
        return inputStream;
    }

    public void setInputStream(InputStream inputStream) {
        this.inputStream = inputStream;
    }

    public File getFile() {
        return file;
    }

    public void setFile(File file) {
        this.file = file;
    }

    public Boolean getAutoCloseStream() {
        return autoCloseStream;
    }

    public void setAutoCloseStream(Boolean autoCloseStream) {
        this.autoCloseStream = autoCloseStream;
    }

112 113 114 115 116 117 118 119
    public Object getCustomObject() {
        return customObject;
    }

    public void setCustomObject(Object customObject) {
        this.customObject = customObject;
    }

Z
zhuangjiaju 已提交
120 121 122 123 124 125 126 127
    public Boolean getMandatoryUseInputStream() {
        return mandatoryUseInputStream;
    }

    public void setMandatoryUseInputStream(Boolean mandatoryUseInputStream) {
        this.mandatoryUseInputStream = mandatoryUseInputStream;
    }

128 129 130 131 132 133 134 135
    public ReadCache getReadCache() {
        return readCache;
    }

    public void setReadCache(ReadCache readCache) {
        this.readCache = readCache;
    }

Z
zhuangjiaju 已提交
136 137 138 139 140 141 142
    public Boolean getConvertAllFiled() {
        return convertAllFiled;
    }

    public void setConvertAllFiled(Boolean convertAllFiled) {
        this.convertAllFiled = convertAllFiled;
    }
Z
zhuangjiaju 已提交
143 144 145 146 147 148 149 150

    public Boolean getDefaultReturnMap() {
        return defaultReturnMap;
    }

    public void setDefaultReturnMap(Boolean defaultReturnMap) {
        this.defaultReturnMap = defaultReturnMap;
    }
庄家钜's avatar
庄家钜 已提交
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166

    public Boolean getIgnoreEmptyRow() {
        return ignoreEmptyRow;
    }

    public void setIgnoreEmptyRow(Boolean ignoreEmptyRow) {
        this.ignoreEmptyRow = ignoreEmptyRow;
    }

    public ReadCacheSelector getReadCacheSelector() {
        return readCacheSelector;
    }

    public void setReadCacheSelector(ReadCacheSelector readCacheSelector) {
        this.readCacheSelector = readCacheSelector;
    }
Z
zhuangjiaju 已提交
167
}