index
int64
repo_id
string
file_path
string
content
string
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/booleanconverter/BooleanBooleanConverter.java
package ai.chat2db.excel.converters.booleanconverter; import ai.chat2db.excel.enums.CellDataTypeEnum; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.ReadCellData; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; /** * Boolean and boolean converter * * @author Jiaju Zhuang */ public class BooleanBooleanConverter implements Converter<Boolean> { @Override public Class<?> supportJavaTypeKey() { return Boolean.class; } @Override public CellDataTypeEnum supportExcelTypeKey() { return CellDataTypeEnum.BOOLEAN; } @Override public Boolean convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { return cellData.getBooleanValue(); } @Override public WriteCellData<?> convertToExcelData(Boolean value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { return new WriteCellData<>(value); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/booleanconverter/BooleanNumberConverter.java
package ai.chat2db.excel.converters.booleanconverter; import java.math.BigDecimal; import ai.chat2db.excel.enums.CellDataTypeEnum; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.ReadCellData; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; /** * Boolean and number converter * * @author Jiaju Zhuang */ public class BooleanNumberConverter implements Converter<Boolean> { @Override public Class<?> supportJavaTypeKey() { return Boolean.class; } @Override public CellDataTypeEnum supportExcelTypeKey() { return CellDataTypeEnum.NUMBER; } @Override public Boolean convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { if (BigDecimal.ONE.compareTo(cellData.getNumberValue()) == 0) { return Boolean.TRUE; } return Boolean.FALSE; } @Override public WriteCellData<?> convertToExcelData(Boolean value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { if (value) { return new WriteCellData<>(BigDecimal.ONE); } return new WriteCellData<>(BigDecimal.ZERO); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/booleanconverter/BooleanStringConverter.java
package ai.chat2db.excel.converters.booleanconverter; import ai.chat2db.excel.enums.CellDataTypeEnum; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.ReadCellData; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; /** * Boolean and string converter * * @author Jiaju Zhuang */ public class BooleanStringConverter implements Converter<Boolean> { @Override public Class<?> supportJavaTypeKey() { return Boolean.class; } @Override public CellDataTypeEnum supportExcelTypeKey() { return CellDataTypeEnum.STRING; } @Override public Boolean convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { return Boolean.valueOf(cellData.getStringValue()); } @Override public WriteCellData<?> convertToExcelData(Boolean value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { return new WriteCellData<>(value.toString()); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/bytearray/BoxingByteArrayImageConverter.java
package ai.chat2db.excel.converters.bytearray; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; /** * Boxing Byte array and image converter * * @author Jiaju Zhuang */ public class BoxingByteArrayImageConverter implements Converter<Byte[]> { @Override public Class<?> supportJavaTypeKey() { return Byte[].class; } @Override public WriteCellData<?> convertToExcelData(Byte[] value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { byte[] byteValue = new byte[value.length]; for (int i = 0; i < value.length; i++) { byteValue[i] = value[i]; } return new WriteCellData<>(byteValue); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/bytearray/ByteArrayImageConverter.java
package ai.chat2db.excel.converters.bytearray; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; /** * Byte array and image converter * * @author Jiaju Zhuang */ public class ByteArrayImageConverter implements Converter<byte[]> { @Override public Class<byte[]> supportJavaTypeKey() { return byte[].class; } @Override public WriteCellData<?> convertToExcelData(byte[] value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { return new WriteCellData<>(value); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/byteconverter/ByteBooleanConverter.java
package ai.chat2db.excel.converters.byteconverter; import ai.chat2db.excel.enums.CellDataTypeEnum; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.ReadCellData; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; /** * Byte and boolean converter * * @author Jiaju Zhuang */ public class ByteBooleanConverter implements Converter<Byte> { private static final Byte ONE = (byte)1; private static final Byte ZERO = (byte)0; @Override public Class<?> supportJavaTypeKey() { return Byte.class; } @Override public CellDataTypeEnum supportExcelTypeKey() { return CellDataTypeEnum.BOOLEAN; } @Override public Byte convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { if (cellData.getBooleanValue()) { return ONE; } return ZERO; } @Override public WriteCellData<?> convertToExcelData(Byte value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { if (ONE.equals(value)) { return new WriteCellData<>(Boolean.TRUE); } return new WriteCellData<>(Boolean.FALSE); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/byteconverter/ByteNumberConverter.java
package ai.chat2db.excel.converters.byteconverter; import ai.chat2db.excel.enums.CellDataTypeEnum; import ai.chat2db.excel.util.NumberUtils; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.ReadCellData; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; /** * Byte and number converter * * @author Jiaju Zhuang */ public class ByteNumberConverter implements Converter<Byte> { @Override public Class<?> supportJavaTypeKey() { return Byte.class; } @Override public CellDataTypeEnum supportExcelTypeKey() { return CellDataTypeEnum.NUMBER; } @Override public Byte convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { return cellData.getNumberValue().byteValue(); } @Override public WriteCellData<?> convertToExcelData(Byte value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { return NumberUtils.formatToCellData(value, contentProperty); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/byteconverter/ByteStringConverter.java
package ai.chat2db.excel.converters.byteconverter; import java.text.ParseException; import ai.chat2db.excel.enums.CellDataTypeEnum; import ai.chat2db.excel.util.NumberUtils; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.ReadCellData; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; /** * Byte and string converter * * @author Jiaju Zhuang */ public class ByteStringConverter implements Converter<Byte> { @Override public Class<?> supportJavaTypeKey() { return Byte.class; } @Override public CellDataTypeEnum supportExcelTypeKey() { return CellDataTypeEnum.STRING; } @Override public Byte convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws ParseException { return NumberUtils.parseByte(cellData.getStringValue(), contentProperty); } @Override public WriteCellData<?> convertToExcelData(Byte value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { return NumberUtils.formatToCellDataString(value, contentProperty); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/date/DateDateConverter.java
package ai.chat2db.excel.converters.date; import java.util.Date; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.util.DateUtils; import ai.chat2db.excel.util.WorkBookUtil; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; /** * Date and date converter * * @author Jiaju Zhuang */ public class DateDateConverter implements Converter<Date> { @Override public Class<Date> supportJavaTypeKey() { return Date.class; } @Override public WriteCellData<?> convertToExcelData(Date value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception { WriteCellData<?> cellData = new WriteCellData<>(value); String format = null; if (contentProperty != null && contentProperty.getDateTimeFormatProperty() != null) { format = contentProperty.getDateTimeFormatProperty().getFormat(); } WorkBookUtil.fillDataFormat(cellData, format, DateUtils.defaultDateFormat); return cellData; } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/date/DateNumberConverter.java
package ai.chat2db.excel.converters.date; import java.math.BigDecimal; import java.util.Date; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.enums.CellDataTypeEnum; import ai.chat2db.excel.util.DateUtils; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.ReadCellData; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; import org.apache.poi.ss.usermodel.DateUtil; /** * Date and number converter * * @author Jiaju Zhuang */ public class DateNumberConverter implements Converter<Date> { @Override public Class<?> supportJavaTypeKey() { return Date.class; } @Override public CellDataTypeEnum supportExcelTypeKey() { return CellDataTypeEnum.NUMBER; } @Override public Date convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { if (contentProperty == null || contentProperty.getDateTimeFormatProperty() == null) { return DateUtils.getJavaDate(cellData.getNumberValue().doubleValue(), globalConfiguration.getUse1904windowing()); } else { return DateUtils.getJavaDate(cellData.getNumberValue().doubleValue(), contentProperty.getDateTimeFormatProperty().getUse1904windowing()); } } @Override public WriteCellData<?> convertToExcelData(Date value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { if (contentProperty == null || contentProperty.getDateTimeFormatProperty() == null) { return new WriteCellData<>( BigDecimal.valueOf(DateUtil.getExcelDate(value, globalConfiguration.getUse1904windowing()))); } else { return new WriteCellData<>(BigDecimal.valueOf( DateUtil.getExcelDate(value, contentProperty.getDateTimeFormatProperty().getUse1904windowing()))); } } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/date/DateStringConverter.java
package ai.chat2db.excel.converters.date; import java.text.ParseException; import java.util.Date; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.enums.CellDataTypeEnum; import ai.chat2db.excel.util.DateUtils; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.ReadCellData; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; /** * Date and string converter * * @author Jiaju Zhuang */ public class DateStringConverter implements Converter<Date> { @Override public Class<?> supportJavaTypeKey() { return Date.class; } @Override public CellDataTypeEnum supportExcelTypeKey() { return CellDataTypeEnum.STRING; } @Override public Date convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws ParseException { if (contentProperty == null || contentProperty.getDateTimeFormatProperty() == null) { return DateUtils.parseDate(cellData.getStringValue(), null); } else { return DateUtils.parseDate(cellData.getStringValue(), contentProperty.getDateTimeFormatProperty().getFormat()); } } @Override public WriteCellData<?> convertToExcelData(Date value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { if (contentProperty == null || contentProperty.getDateTimeFormatProperty() == null) { return new WriteCellData<>(DateUtils.format(value, null)); } else { return new WriteCellData<>(DateUtils.format(value, contentProperty.getDateTimeFormatProperty().getFormat())); } } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/doubleconverter/DoubleBooleanConverter.java
package ai.chat2db.excel.converters.doubleconverter; import ai.chat2db.excel.enums.CellDataTypeEnum; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.ReadCellData; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; /** * Double and boolean converter * * @author Jiaju Zhuang */ public class DoubleBooleanConverter implements Converter<Double> { private static final Double ONE = 1.0; private static final Double ZERO = 0.0; @Override public Class<?> supportJavaTypeKey() { return Double.class; } @Override public CellDataTypeEnum supportExcelTypeKey() { return CellDataTypeEnum.BOOLEAN; } @Override public Double convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { if (cellData.getBooleanValue()) { return ONE; } return ZERO; } @Override public WriteCellData<?> convertToExcelData(Double value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { if (ONE.equals(value)) { return new WriteCellData<>(Boolean.TRUE); } return new WriteCellData<>(Boolean.FALSE); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/doubleconverter/DoubleNumberConverter.java
package ai.chat2db.excel.converters.doubleconverter; import ai.chat2db.excel.enums.CellDataTypeEnum; import ai.chat2db.excel.util.NumberUtils; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.ReadCellData; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; /** * Double and number converter * * @author Jiaju Zhuang */ public class DoubleNumberConverter implements Converter<Double> { @Override public Class<?> supportJavaTypeKey() { return Double.class; } @Override public CellDataTypeEnum supportExcelTypeKey() { return CellDataTypeEnum.NUMBER; } @Override public Double convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { return cellData.getNumberValue().doubleValue(); } @Override public WriteCellData<?> convertToExcelData(Double value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { return NumberUtils.formatToCellData(value, contentProperty); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/doubleconverter/DoubleStringConverter.java
package ai.chat2db.excel.converters.doubleconverter; import java.text.ParseException; import ai.chat2db.excel.enums.CellDataTypeEnum; import ai.chat2db.excel.util.NumberUtils; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.ReadCellData; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; /** * Double and string converter * * @author Jiaju Zhuang */ public class DoubleStringConverter implements Converter<Double> { @Override public Class<?> supportJavaTypeKey() { return Double.class; } @Override public CellDataTypeEnum supportExcelTypeKey() { return CellDataTypeEnum.STRING; } @Override public Double convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws ParseException { return NumberUtils.parseDouble(cellData.getStringValue(), contentProperty); } @Override public WriteCellData<?> convertToExcelData(Double value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { return NumberUtils.formatToCellDataString(value, contentProperty); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/file/FileImageConverter.java
package ai.chat2db.excel.converters.file; import java.io.File; import java.io.IOException; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.util.FileUtils; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; /** * File and image converter * * @author Jiaju Zhuang */ public class FileImageConverter implements Converter<File> { @Override public Class<?> supportJavaTypeKey() { return File.class; } @Override public WriteCellData<?> convertToExcelData(File value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws IOException { return new WriteCellData<>(FileUtils.readFileToByteArray(value)); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/floatconverter/FloatBooleanConverter.java
package ai.chat2db.excel.converters.floatconverter; import ai.chat2db.excel.enums.CellDataTypeEnum; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.ReadCellData; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; /** * Float and boolean converter * * @author Jiaju Zhuang */ public class FloatBooleanConverter implements Converter<Float> { private static final Float ONE = (float)1.0; private static final Float ZERO = (float)0.0; @Override public Class<?> supportJavaTypeKey() { return Float.class; } @Override public CellDataTypeEnum supportExcelTypeKey() { return CellDataTypeEnum.BOOLEAN; } @Override public Float convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { if (cellData.getBooleanValue()) { return ONE; } return ZERO; } @Override public WriteCellData<?> convertToExcelData(Float value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { if (ONE.equals(value)) { return new WriteCellData<>(Boolean.TRUE); } return new WriteCellData<>(Boolean.FALSE); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/floatconverter/FloatNumberConverter.java
package ai.chat2db.excel.converters.floatconverter; import ai.chat2db.excel.converters.WriteConverterContext; import ai.chat2db.excel.enums.CellDataTypeEnum; import ai.chat2db.excel.util.NumberUtils; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.ReadCellData; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; /** * Float and number converter * * @author Jiaju Zhuang */ public class FloatNumberConverter implements Converter<Float> { @Override public Class<?> supportJavaTypeKey() { return Float.class; } @Override public CellDataTypeEnum supportExcelTypeKey() { return CellDataTypeEnum.NUMBER; } @Override public Float convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { return cellData.getNumberValue().floatValue(); } @Override public WriteCellData<?> convertToExcelData(WriteConverterContext<Float> context) { return NumberUtils.formatToCellData(context.getValue(), context.getContentProperty()); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/floatconverter/FloatStringConverter.java
package ai.chat2db.excel.converters.floatconverter; import java.text.ParseException; import ai.chat2db.excel.enums.CellDataTypeEnum; import ai.chat2db.excel.util.NumberUtils; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.ReadCellData; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; /** * Float and string converter * * @author Jiaju Zhuang */ public class FloatStringConverter implements Converter<Float> { @Override public Class<?> supportJavaTypeKey() { return Float.class; } @Override public CellDataTypeEnum supportExcelTypeKey() { return CellDataTypeEnum.STRING; } @Override public Float convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws ParseException { return NumberUtils.parseFloat(cellData.getStringValue(), contentProperty); } @Override public WriteCellData<?> convertToExcelData(Float value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { return NumberUtils.formatToCellDataString(value, contentProperty); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/inputstream/InputStreamImageConverter.java
package ai.chat2db.excel.converters.inputstream; import java.io.IOException; import java.io.InputStream; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.util.IoUtils; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; /** * File and image converter * * @author Jiaju Zhuang */ public class InputStreamImageConverter implements Converter<InputStream> { @Override public Class<?> supportJavaTypeKey() { return InputStream.class; } @Override public WriteCellData<?> convertToExcelData(InputStream value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws IOException { return new WriteCellData<>(IoUtils.toByteArray(value)); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/integer/IntegerBooleanConverter.java
package ai.chat2db.excel.converters.integer; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.enums.CellDataTypeEnum; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.ReadCellData; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; /** * Integer and boolean converter * * @author Jiaju Zhuang */ public class IntegerBooleanConverter implements Converter<Integer> { private static final Integer ONE = 1; private static final Integer ZERO = 0; @Override public Class<?> supportJavaTypeKey() { return Integer.class; } @Override public CellDataTypeEnum supportExcelTypeKey() { return CellDataTypeEnum.BOOLEAN; } @Override public Integer convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { if (cellData.getBooleanValue()) { return ONE; } return ZERO; } @Override public WriteCellData<?> convertToExcelData(Integer value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { if (ONE.equals(value)) { return new WriteCellData<>(Boolean.TRUE); } return new WriteCellData<>(Boolean.FALSE); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/integer/IntegerNumberConverter.java
package ai.chat2db.excel.converters.integer; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.converters.WriteConverterContext; import ai.chat2db.excel.enums.CellDataTypeEnum; import ai.chat2db.excel.util.NumberUtils; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.ReadCellData; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; /** * Integer and number converter * * @author Jiaju Zhuang */ public class IntegerNumberConverter implements Converter<Integer> { @Override public Class<?> supportJavaTypeKey() { return Integer.class; } @Override public CellDataTypeEnum supportExcelTypeKey() { return CellDataTypeEnum.NUMBER; } @Override public Integer convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { return cellData.getNumberValue().intValue(); } @Override public WriteCellData<?> convertToExcelData(WriteConverterContext<Integer> context) { return NumberUtils.formatToCellData(context.getValue(), context.getContentProperty()); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/integer/IntegerStringConverter.java
package ai.chat2db.excel.converters.integer; import java.text.ParseException; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.enums.CellDataTypeEnum; import ai.chat2db.excel.util.NumberUtils; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.ReadCellData; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; /** * Integer and string converter * * @author Jiaju Zhuang */ public class IntegerStringConverter implements Converter<Integer> { @Override public Class<?> supportJavaTypeKey() { return Integer.class; } @Override public CellDataTypeEnum supportExcelTypeKey() { return CellDataTypeEnum.STRING; } @Override public Integer convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws ParseException { return NumberUtils.parseInteger(cellData.getStringValue(), contentProperty); } @Override public WriteCellData<?> convertToExcelData(Integer value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { return NumberUtils.formatToCellDataString(value, contentProperty); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/localdate/LocalDateDateConverter.java
package ai.chat2db.excel.converters.localdate; import java.time.LocalDate; import java.time.LocalDateTime; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.util.DateUtils; import ai.chat2db.excel.util.WorkBookUtil; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; /** * LocalDate and date converter * * @author Jiaju Zhuang */ public class LocalDateDateConverter implements Converter<LocalDate> { @Override public Class<?> supportJavaTypeKey() { return LocalDate.class; } @Override public WriteCellData<?> convertToExcelData(LocalDate value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception { LocalDateTime localDateTime = value == null ? null : value.atTime(0, 0); WriteCellData<?> cellData = new WriteCellData<>(localDateTime); String format = null; if (contentProperty != null && contentProperty.getDateTimeFormatProperty() != null) { format = contentProperty.getDateTimeFormatProperty().getFormat(); } WorkBookUtil.fillDataFormat(cellData, format, DateUtils.defaultLocalDateFormat); return cellData; } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/localdate/LocalDateNumberConverter.java
package ai.chat2db.excel.converters.localdate; import java.math.BigDecimal; import java.time.LocalDate; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.enums.CellDataTypeEnum; import ai.chat2db.excel.util.DateUtils; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.ReadCellData; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; import org.apache.poi.ss.usermodel.DateUtil; /** * LocalDate and number converter * * @author Jiaju Zhuang */ public class LocalDateNumberConverter implements Converter<LocalDate> { @Override public Class<?> supportJavaTypeKey() { return LocalDate.class; } @Override public CellDataTypeEnum supportExcelTypeKey() { return CellDataTypeEnum.NUMBER; } @Override public LocalDate convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { if (contentProperty == null || contentProperty.getDateTimeFormatProperty() == null) { return DateUtils.getLocalDate(cellData.getNumberValue().doubleValue(), globalConfiguration.getUse1904windowing()); } else { return DateUtils.getLocalDate(cellData.getNumberValue().doubleValue(), contentProperty.getDateTimeFormatProperty().getUse1904windowing()); } } @Override public WriteCellData<?> convertToExcelData(LocalDate value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { if (contentProperty == null || contentProperty.getDateTimeFormatProperty() == null) { return new WriteCellData<>( BigDecimal.valueOf(DateUtil.getExcelDate(value, globalConfiguration.getUse1904windowing()))); } else { return new WriteCellData<>(BigDecimal.valueOf( DateUtil.getExcelDate(value, contentProperty.getDateTimeFormatProperty().getUse1904windowing()))); } } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/localdate/LocalDateStringConverter.java
package ai.chat2db.excel.converters.localdate; import java.text.ParseException; import java.time.LocalDate; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.enums.CellDataTypeEnum; import ai.chat2db.excel.util.DateUtils; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.ReadCellData; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; /** * LocalDate and string converter * * @author Jiaju Zhuang */ public class LocalDateStringConverter implements Converter<LocalDate> { @Override public Class<?> supportJavaTypeKey() { return LocalDate.class; } @Override public CellDataTypeEnum supportExcelTypeKey() { return CellDataTypeEnum.STRING; } @Override public LocalDate convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws ParseException { if (contentProperty == null || contentProperty.getDateTimeFormatProperty() == null) { return DateUtils.parseLocalDate(cellData.getStringValue(), null, globalConfiguration.getLocale()); } else { return DateUtils.parseLocalDate(cellData.getStringValue(), contentProperty.getDateTimeFormatProperty().getFormat(), globalConfiguration.getLocale()); } } @Override public WriteCellData<?> convertToExcelData(LocalDate value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { if (contentProperty == null || contentProperty.getDateTimeFormatProperty() == null) { return new WriteCellData<>(DateUtils.format(value, null, globalConfiguration.getLocale())); } else { return new WriteCellData<>( DateUtils.format(value, contentProperty.getDateTimeFormatProperty().getFormat(), globalConfiguration.getLocale())); } } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/localdatetime/LocalDateTimeDateConverter.java
package ai.chat2db.excel.converters.localdatetime; import java.time.LocalDateTime; import ai.chat2db.excel.util.DateUtils; import ai.chat2db.excel.util.WorkBookUtil; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; /** * LocalDateTime and date converter * * @author Jiaju Zhuang */ public class LocalDateTimeDateConverter implements Converter<LocalDateTime> { @Override public Class<?> supportJavaTypeKey() { return LocalDateTime.class; } @Override public WriteCellData<?> convertToExcelData(LocalDateTime value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception { WriteCellData<?> cellData = new WriteCellData<>(value); String format = null; if (contentProperty != null && contentProperty.getDateTimeFormatProperty() != null) { format = contentProperty.getDateTimeFormatProperty().getFormat(); } WorkBookUtil.fillDataFormat(cellData, format, DateUtils.defaultDateFormat); return cellData; } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/localdatetime/LocalDateTimeNumberConverter.java
package ai.chat2db.excel.converters.localdatetime; import java.math.BigDecimal; import java.time.LocalDateTime; import ai.chat2db.excel.enums.CellDataTypeEnum; import ai.chat2db.excel.util.DateUtils; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.ReadCellData; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; import org.apache.poi.ss.usermodel.DateUtil; /** * LocalDateTime and number converter * * @author Jiaju Zhuang */ public class LocalDateTimeNumberConverter implements Converter<LocalDateTime> { @Override public Class<?> supportJavaTypeKey() { return LocalDateTime.class; } @Override public CellDataTypeEnum supportExcelTypeKey() { return CellDataTypeEnum.NUMBER; } @Override public LocalDateTime convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { if (contentProperty == null || contentProperty.getDateTimeFormatProperty() == null) { return DateUtils.getLocalDateTime(cellData.getNumberValue().doubleValue(), globalConfiguration.getUse1904windowing()); } else { return DateUtils.getLocalDateTime(cellData.getNumberValue().doubleValue(), contentProperty.getDateTimeFormatProperty().getUse1904windowing()); } } @Override public WriteCellData<?> convertToExcelData(LocalDateTime value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { if (contentProperty == null || contentProperty.getDateTimeFormatProperty() == null) { return new WriteCellData<>( BigDecimal.valueOf(DateUtil.getExcelDate(value, globalConfiguration.getUse1904windowing()))); } else { return new WriteCellData<>(BigDecimal.valueOf( DateUtil.getExcelDate(value, contentProperty.getDateTimeFormatProperty().getUse1904windowing()))); } } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/localdatetime/LocalDateTimeStringConverter.java
package ai.chat2db.excel.converters.localdatetime; import java.text.ParseException; import java.time.LocalDateTime; import ai.chat2db.excel.enums.CellDataTypeEnum; import ai.chat2db.excel.util.DateUtils; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.ReadCellData; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; /** * LocalDateTime and string converter * * @author Jiaju Zhuang */ public class LocalDateTimeStringConverter implements Converter<LocalDateTime> { @Override public Class<?> supportJavaTypeKey() { return LocalDateTime.class; } @Override public CellDataTypeEnum supportExcelTypeKey() { return CellDataTypeEnum.STRING; } @Override public LocalDateTime convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws ParseException { if (contentProperty == null || contentProperty.getDateTimeFormatProperty() == null) { return DateUtils.parseLocalDateTime(cellData.getStringValue(), null, globalConfiguration.getLocale()); } else { return DateUtils.parseLocalDateTime(cellData.getStringValue(), contentProperty.getDateTimeFormatProperty().getFormat(), globalConfiguration.getLocale()); } } @Override public WriteCellData<?> convertToExcelData(LocalDateTime value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { if (contentProperty == null || contentProperty.getDateTimeFormatProperty() == null) { return new WriteCellData<>(DateUtils.format(value, null, globalConfiguration.getLocale())); } else { return new WriteCellData<>( DateUtils.format(value, contentProperty.getDateTimeFormatProperty().getFormat(), globalConfiguration.getLocale())); } } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/longconverter/LongBooleanConverter.java
package ai.chat2db.excel.converters.longconverter; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.enums.CellDataTypeEnum; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.ReadCellData; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; /** * Long and boolean converter * * @author Jiaju Zhuang */ public class LongBooleanConverter implements Converter<Long> { private static final Long ONE = 1L; private static final Long ZERO = 0L; @Override public Class<Long> supportJavaTypeKey() { return Long.class; } @Override public CellDataTypeEnum supportExcelTypeKey() { return CellDataTypeEnum.BOOLEAN; } @Override public Long convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { if (cellData.getBooleanValue()) { return ONE; } return ZERO; } @Override public WriteCellData<?> convertToExcelData(Long value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { if (ONE.equals(value)) { return new WriteCellData<>(Boolean.TRUE); } return new WriteCellData<>(Boolean.FALSE); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/longconverter/LongNumberConverter.java
package ai.chat2db.excel.converters.longconverter; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.converters.WriteConverterContext; import ai.chat2db.excel.enums.CellDataTypeEnum; import ai.chat2db.excel.util.NumberUtils; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.ReadCellData; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; /** * Long and number converter * * @author Jiaju Zhuang */ public class LongNumberConverter implements Converter<Long> { @Override public Class<Long> supportJavaTypeKey() { return Long.class; } @Override public CellDataTypeEnum supportExcelTypeKey() { return CellDataTypeEnum.NUMBER; } @Override public Long convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { return cellData.getNumberValue().longValue(); } @Override public WriteCellData<?> convertToExcelData(WriteConverterContext<Long> context) { return NumberUtils.formatToCellData(context.getValue(), context.getContentProperty()); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/longconverter/LongStringConverter.java
package ai.chat2db.excel.converters.longconverter; import java.text.ParseException; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.enums.CellDataTypeEnum; import ai.chat2db.excel.util.NumberUtils; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.ReadCellData; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; /** * Long and string converter * * @author Jiaju Zhuang */ public class LongStringConverter implements Converter<Long> { @Override public Class<Long> supportJavaTypeKey() { return Long.class; } @Override public CellDataTypeEnum supportExcelTypeKey() { return CellDataTypeEnum.STRING; } @Override public Long convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws ParseException { return NumberUtils.parseLong(cellData.getStringValue(), contentProperty); } @Override public WriteCellData<?> convertToExcelData(Long value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { return NumberUtils.formatToCellDataString(value, contentProperty); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/shortconverter/ShortBooleanConverter.java
package ai.chat2db.excel.converters.shortconverter; import ai.chat2db.excel.enums.CellDataTypeEnum; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.ReadCellData; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; /** * Short and boolean converter * * @author Jiaju Zhuang */ public class ShortBooleanConverter implements Converter<Short> { private static final Short ONE = 1; private static final Short ZERO = 0; @Override public Class<Short> supportJavaTypeKey() { return Short.class; } @Override public CellDataTypeEnum supportExcelTypeKey() { return CellDataTypeEnum.BOOLEAN; } @Override public Short convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { if (cellData.getBooleanValue()) { return ONE; } return ZERO; } @Override public WriteCellData<?> convertToExcelData(Short value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { if (ONE.equals(value)) { return new WriteCellData<>(Boolean.TRUE); } return new WriteCellData<>(Boolean.FALSE); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/shortconverter/ShortNumberConverter.java
package ai.chat2db.excel.converters.shortconverter; import ai.chat2db.excel.converters.WriteConverterContext; import ai.chat2db.excel.enums.CellDataTypeEnum; import ai.chat2db.excel.util.NumberUtils; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.ReadCellData; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; /** * Short and number converter * * @author Jiaju Zhuang */ public class ShortNumberConverter implements Converter<Short> { @Override public Class<Short> supportJavaTypeKey() { return Short.class; } @Override public CellDataTypeEnum supportExcelTypeKey() { return CellDataTypeEnum.NUMBER; } @Override public Short convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { return cellData.getNumberValue().shortValue(); } @Override public WriteCellData<?> convertToExcelData(WriteConverterContext<Short> context) { return NumberUtils.formatToCellData(context.getValue(), context.getContentProperty()); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/shortconverter/ShortStringConverter.java
package ai.chat2db.excel.converters.shortconverter; import java.text.ParseException; import ai.chat2db.excel.enums.CellDataTypeEnum; import ai.chat2db.excel.util.NumberUtils; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.ReadCellData; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; /** * Short and string converter * * @author Jiaju Zhuang */ public class ShortStringConverter implements Converter<Short> { @Override public Class<?> supportJavaTypeKey() { return Short.class; } @Override public CellDataTypeEnum supportExcelTypeKey() { return CellDataTypeEnum.STRING; } @Override public Short convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws ParseException { return NumberUtils.parseShort(cellData.getStringValue(), contentProperty); } @Override public WriteCellData<?> convertToExcelData(Short value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { return NumberUtils.formatToCellDataString(value, contentProperty); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/string/StringBooleanConverter.java
package ai.chat2db.excel.converters.string; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.enums.CellDataTypeEnum; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.ReadCellData; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; /** * String and boolean converter * * @author Jiaju Zhuang */ public class StringBooleanConverter implements Converter<String> { @Override public Class<?> supportJavaTypeKey() { return String.class; } @Override public CellDataTypeEnum supportExcelTypeKey() { return CellDataTypeEnum.BOOLEAN; } @Override public String convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { return cellData.getBooleanValue().toString(); } @Override public WriteCellData<?> convertToExcelData(String value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { return new WriteCellData<>(Boolean.valueOf(value)); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/string/StringErrorConverter.java
package ai.chat2db.excel.converters.string; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.enums.CellDataTypeEnum; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.ReadCellData; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; /** * String and error converter * * @author Jiaju Zhuang */ public class StringErrorConverter implements Converter<String> { @Override public Class<String> supportJavaTypeKey() { return String.class; } @Override public CellDataTypeEnum supportExcelTypeKey() { return CellDataTypeEnum.ERROR; } @Override public String convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { return cellData.getStringValue(); } @Override public WriteCellData<?> convertToExcelData(String value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { return new WriteCellData<>(CellDataTypeEnum.ERROR, value); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/string/StringImageConverter.java
package ai.chat2db.excel.converters.string; import java.io.File; import java.io.IOException; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.util.FileUtils; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; /** * String and image converter * * @author Jiaju Zhuang */ public class StringImageConverter implements Converter<String> { @Override public Class<?> supportJavaTypeKey() { return String.class; } @Override public WriteCellData<?> convertToExcelData(String value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws IOException { return new WriteCellData<>(FileUtils.readFileToByteArray(new File(value))); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/string/StringNumberConverter.java
package ai.chat2db.excel.converters.string; import java.math.BigDecimal; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.enums.CellDataTypeEnum; import ai.chat2db.excel.util.DateUtils; import ai.chat2db.excel.util.NumberDataFormatterUtils; import ai.chat2db.excel.util.NumberUtils; import ai.chat2db.excel.util.StringUtils; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.ReadCellData; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; /** * String and number converter * * @author Jiaju Zhuang */ public class StringNumberConverter implements Converter<String> { @Override public Class<?> supportJavaTypeKey() { return String.class; } @Override public CellDataTypeEnum supportExcelTypeKey() { return CellDataTypeEnum.NUMBER; } @Override public String convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { // If there are "DateTimeFormat", read as date if (contentProperty != null && contentProperty.getDateTimeFormatProperty() != null) { return DateUtils.format(cellData.getNumberValue(), contentProperty.getDateTimeFormatProperty().getUse1904windowing(), contentProperty.getDateTimeFormatProperty().getFormat()); } // If there are "NumberFormat", read as number if (contentProperty != null && contentProperty.getNumberFormatProperty() != null) { return NumberUtils.format(cellData.getNumberValue(), contentProperty); } // Excel defines formatting boolean hasDataFormatData = cellData.getDataFormatData() != null && cellData.getDataFormatData().getIndex() != null && !StringUtils.isEmpty( cellData.getDataFormatData().getFormat()); if (hasDataFormatData) { return NumberDataFormatterUtils.format(cellData.getNumberValue(), cellData.getDataFormatData().getIndex(), cellData.getDataFormatData().getFormat(), globalConfiguration); } // Default conversion number return NumberUtils.format(cellData.getNumberValue(), contentProperty); } @Override public WriteCellData<?> convertToExcelData(String value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { return new WriteCellData<>(new BigDecimal(value)); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/string/StringStringConverter.java
package ai.chat2db.excel.converters.string; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.enums.CellDataTypeEnum; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.ReadCellData; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; /** * String and string converter * * @author Jiaju Zhuang */ public class StringStringConverter implements Converter<String> { @Override public Class<?> supportJavaTypeKey() { return String.class; } @Override public CellDataTypeEnum supportExcelTypeKey() { return CellDataTypeEnum.STRING; } @Override public String convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { return cellData.getStringValue(); } @Override public WriteCellData<?> convertToExcelData(String value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) { return new WriteCellData<>(value); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/converters/url/UrlImageConverter.java
package ai.chat2db.excel.converters.url; import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.net.URLConnection; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.util.IoUtils; import ai.chat2db.excel.metadata.GlobalConfiguration; import ai.chat2db.excel.metadata.data.WriteCellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; /** * Url and image converter * * @author Jiaju Zhuang * @since 2.1.1 */ public class UrlImageConverter implements Converter<URL> { public static int urlConnectTimeout = 1000; public static int urlReadTimeout = 5000; @Override public Class<?> supportJavaTypeKey() { return URL.class; } @Override public WriteCellData<?> convertToExcelData(URL value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws IOException { InputStream inputStream = null; try { URLConnection urlConnection = value.openConnection(); urlConnection.setConnectTimeout(urlConnectTimeout); urlConnection.setReadTimeout(urlReadTimeout); inputStream = urlConnection.getInputStream(); byte[] bytes = IoUtils.toByteArray(inputStream); return new WriteCellData<>(bytes); } finally { if (inputStream != null) { inputStream.close(); } } } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/enums/BooleanEnum.java
package ai.chat2db.excel.enums; import lombok.Getter; /** * Default values cannot be used for annotations. * So an additional an enumeration to determine whether the user has added the enumeration. * * @author Jiaju Zhuang */ @Getter public enum BooleanEnum { /** * NULL */ DEFAULT(null), /** * TRUE */ TRUE(Boolean.TRUE), /** * FALSE */ FALSE(Boolean.FALSE), ; Boolean booleanValue; BooleanEnum(Boolean booleanValue) { this.booleanValue = booleanValue; } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/enums/ByteOrderMarkEnum.java
package ai.chat2db.excel.enums; import java.nio.charset.Charset; import java.util.Map; import ai.chat2db.excel.util.MapUtils; import lombok.Getter; import org.apache.commons.io.ByteOrderMark; /** * byte order mark * * @author Jiaju Zhuang */ @Getter public enum ByteOrderMarkEnum { /** * UTF_8 */ UTF_8(ByteOrderMark.UTF_8), /** * UTF_16BE */ UTF_16BE(ByteOrderMark.UTF_16BE), /** * UTF_16LE */ UTF_16LE(ByteOrderMark.UTF_16LE), /** * UTF_32BE */ UTF_32BE(ByteOrderMark.UTF_32BE), /** * UTF_32LE */ UTF_32LE(ByteOrderMark.UTF_32LE), ; final ByteOrderMark byteOrderMark; final String stringPrefix; ByteOrderMarkEnum(ByteOrderMark byteOrderMark) { this.byteOrderMark = byteOrderMark; Charset charset = Charset.forName(byteOrderMark.getCharsetName()); this.stringPrefix = new String(byteOrderMark.getBytes(), charset); } /** * store character aliases corresponding to `ByteOrderMark` prefix */ private static final Map<String, ByteOrderMarkEnum> CHARSET_BYTE_ORDER_MARK_MAP = MapUtils.newHashMap(); static { for (ByteOrderMarkEnum value : ByteOrderMarkEnum.values()) { CHARSET_BYTE_ORDER_MARK_MAP.put(value.getByteOrderMark().getCharsetName(), value); } } public static ByteOrderMarkEnum valueOfByCharsetName(String charsetName) { return CHARSET_BYTE_ORDER_MARK_MAP.get(charsetName); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/enums/CacheLocationEnum.java
package ai.chat2db.excel.enums; /** * cache locaciton * * @author Jiaju Zhuang **/ public enum CacheLocationEnum { /** * The cache will be stored in {@code ThreadLocal}, and will be cleared when the excel read and write is completed. */ THREAD_LOCAL, /** * The cache will not be cleared unless the app is stopped. */ MEMORY, /** * No caching.It may lose some of performance. */ NONE; }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/enums/CellDataTypeEnum.java
package ai.chat2db.excel.enums; import java.util.HashMap; import java.util.Map; import ai.chat2db.excel.util.StringUtils; /** * excel internal data type * * @author Jiaju Zhuang */ public enum CellDataTypeEnum { /** * string */ STRING, /** * This type of data does not need to be read in the 'sharedStrings.xml', it is only used for overuse, and the data * will be stored as a {@link #STRING} */ DIRECT_STRING, /** * number */ NUMBER, /** * boolean */ BOOLEAN, /** * empty */ EMPTY, /** * error */ ERROR, /** * date. Support only when writing. */ DATE, /** * rich text string.Support only when writing. */ RICH_TEXT_STRING, ; private static final Map<String, CellDataTypeEnum> TYPE_ROUTING_MAP = new HashMap<String, CellDataTypeEnum>(16); static { TYPE_ROUTING_MAP.put("s", STRING); TYPE_ROUTING_MAP.put("str", DIRECT_STRING); TYPE_ROUTING_MAP.put("inlineStr", DIRECT_STRING); TYPE_ROUTING_MAP.put("e", ERROR); TYPE_ROUTING_MAP.put("b", BOOLEAN); TYPE_ROUTING_MAP.put("n", NUMBER); } /** * Build data types * * @param cellType * @return */ public static CellDataTypeEnum buildFromCellType(String cellType) { if (StringUtils.isEmpty(cellType)) { return EMPTY; } return TYPE_ROUTING_MAP.get(cellType); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/enums/CellExtraTypeEnum.java
package ai.chat2db.excel.enums; /** * Extra data type * * @author Jiaju Zhuang **/ public enum CellExtraTypeEnum { /** * Comment */ COMMENT, /** * Hyperlink */ HYPERLINK, /** * Merge */ MERGE,; }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/enums/HeadKindEnum.java
package ai.chat2db.excel.enums; /** * The types of header * * @author Jiaju Zhuang **/ public enum HeadKindEnum { /** * none */ NONE, /** * class */ CLASS, /** * String */ STRING; }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/enums/HolderEnum.java
package ai.chat2db.excel.enums; /** * The types of holder * * @author Jiaju Zhuang **/ public enum HolderEnum { /** * workbook */ WORKBOOK, /** * sheet */ SHEET, /** * table */ TABLE, /** * row */ ROW; }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/enums/NumericCellTypeEnum.java
package ai.chat2db.excel.enums; import org.apache.poi.ss.usermodel.CellType; /** * Used to supplement {@link CellType}. * * Cannot distinguish between date and number in write case. * * @author Jiaju Zhuang */ public enum NumericCellTypeEnum { /** * number */ NUMBER, /** * date. Support only when writing. */ DATE, ; }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/enums/ReadDefaultReturnEnum.java
package ai.chat2db.excel.enums; import java.math.BigDecimal; import java.time.LocalDateTime; import ai.chat2db.excel.metadata.data.ReadCellData; /** * Read not to {@code ai.chat2db.excel.metadata.BasicParameter#clazz} value, the default will return type. * * @author Jiaju Zhuang */ public enum ReadDefaultReturnEnum { /** * default.The content of cells into string, is the same as you see in the excel. */ STRING, /** * Returns the actual type. * Will be automatically selected according to the cell contents what return type, will return the following class: * <ol> * <li>{@link BigDecimal}</li> * <li>{@link Boolean}</li> * <li>{@link String}</li> * <li>{@link LocalDateTime}</li> * </ol> */ ACTUAL_DATA, /** * Return to {@link ReadCellData}, can decide which field you need. */ READ_CELL_DATA, ; }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/enums/RowTypeEnum.java
package ai.chat2db.excel.enums; /** * The types of row * * @author Jiaju Zhuang **/ public enum RowTypeEnum { /** * data */ DATA, /** * empty */ EMPTY,; }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/enums/WriteDirectionEnum.java
package ai.chat2db.excel.enums; /** * Direction of writing * * @author Jiaju Zhuang **/ public enum WriteDirectionEnum { /** * Vertical write. */ VERTICAL, /** * Horizontal write. */ HORIZONTAL,; }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/enums/WriteLastRowTypeEnum.java
package ai.chat2db.excel.enums; /** * The types of write last row * * @author Jiaju Zhuang **/ public enum WriteLastRowTypeEnum { /** * Excel are created without templates ,And any data has been written; */ COMMON_EMPTY, /** * Excel are created with templates ,And any data has been written; */ TEMPLATE_EMPTY, /** * Any data has been written; */ HAS_DATA,; }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/enums/WriteTemplateAnalysisCellTypeEnum.java
package ai.chat2db.excel.enums; /** * Type of template to read when writing * * @author Jiaju Zhuang **/ public enum WriteTemplateAnalysisCellTypeEnum { /** * Common field. */ COMMON, /** * A collection of fields. */ COLLECTION,; }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/enums/WriteTypeEnum.java
package ai.chat2db.excel.enums; /** * Enumeration of write methods * * @author Jiaju Zhuang **/ public enum WriteTypeEnum { /** * Add. */ ADD, /** * Fill. */ FILL,; }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/enums
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/enums/poi/BorderStyleEnum.java
package ai.chat2db.excel.enums.poi; import lombok.Getter; import org.apache.poi.ss.usermodel.BorderStyle; /** * The enumeration value indicating the line style of a border in a cell, * i.e., whether it is bordered dash dot, dash dot dot, dashed, dotted, double, hair, medium, * medium dash dot, medium dash dot dot, medium dashed, none, slant dash dot, thick or thin. * * @author Jiaju Zhuang */ @Getter public enum BorderStyleEnum { /** * null */ DEFAULT(null), /** * No border (default) */ NONE(BorderStyle.NONE), /** * Thin border */ THIN(BorderStyle.THIN), /** * Medium border */ MEDIUM(BorderStyle.MEDIUM), /** * dash border */ DASHED(BorderStyle.DASHED), /** * dot border */ DOTTED(BorderStyle.DOTTED), /** * Thick border */ THICK(BorderStyle.THICK), /** * double-line border */ DOUBLE(BorderStyle.DOUBLE), /** * hair-line border */ HAIR(BorderStyle.HAIR), /** * Medium dashed border */ MEDIUM_DASHED(BorderStyle.MEDIUM_DASHED), /** * dash-dot border */ DASH_DOT(BorderStyle.DASH_DOT), /** * medium dash-dot border */ MEDIUM_DASH_DOT(BorderStyle.MEDIUM_DASH_DOT), /** * dash-dot-dot border */ DASH_DOT_DOT(BorderStyle.DASH_DOT_DOT), /** * medium dash-dot-dot border */ MEDIUM_DASH_DOT_DOT(BorderStyle.MEDIUM_DASH_DOT_DOT), /** * slanted dash-dot border */ SLANTED_DASH_DOT(BorderStyle.SLANTED_DASH_DOT); BorderStyle poiBorderStyle; BorderStyleEnum(BorderStyle poiBorderStyle) { this.poiBorderStyle = poiBorderStyle; } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/enums
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/enums/poi/FillPatternTypeEnum.java
package ai.chat2db.excel.enums.poi; import lombok.Getter; import org.apache.poi.ss.usermodel.FillPatternType; /** * The enumeration value indicating the style of fill pattern being used for a cell format. * * @author Jiaju Zhuang */ @Getter public enum FillPatternTypeEnum { /** * null */ DEFAULT(null), /** * No background */ NO_FILL(FillPatternType.NO_FILL), /** * Solidly filled */ SOLID_FOREGROUND(FillPatternType.SOLID_FOREGROUND), /** * Small fine dots */ FINE_DOTS(FillPatternType.FINE_DOTS), /** * Wide dots */ ALT_BARS(FillPatternType.ALT_BARS), /** * Sparse dots */ SPARSE_DOTS(FillPatternType.SPARSE_DOTS), /** * Thick horizontal bands */ THICK_HORZ_BANDS(FillPatternType.THICK_HORZ_BANDS), /** * Thick vertical bands */ THICK_VERT_BANDS(FillPatternType.THICK_VERT_BANDS), /** * Thick backward facing diagonals */ THICK_BACKWARD_DIAG(FillPatternType.THICK_BACKWARD_DIAG), /** * Thick forward facing diagonals */ THICK_FORWARD_DIAG(FillPatternType.THICK_FORWARD_DIAG), /** * Large spots */ BIG_SPOTS(FillPatternType.BIG_SPOTS), /** * Brick-like layout */ BRICKS(FillPatternType.BRICKS), /** * Thin horizontal bands */ THIN_HORZ_BANDS(FillPatternType.THIN_HORZ_BANDS), /** * Thin vertical bands */ THIN_VERT_BANDS(FillPatternType.THIN_VERT_BANDS), /** * Thin backward diagonal */ THIN_BACKWARD_DIAG(FillPatternType.THIN_BACKWARD_DIAG), /** * Thin forward diagonal */ THIN_FORWARD_DIAG(FillPatternType.THIN_FORWARD_DIAG), /** * Squares */ SQUARES(FillPatternType.SQUARES), /** * Diamonds */ DIAMONDS(FillPatternType.DIAMONDS), /** * Less Dots */ LESS_DOTS(FillPatternType.LESS_DOTS), /** * Least Dots */ LEAST_DOTS(FillPatternType.LEAST_DOTS); FillPatternType poiFillPatternType; FillPatternTypeEnum(FillPatternType poiFillPatternType) { this.poiFillPatternType = poiFillPatternType; } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/enums
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/enums/poi/HorizontalAlignmentEnum.java
package ai.chat2db.excel.enums.poi; import lombok.Getter; import org.apache.poi.ss.usermodel.HorizontalAlignment; /** * The enumeration value indicating horizontal alignment of a cell, * i.e., whether it is aligned general, left, right, horizontally centered, filled (replicated), * justified, centered across multiple cells, or distributed. * @author Jiaju Zhuang */ @Getter public enum HorizontalAlignmentEnum { /** * null */ DEFAULT(null), /** * The horizontal alignment is general-aligned. Text data is left-aligned. * Numbers, dates, and times are rightaligned. Boolean types are centered. * Changing the alignment does not change the type of data. */ GENERAL(HorizontalAlignment.GENERAL), /** * The horizontal alignment is left-aligned, even in Rightto-Left mode. * Aligns contents at the left edge of the cell. If an indent amount is specified, the contents of * the cell is indented from the left by the specified number of character spaces. The character spaces are * based on the default font and font size for the workbook. */ LEFT(HorizontalAlignment.LEFT), /** * The horizontal alignment is centered, meaning the text is centered across the cell. */ CENTER(HorizontalAlignment.CENTER), /** * The horizontal alignment is right-aligned, meaning that cell contents are aligned at the right edge of the cell, * even in Right-to-Left mode. */ RIGHT(HorizontalAlignment.RIGHT), /** * Indicates that the value of the cell should be filled * across the entire width of the cell. If blank cells to the right also have the fill alignment, * they are also filled with the value, using a convention similar to centerContinuous. * * Additional rules: * <ol> * <li>Only whole values can be appended, not partial values.</li> * <li>The column will not be widened to 'best fit' the filled value</li> * <li>If appending an additional occurrence of the value exceeds the boundary of the cell * left/right edge, don't append the additional occurrence of the value.</li> * <li>The display value of the cell is filled, not the underlying raw number.</li> * </ol> */ FILL(HorizontalAlignment.FILL), /** * The horizontal alignment is justified (flush left and right). * For each line of text, aligns each line of the wrapped text in a cell to the right and left * (except the last line). If no single line of text wraps in the cell, then the text is not justified. */ JUSTIFY(HorizontalAlignment.JUSTIFY), /** * The horizontal alignment is centered across multiple cells. * The information about how many cells to span is expressed in the Sheet Part, * in the row of the cell in question. For each cell that is spanned in the alignment, * a cell element needs to be written out, with the same style Id which references the centerContinuous alignment. */ CENTER_SELECTION(HorizontalAlignment.CENTER_SELECTION), /** * Indicates that each 'word' in each line of text inside the cell is evenly distributed * across the width of the cell, with flush right and left margins. * <p> * When there is also an indent value to apply, both the left and right side of the cell * are padded by the indent value. * </p> * <p> A 'word' is a set of characters with no space character in them. </p> * <p> Two lines inside a cell are separated by a carriage return. </p> */ DISTRIBUTED(HorizontalAlignment.DISTRIBUTED); HorizontalAlignment poiHorizontalAlignment; HorizontalAlignmentEnum(HorizontalAlignment poiHorizontalAlignment) { this.poiHorizontalAlignment = poiHorizontalAlignment; } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/enums
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/enums/poi/VerticalAlignmentEnum.java
package ai.chat2db.excel.enums.poi; import lombok.Getter; import org.apache.poi.ss.usermodel.VerticalAlignment; /** * This enumeration value indicates the type of vertical alignment for a cell, i.e., * whether it is aligned top, bottom, vertically centered, justified or distributed. * * <!-- FIXME: Identical to {@link org.apache.poi.ss.usermodel.VerticalAlignment}. Should merge these to * {@link org.apache.poi.common.usermodel}.VerticalAlignment in the future. --> * * @author Jiaju Zhuang */ @Getter public enum VerticalAlignmentEnum { /** * null */ DEFAULT(null), /** * The vertical alignment is aligned-to-top. */ TOP(VerticalAlignment.TOP), /** * The vertical alignment is centered across the height of the cell. */ CENTER(VerticalAlignment.CENTER), /** * The vertical alignment is aligned-to-bottom. (typically the default value) */ BOTTOM(VerticalAlignment.BOTTOM), /** * <p> * When text direction is horizontal: the vertical alignment of lines of text is distributed vertically, * where each line of text inside the cell is evenly distributed across the height of the cell, * with flush top and bottom margins. * </p> * <p> * When text direction is vertical: similar behavior as horizontal justification. * The alignment is justified (flush top and bottom in this case). For each line of text, each * line of the wrapped text in a cell is aligned to the top and bottom (except the last line). * If no single line of text wraps in the cell, then the text is not justified. * </p> */ JUSTIFY(VerticalAlignment.JUSTIFY), /** * <p> * When text direction is horizontal: the vertical alignment of lines of text is distributed vertically, * where each line of text inside the cell is evenly distributed across the height of the cell, * with flush top * </p> * <p> * When text direction is vertical: behaves exactly as distributed horizontal alignment. * The first words in a line of text (appearing at the top of the cell) are flush * with the top edge of the cell, and the last words of a line of text are flush with the bottom edge of the cell, * and the line of text is distributed evenly from top to bottom. * </p> */ DISTRIBUTED(VerticalAlignment.DISTRIBUTED); VerticalAlignment poiVerticalAlignmentEnum; VerticalAlignmentEnum(VerticalAlignment poiVerticalAlignmentEnum) { this.poiVerticalAlignmentEnum = poiVerticalAlignmentEnum; } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/event/AbstractIgnoreExceptionReadListener.java
package ai.chat2db.excel.event; import ai.chat2db.excel.context.AnalysisContext; import ai.chat2db.excel.metadata.CellExtra; import ai.chat2db.excel.read.listener.ReadListener; /** * Receives the return of each piece of data parsed * * @author jipengfei * @deprecated Use directly {@link ReadListener} */ @Deprecated public abstract class AbstractIgnoreExceptionReadListener<T> implements ReadListener<T> { /** * All listeners receive this method when any one Listener does an error report. If an exception is thrown here, the * entire read will terminate. * * @param exception * @param context */ @Override public void onException(Exception exception, AnalysisContext context) {} /** * The current method is called when extra information is returned * * @param extra extra information * @param context analysis context */ @Override public void extra(CellExtra extra, AnalysisContext context) {} @Override public boolean hasNext(AnalysisContext context) { return true; } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/event/AnalysisEventListener.java
package ai.chat2db.excel.event; import java.util.Map; import ai.chat2db.excel.context.AnalysisContext; import ai.chat2db.excel.metadata.data.ReadCellData; import ai.chat2db.excel.read.listener.ReadListener; import ai.chat2db.excel.util.ConverterUtils; /** * Receives the return of each piece of data parsed * * @author jipengfei */ public abstract class AnalysisEventListener<T> implements ReadListener<T> { @Override public void invokeHead(Map<Integer, ReadCellData<?>> headMap, AnalysisContext context) { invokeHeadMap(ConverterUtils.convertToStringMap(headMap, context), context); } /** * Returns the header as a map.Override the current method to receive header data. * * @param headMap * @param context */ public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {} }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/event/Handler.java
package ai.chat2db.excel.event; import ai.chat2db.excel.constant.OrderConstant; /** * Intercepts handle some business logic * * @author Jiaju Zhuang **/ public interface Handler extends Order { /** * handler order * * @return order */ @Override default int order() { return OrderConstant.DEFAULT_ORDER; } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/event/Listener.java
package ai.chat2db.excel.event; /** * Interface to listen for processing results * * @author Jiaju Zhuang */ public interface Listener {}
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/event/NotRepeatExecutor.java
package ai.chat2db.excel.event; /** * There are multiple interceptors that execute only one of them when fired once.If you want to control which one to * execute please use {@link Order} * * @author Jiaju Zhuang **/ public interface NotRepeatExecutor { /** * To see if it's the same executor * * @return */ String uniqueValue(); }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/event/Order.java
package ai.chat2db.excel.event; /** * Implement this interface when sorting * * @author Jiaju Zhuang */ public interface Order { /** * The smaller the first implementation * * @return */ int order(); }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/event/SyncReadListener.java
package ai.chat2db.excel.event; import java.util.ArrayList; import java.util.List; import ai.chat2db.excel.context.AnalysisContext; /** * Synchronous data reading * * @author Jiaju Zhuang */ public class SyncReadListener extends AnalysisEventListener<Object> { private List<Object> list = new ArrayList<Object>(); @Override public void invoke(Object object, AnalysisContext context) { list.add(object); } @Override public void doAfterAllAnalysed(AnalysisContext context) {} public List<Object> getList() { return list; } public void setList(List<Object> list) { this.list = list; } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/exception/ExcelAnalysisException.java
package ai.chat2db.excel.exception; /** * * @author jipengfei */ public class ExcelAnalysisException extends ExcelRuntimeException { public ExcelAnalysisException() {} public ExcelAnalysisException(String message) { super(message); } public ExcelAnalysisException(String message, Throwable cause) { super(message, cause); } public ExcelAnalysisException(Throwable cause) { super(cause); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/exception/ExcelAnalysisStopException.java
package ai.chat2db.excel.exception; /** * Throw the exception when you need to stop * This exception will stop the entire excel parsing. If you only want to stop the parsing of a certain sheet, please * use ExcelAnalysisStopSheetException. * * @author Jiaju Zhuang * @see ExcelAnalysisStopException */ public class ExcelAnalysisStopException extends ExcelAnalysisException { public ExcelAnalysisStopException() {} public ExcelAnalysisStopException(String message) { super(message); } public ExcelAnalysisStopException(String message, Throwable cause) { super(message, cause); } public ExcelAnalysisStopException(Throwable cause) { super(cause); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/exception/ExcelAnalysisStopSheetException.java
package ai.chat2db.excel.exception; /** * Throw the exception when you need to stop * This exception will only stop the parsing of the current sheet. If you want to stop the entire excel parsing, please * use ExcelAnalysisStopException. * * The ai.chat2db.excel.read.listener.ReadListener#doAfterAllAnalysed(ai.chat2db.excel.context.AnalysisContext) method * is called after the call is stopped. * * @author Jiaju Zhuang * @see ExcelAnalysisStopException * @since 3.3.4 */ public class ExcelAnalysisStopSheetException extends ExcelAnalysisException { public ExcelAnalysisStopSheetException() {} public ExcelAnalysisStopSheetException(String message) { super(message); } public ExcelAnalysisStopSheetException(String message, Throwable cause) { super(message, cause); } public ExcelAnalysisStopSheetException(Throwable cause) { super(cause); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/exception/ExcelCommonException.java
package ai.chat2db.excel.exception; /** * * @author Jiaju Zhuang */ public class ExcelCommonException extends ExcelRuntimeException { public ExcelCommonException() {} public ExcelCommonException(String message) { super(message); } public ExcelCommonException(String message, Throwable cause) { super(message, cause); } public ExcelCommonException(Throwable cause) { super(cause); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/exception/ExcelDataConvertException.java
package ai.chat2db.excel.exception; import ai.chat2db.excel.write.builder.ExcelWriterBuilder; import ai.chat2db.excel.metadata.data.CellData; import ai.chat2db.excel.metadata.property.ExcelContentProperty; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; /** * Data convert exception * * @author Jiaju Zhuang */ @Getter @Setter @EqualsAndHashCode public class ExcelDataConvertException extends ExcelRuntimeException { /** * NotNull. */ private Integer rowIndex; /** * NotNull. */ private Integer columnIndex; /** * NotNull. */ private CellData<?> cellData; /** * Nullable.Only when the header is configured and when the class header is used is not null. * * @see ExcelWriterBuilder#head(Class) */ private ExcelContentProperty excelContentProperty; public ExcelDataConvertException(Integer rowIndex, Integer columnIndex, CellData<?> cellData, ExcelContentProperty excelContentProperty, String message) { super(message); this.rowIndex = rowIndex; this.columnIndex = columnIndex; this.cellData = cellData; this.excelContentProperty = excelContentProperty; } public ExcelDataConvertException(Integer rowIndex, Integer columnIndex, CellData<?> cellData, ExcelContentProperty excelContentProperty, String message, Throwable cause) { super(message, cause); this.rowIndex = rowIndex; this.columnIndex = columnIndex; this.cellData = cellData; this.excelContentProperty = excelContentProperty; } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/exception/ExcelGenerateException.java
package ai.chat2db.excel.exception; /** * @author jipengfei */ public class ExcelGenerateException extends ExcelRuntimeException { public ExcelGenerateException(String message) { super(message); } public ExcelGenerateException(String message, Throwable cause) { super(message, cause); } public ExcelGenerateException(Throwable cause) { super(cause); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/exception/ExcelRuntimeException.java
package ai.chat2db.excel.exception; /** * Excel Exception * @author Jiaju Zhuang */ public class ExcelRuntimeException extends RuntimeException { public ExcelRuntimeException() {} public ExcelRuntimeException(String message) { super(message); } public ExcelRuntimeException(String message, Throwable cause) { super(message, cause); } public ExcelRuntimeException(Throwable cause) { super(cause); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/exception/ExcelWriteDataConvertException.java
package ai.chat2db.excel.exception; import ai.chat2db.excel.write.handler.context.CellWriteHandlerContext; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; /** * Data convert exception * * @author Jiaju Zhuang */ @Getter @Setter @EqualsAndHashCode public class ExcelWriteDataConvertException extends ExcelDataConvertException { /** * handler. */ private CellWriteHandlerContext cellWriteHandlerContext; public ExcelWriteDataConvertException(CellWriteHandlerContext cellWriteHandlerContext, String message) { super(cellWriteHandlerContext.getRowIndex(), cellWriteHandlerContext.getColumnIndex(), cellWriteHandlerContext.getFirstCellData(), cellWriteHandlerContext.getExcelContentProperty(), message); this.cellWriteHandlerContext = cellWriteHandlerContext; } public ExcelWriteDataConvertException(CellWriteHandlerContext cellWriteHandlerContext, String message, Throwable cause) { super(cellWriteHandlerContext.getRowIndex(), cellWriteHandlerContext.getColumnIndex(), cellWriteHandlerContext.getFirstCellData(), cellWriteHandlerContext.getExcelContentProperty(), message, cause); this.cellWriteHandlerContext = cellWriteHandlerContext; } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata/AbstractCell.java
package ai.chat2db.excel.metadata; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; /** * cell * * @author Jiaju Zhuang **/ @Getter @Setter @EqualsAndHashCode public class AbstractCell implements Cell { /** * Row index */ private Integer rowIndex; /** * Column index */ private Integer columnIndex; }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata/AbstractHolder.java
package ai.chat2db.excel.metadata; import java.util.List; import java.util.Map; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.converters.ConverterKeyBuild; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; /** * Write/read holder * * @author Jiaju Zhuang */ @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<ConverterKeyBuild.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()); } if (basicParameter.getFiledCacheLocation() == null) { if (prentAbstractHolder != null) { globalConfiguration.setFiledCacheLocation( prentAbstractHolder.getGlobalConfiguration().getFiledCacheLocation()); } } else { globalConfiguration.setFiledCacheLocation(basicParameter.getFiledCacheLocation()); } } @Override public Map<ConverterKeyBuild.ConverterKey, Converter<?>> converterMap() { return getConverterMap(); } @Override public GlobalConfiguration globalConfiguration() { return getGlobalConfiguration(); } @Override public boolean isNew() { return getNewInitialization(); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata/AbstractParameterBuilder.java
package ai.chat2db.excel.metadata; import java.util.List; import java.util.Locale; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.enums.CacheLocationEnum; import ai.chat2db.excel.util.ListUtils; /** * ExcelBuilder * * @author Jiaju Zhuang */ public abstract class AbstractParameterBuilder<T extends AbstractParameterBuilder, C extends BasicParameter> { /** * You can only choose one of the {@link #head(List)} and {@link #head(Class)} * * @param head * @return */ public T head(List<List<String>> head) { parameter().setHead(head); return self(); } /** * You can only choose one of the {@link #head(List)} and {@link #head(Class)} * * @param clazz * @return */ public T head(Class<?> clazz) { parameter().setClazz(clazz); return self(); } /** * Custom type conversions override the default. * * @param converter * @return */ public T registerConverter(Converter<?> converter) { if (parameter().getCustomConverterList() == null) { parameter().setCustomConverterList(ListUtils.newArrayList()); } parameter().getCustomConverterList().add(converter); return self(); } /** * true if date uses 1904 windowing, or false if using 1900 date windowing. * * default is false * * @param use1904windowing * @return */ public T use1904windowing(Boolean use1904windowing) { parameter().setUse1904windowing(use1904windowing); return self(); } /** * A <code>Locale</code> object represents a specific geographical, political, or cultural region. This parameter is * used when formatting dates and numbers. * * @param locale * @return */ public T locale(Locale locale) { parameter().setLocale(locale); return self(); } /** * The cache used when parsing fields such as head. * * default is THREAD_LOCAL. * * @since 3.3.0 */ public T filedCacheLocation(CacheLocationEnum filedCacheLocation) { parameter().setFiledCacheLocation(filedCacheLocation); return self(); } /** * Automatic trim includes sheet name and content * * @param autoTrim * @return */ public T autoTrim(Boolean autoTrim) { parameter().setAutoTrim(autoTrim); return self(); } @SuppressWarnings("unchecked") protected T self() { return (T)this; } /** * Get parameter * * @return */ protected abstract C parameter(); }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata/BasicParameter.java
package ai.chat2db.excel.metadata; import java.util.List; import java.util.Locale; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.enums.CacheLocationEnum; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; /** * Basic parameter * * @author Jiaju Zhuang **/ @Getter @Setter @EqualsAndHashCode public class BasicParameter { /** * You can only choose one of the {@link BasicParameter#head} and {@link BasicParameter#clazz} */ private List<List<String>> head; /** * You can only choose one of the {@link BasicParameter#head} and {@link BasicParameter#clazz} */ private Class<?> clazz; /** * Custom type conversions override the default */ private List<Converter<?>> customConverterList; /** * Automatic trim includes sheet name and content */ private Boolean autoTrim; /** * true if date uses 1904 windowing, or false if using 1900 date windowing. * * default is false * * @return */ private Boolean use1904windowing; /** * A <code>Locale</code> object represents a specific geographical, political, or cultural region. This parameter is * used when formatting dates and numbers. */ private Locale locale; /** * Whether to use scientific Format. * * default is false */ private Boolean useScientificFormat; /** * The cache used when parsing fields such as head. * * default is THREAD_LOCAL. */ private CacheLocationEnum filedCacheLocation; }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata/Cell.java
package ai.chat2db.excel.metadata; /** * Cell * * @author Jiaju Zhuang **/ public interface Cell { /** * Row index * * @return */ Integer getRowIndex(); /** * Column index * * @return */ Integer getColumnIndex(); }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata/CellExtra.java
package ai.chat2db.excel.metadata; import ai.chat2db.excel.enums.CellExtraTypeEnum; import org.apache.poi.ss.util.CellReference; import ai.chat2db.excel.constant.ExcelXmlConstants; /** * Cell extra information. * * @author Jiaju Zhuang */ public class CellExtra extends AbstractCell { /** * Cell extra type */ private CellExtraTypeEnum type; /** * Cell extra data */ private String text; /** * First row index, if this object is an interval */ private Integer firstRowIndex; /** * Last row index, if this object is an interval */ private Integer lastRowIndex; /** * First column index, if this object is an interval */ private Integer firstColumnIndex; /** * Last column index, if this object is an interval */ private Integer lastColumnIndex; public CellExtra(CellExtraTypeEnum type, String text, String range) { super(); this.type = type; this.text = text; String[] ranges = range.split(ExcelXmlConstants.CELL_RANGE_SPLIT); CellReference first = new CellReference(ranges[0]); CellReference last = first; this.firstRowIndex = first.getRow(); this.firstColumnIndex = (int)first.getCol(); setRowIndex(this.firstRowIndex); setColumnIndex(this.firstColumnIndex); if (ranges.length > 1) { last = new CellReference(ranges[1]); } this.lastRowIndex = last.getRow(); this.lastColumnIndex = (int)last.getCol(); } public CellExtra(CellExtraTypeEnum type, String text, Integer rowIndex, Integer columnIndex) { this(type, text, rowIndex, rowIndex, columnIndex, columnIndex); } public CellExtra(CellExtraTypeEnum type, String text, Integer firstRowIndex, Integer lastRowIndex, Integer firstColumnIndex, Integer lastColumnIndex) { super(); setRowIndex(firstRowIndex); setColumnIndex(firstColumnIndex); this.type = type; this.text = text; this.firstRowIndex = firstRowIndex; this.firstColumnIndex = firstColumnIndex; this.lastRowIndex = lastRowIndex; this.lastColumnIndex = lastColumnIndex; } public CellExtraTypeEnum getType() { return type; } public void setType(CellExtraTypeEnum type) { this.type = type; } public String getText() { return text; } public void setText(String text) { this.text = text; } public Integer getFirstRowIndex() { return firstRowIndex; } public void setFirstRowIndex(Integer firstRowIndex) { this.firstRowIndex = firstRowIndex; } public Integer getFirstColumnIndex() { return firstColumnIndex; } public void setFirstColumnIndex(Integer firstColumnIndex) { this.firstColumnIndex = firstColumnIndex; } public Integer getLastRowIndex() { return lastRowIndex; } public void setLastRowIndex(Integer lastRowIndex) { this.lastRowIndex = lastRowIndex; } public Integer getLastColumnIndex() { return lastColumnIndex; } public void setLastColumnIndex(Integer lastColumnIndex) { this.lastColumnIndex = lastColumnIndex; } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata/CellRange.java
package ai.chat2db.excel.metadata; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; /** * @author jipengfei */ @Getter @Setter @EqualsAndHashCode public class CellRange { private int firstRow; private int lastRow; private int firstCol; private int lastCol; public CellRange(int firstRow, int lastRow, int firstCol, int lastCol) { this.firstRow = firstRow; this.lastRow = lastRow; this.firstCol = firstCol; this.lastCol = lastCol; } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata/ConfigurationHolder.java
package ai.chat2db.excel.metadata; import java.util.Map; import ai.chat2db.excel.converters.Converter; import ai.chat2db.excel.converters.ConverterKeyBuild; /** * Get the corresponding holder * * @author Jiaju Zhuang **/ public interface ConfigurationHolder extends Holder { /** * Record whether it's new or from cache * * @return Record whether it's new or from cache */ boolean isNew(); /** * Some global variables * * @return Global configuration */ GlobalConfiguration globalConfiguration(); /** * What converter does the currently operated cell need to execute * * @return Converter */ Map<ConverterKeyBuild.ConverterKey, Converter<?>> converterMap(); }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata/FieldCache.java
package ai.chat2db.excel.metadata; import java.util.Map; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; /** * filed cache * * @author Jiaju Zhuang */ @Getter @Setter @EqualsAndHashCode @AllArgsConstructor public class FieldCache { /** * A field cache that has been sorted by a class. * It will exclude fields that are not needed. */ private Map<Integer, FieldWrapper> sortedFieldMap; /** * Fields using the index attribute */ private Map<Integer, FieldWrapper> indexFieldMap; }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata/FieldWrapper.java
package ai.chat2db.excel.metadata; import java.lang.reflect.Field; import ai.chat2db.excel.annotation.ExcelProperty; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; /** * filed wrapper * * @author Jiaju Zhuang */ @Getter @Setter @EqualsAndHashCode @AllArgsConstructor @NoArgsConstructor public class FieldWrapper { /** * field */ private Field field; /** * The field name matching cglib */ private String fieldName; /** * The name of the sheet header. * * @see ExcelProperty */ private String[] heads; }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata/Font.java
package ai.chat2db.excel.metadata; import ai.chat2db.excel.write.metadata.style.WriteFont; /** * * @author jipengfei * @deprecated please use {@link WriteFont} */ @Deprecated public class Font { /** */ private String fontName; /** */ private short fontHeightInPoints; /** */ private boolean bold; public String getFontName() { return fontName; } public void setFontName(String fontName) { this.fontName = fontName; } public short getFontHeightInPoints() { return fontHeightInPoints; } public void setFontHeightInPoints(short fontHeightInPoints) { this.fontHeightInPoints = fontHeightInPoints; } public boolean isBold() { return bold; } public void setBold(boolean bold) { this.bold = bold; } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata/GlobalConfiguration.java
package ai.chat2db.excel.metadata; import java.util.Locale; import ai.chat2db.excel.enums.CacheLocationEnum; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; /** * Global configuration * * @author Jiaju Zhuang */ @Getter @Setter @EqualsAndHashCode public class GlobalConfiguration { /** * Automatic trim includes sheet name and content */ private Boolean autoTrim; /** * true if date uses 1904 windowing, or false if using 1900 date windowing. * * default is false * * @return */ private Boolean use1904windowing; /** * A <code>Locale</code> object represents a specific geographical, political, or cultural region. This parameter is * used when formatting dates and numbers. */ private Locale locale; /** * Whether to use scientific Format. * * default is false */ private Boolean useScientificFormat; /** * The cache used when parsing fields such as head. * * default is THREAD_LOCAL. */ private CacheLocationEnum filedCacheLocation; public GlobalConfiguration() { this.autoTrim = Boolean.TRUE; this.use1904windowing = Boolean.FALSE; this.locale = Locale.getDefault(); this.useScientificFormat = Boolean.FALSE; this.filedCacheLocation = CacheLocationEnum.THREAD_LOCAL; } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata/Head.java
package ai.chat2db.excel.metadata; import java.lang.reflect.Field; import java.util.ArrayList; import java.util.List; import ai.chat2db.excel.exception.ExcelGenerateException; import ai.chat2db.excel.metadata.property.ColumnWidthProperty; import ai.chat2db.excel.metadata.property.FontProperty; import ai.chat2db.excel.metadata.property.LoopMergeProperty; import ai.chat2db.excel.metadata.property.StyleProperty; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; /** * excel head * * @author Jiaju Zhuang **/ @Getter @Setter @EqualsAndHashCode public class Head { /** * Column index of head */ private Integer columnIndex; /** * It only has values when passed in {@link Sheet#setClazz(Class)} and {@link Table#setClazz(Class)} */ private Field field; /** * It only has values when passed in {@link Sheet#setClazz(Class)} and {@link Table#setClazz(Class)} */ private String fieldName; /** * Head name */ private List<String> headNameList; /** * Whether index is specified */ private Boolean forceIndex; /** * Whether to specify a name */ private Boolean forceName; /** * column with */ private ColumnWidthProperty columnWidthProperty; /** * Loop merge */ private LoopMergeProperty loopMergeProperty; /** * Head style */ private StyleProperty headStyleProperty; /** * Head font */ private FontProperty headFontProperty; public Head(Integer columnIndex, Field field, String fieldName, List<String> headNameList, Boolean forceIndex, Boolean forceName) { this.columnIndex = columnIndex; this.field = field; this.fieldName = fieldName; if (headNameList == null) { this.headNameList = new ArrayList<>(); } else { this.headNameList = headNameList; for (String headName : headNameList) { if (headName == null) { throw new ExcelGenerateException("head name can not be null."); } } } this.forceIndex = forceIndex; this.forceName = forceName; } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata/Holder.java
package ai.chat2db.excel.metadata; import ai.chat2db.excel.enums.HolderEnum; /** * * Get the corresponding holder * * @author Jiaju Zhuang **/ public interface Holder { /** * What holder is the return * * @return Holder enum. */ HolderEnum holderType(); }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata/NullObject.java
package ai.chat2db.excel.metadata; /** * Null object. * * @author Jiaju Zhuang */ public class NullObject { }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata/csv/CsvCell.java
package ai.chat2db.excel.metadata.csv; import java.math.BigDecimal; import java.time.LocalDateTime; import java.time.ZoneId; import java.util.Calendar; import java.util.Date; import ai.chat2db.excel.enums.NumericCellTypeEnum; import ai.chat2db.excel.metadata.data.FormulaData; import lombok.AccessLevel; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; import org.apache.poi.ss.SpreadsheetVersion; import org.apache.poi.ss.usermodel.CellBase; import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.CellType; import org.apache.poi.ss.usermodel.Comment; import org.apache.poi.ss.usermodel.Hyperlink; import org.apache.poi.ss.usermodel.RichTextString; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.util.CellRangeAddress; /** * csv cell * * @author Jiaju Zhuang */ @Getter @Setter @EqualsAndHashCode public class CsvCell extends CellBase { /** * column index */ @Getter(value = AccessLevel.NONE) @Setter(value = AccessLevel.NONE) private Integer columnIndex; /** * cell type */ @Getter(value = AccessLevel.NONE) @Setter(value = AccessLevel.NONE) private CellType cellType; /** * numeric cell type */ private NumericCellTypeEnum numericCellType; /** * workbook */ private final CsvWorkbook csvWorkbook; /** * sheet */ private final CsvSheet csvSheet; /** * row */ private final CsvRow csvRow; /** * {@link CellType#NUMERIC} */ private BigDecimal numberValue; /** * {@link CellType#STRING} and {@link CellType#ERROR} {@link CellType#FORMULA} */ private String stringValue; /** * {@link CellType#BOOLEAN} */ private Boolean booleanValue; /** * {@link CellType#NUMERIC} */ private LocalDateTime dateValue; /** * formula */ private FormulaData formulaData; /** * rich text string */ private RichTextString richTextString; /** * style */ private CellStyle cellStyle; public CsvCell(CsvWorkbook csvWorkbook, CsvSheet csvSheet, CsvRow csvRow, Integer columnIndex, CellType cellType) { this.csvWorkbook = csvWorkbook; this.csvSheet = csvSheet; this.csvRow = csvRow; this.columnIndex = columnIndex; this.cellType = cellType; if (this.cellType == null) { this.cellType = CellType._NONE; } } @Override protected void setCellTypeImpl(CellType cellType) { this.cellType = cellType; } @Override protected void setCellFormulaImpl(String formula) { FormulaData formulaData = new FormulaData(); formulaData.setFormulaValue(formula); this.formulaData = formulaData; this.cellType = CellType.FORMULA; } @Override protected void removeFormulaImpl() { this.formulaData = null; } @Override protected void setCellValueImpl(double value) { numberValue = BigDecimal.valueOf(value); this.cellType = CellType.NUMERIC; } @Override protected void setCellValueImpl(Date value) { if (value == null) { return; } this.dateValue = LocalDateTime.ofInstant(value.toInstant(), ZoneId.systemDefault()); this.cellType = CellType.NUMERIC; this.numericCellType = NumericCellTypeEnum.DATE; } @Override protected void setCellValueImpl(LocalDateTime value) { this.dateValue = value; this.cellType = CellType.NUMERIC; this.numericCellType = NumericCellTypeEnum.DATE; } @Override protected void setCellValueImpl(Calendar value) { if (value == null) { return; } this.dateValue = LocalDateTime.ofInstant(value.toInstant(), ZoneId.systemDefault()); this.cellType = CellType.NUMERIC; } @Override protected void setCellValueImpl(String value) { this.stringValue = value; this.cellType = CellType.STRING; } @Override protected void setCellValueImpl(RichTextString value) { richTextString = value; this.cellType = CellType.STRING; } @Override public void setCellValue(String value) { if (value == null) { setBlank(); return; } setCellValueImpl(value); } @Override public void setCellValue(RichTextString value) { if (value == null || value.getString() == null) { setBlank(); return; } setCellValueImpl(value); } @Override protected SpreadsheetVersion getSpreadsheetVersion() { return null; } @Override public int getColumnIndex() { return columnIndex; } @Override public int getRowIndex() { return csvRow.getRowNum(); } @Override public Sheet getSheet() { return csvRow.getSheet(); } @Override public Row getRow() { return csvRow; } @Override public CellType getCellType() { return cellType; } @Override public CellType getCachedFormulaResultType() { return getCellType(); } @Override public String getCellFormula() { if (formulaData == null) { return null; } return formulaData.getFormulaValue(); } @Override public double getNumericCellValue() { if (numberValue == null) { return 0; } return numberValue.doubleValue(); } @Override public Date getDateCellValue() { if (dateValue == null) { return null; } return Date.from(dateValue.atZone(ZoneId.systemDefault()).toInstant()); } @Override public LocalDateTime getLocalDateTimeCellValue() { return dateValue; } @Override public RichTextString getRichStringCellValue() { return richTextString; } @Override public String getStringCellValue() { return stringValue; } @Override public void setCellValue(boolean value) { this.booleanValue = value; this.cellType = CellType.BOOLEAN; } @Override public void setCellErrorValue(byte value) { this.numberValue = BigDecimal.valueOf(value); this.cellType = CellType.ERROR; } @Override public boolean getBooleanCellValue() { if (booleanValue == null) { return false; } return booleanValue; } @Override public byte getErrorCellValue() { if (numberValue == null) { return 0; } return numberValue.byteValue(); } @Override public void setCellStyle(CellStyle style) { this.cellStyle = style; } @Override public CellStyle getCellStyle() { return cellStyle; } @Override public void setAsActiveCell() { } @Override public void setCellComment(Comment comment) { } @Override public Comment getCellComment() { return null; } @Override public void removeCellComment() { } @Override public Hyperlink getHyperlink() { return null; } @Override public void setHyperlink(Hyperlink link) { } @Override public void removeHyperlink() { } @Override public CellRangeAddress getArrayFormulaRange() { return null; } @Override public boolean isPartOfArrayFormulaGroup() { return false; } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata/csv/CsvCellStyle.java
package ai.chat2db.excel.metadata.csv; import ai.chat2db.excel.metadata.data.DataFormatData; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; import org.apache.poi.ss.usermodel.BorderStyle; import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.Color; import org.apache.poi.ss.usermodel.FillPatternType; import org.apache.poi.ss.usermodel.Font; import org.apache.poi.ss.usermodel.HorizontalAlignment; import org.apache.poi.ss.usermodel.VerticalAlignment; /** * csv cell style * * @author Jiaju Zhuang */ @Getter @Setter @EqualsAndHashCode public class CsvCellStyle implements CellStyle { /** * data format */ private DataFormatData dataFormatData; /** * index */ private Short index; public CsvCellStyle(Short index) { this.index = index; } @Override public short getIndex() { return index; } @Override public void setDataFormat(short fmt) { initDataFormatData(); dataFormatData.setIndex(fmt); } private void initDataFormatData() { if (dataFormatData == null) { dataFormatData = new DataFormatData(); } } @Override public short getDataFormat() { if (dataFormatData == null) { return 0; } return dataFormatData.getIndex(); } @Override public String getDataFormatString() { if (dataFormatData == null) { return null; } return dataFormatData.getFormat(); } @Override public void setFont(Font font) { } @Override public int getFontIndex() { return 0; } @Override public int getFontIndexAsInt() { return 0; } @Override public void setHidden(boolean hidden) { } @Override public boolean getHidden() { return false; } @Override public void setLocked(boolean locked) { } @Override public boolean getLocked() { return false; } @Override public void setQuotePrefixed(boolean quotePrefix) { } @Override public boolean getQuotePrefixed() { return false; } @Override public void setAlignment(HorizontalAlignment align) { } @Override public HorizontalAlignment getAlignment() { return null; } @Override public void setWrapText(boolean wrapped) { } @Override public boolean getWrapText() { return false; } @Override public void setVerticalAlignment(VerticalAlignment align) { } @Override public VerticalAlignment getVerticalAlignment() { return null; } @Override public void setRotation(short rotation) { } @Override public short getRotation() { return 0; } @Override public void setIndention(short indent) { } @Override public short getIndention() { return 0; } @Override public void setBorderLeft(BorderStyle border) { } @Override public BorderStyle getBorderLeft() { return null; } @Override public void setBorderRight(BorderStyle border) { } @Override public BorderStyle getBorderRight() { return null; } @Override public void setBorderTop(BorderStyle border) { } @Override public BorderStyle getBorderTop() { return null; } @Override public void setBorderBottom(BorderStyle border) { } @Override public BorderStyle getBorderBottom() { return null; } @Override public void setLeftBorderColor(short color) { } @Override public short getLeftBorderColor() { return 0; } @Override public void setRightBorderColor(short color) { } @Override public short getRightBorderColor() { return 0; } @Override public void setTopBorderColor(short color) { } @Override public short getTopBorderColor() { return 0; } @Override public void setBottomBorderColor(short color) { } @Override public short getBottomBorderColor() { return 0; } @Override public void setFillPattern(FillPatternType fp) { } @Override public FillPatternType getFillPattern() { return null; } @Override public void setFillBackgroundColor(short bg) { } @Override public void setFillBackgroundColor(Color color) { } @Override public short getFillBackgroundColor() { return 0; } @Override public Color getFillBackgroundColorColor() { return null; } @Override public void setFillForegroundColor(short bg) { } @Override public void setFillForegroundColor(Color color) { } @Override public short getFillForegroundColor() { return 0; } @Override public Color getFillForegroundColorColor() { return null; } @Override public void cloneStyleFrom(CellStyle source) { } @Override public void setShrinkToFit(boolean shrinkToFit) { } @Override public boolean getShrinkToFit() { return false; } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata/csv/CsvDataFormat.java
package ai.chat2db.excel.metadata.csv; import java.util.List; import java.util.Locale; import java.util.Map; import ai.chat2db.excel.util.ListUtils; import ai.chat2db.excel.util.MapUtils; import ai.chat2db.excel.constant.BuiltinFormats; import org.apache.poi.ss.usermodel.DataFormat; /** * format data * * @author Jiaju Zhuang */ public class CsvDataFormat implements DataFormat { /** * It is stored in both map and list for easy retrieval */ private final Map<String, Short> formatMap; private final List<String> formatList; /** * Excel's built-in format conversion. */ private final Map<String, Short> builtinFormatsMap; private final String[] builtinFormats; public CsvDataFormat(Locale locale) { formatMap = MapUtils.newHashMap(); formatList = ListUtils.newArrayList(); builtinFormatsMap = BuiltinFormats.switchBuiltinFormatsMap(locale); builtinFormats = BuiltinFormats.switchBuiltinFormats(locale); } @Override public short getFormat(String format) { Short index = builtinFormatsMap.get(format); if (index != null) { return index; } index = formatMap.get(format); if (index != null) { return index; } short indexPrimitive = (short)(formatList.size() + BuiltinFormats.MIN_CUSTOM_DATA_FORMAT_INDEX); index = indexPrimitive; formatList.add(format); formatMap.put(format, index); return indexPrimitive; } @Override public String getFormat(short index) { if (index < BuiltinFormats.MIN_CUSTOM_DATA_FORMAT_INDEX) { return builtinFormats[index]; } int actualIndex = index - BuiltinFormats.MIN_CUSTOM_DATA_FORMAT_INDEX; if (actualIndex < formatList.size()) { return formatList.get(actualIndex); } return null; } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata/csv/CsvRichTextString.java
package ai.chat2db.excel.metadata.csv; import org.apache.poi.ss.usermodel.Font; import org.apache.poi.ss.usermodel.RichTextString; /** * rich text string * * @author Jiaju Zhuang */ public class CsvRichTextString implements RichTextString { /** * string */ private final String string; public CsvRichTextString(String string) { this.string = string; } @Override public void applyFont(int startIndex, int endIndex, short fontIndex) { } @Override public void applyFont(int startIndex, int endIndex, Font font) { } @Override public void applyFont(Font font) { } @Override public void clearFormatting() { } @Override public String getString() { return string; } @Override public int length() { if (string == null) { return 0; } return string.length(); } @Override public int numFormattingRuns() { return 0; } @Override public int getIndexOfFormattingRun(int index) { return 0; } @Override public void applyFont(short fontIndex) { } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata/csv/CsvRow.java
package ai.chat2db.excel.metadata.csv; import java.util.Iterator; import java.util.List; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.compress.utils.Lists; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.CellType; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; /** * csv row * * @author Jiaju Zhuang */ @Getter @Setter @EqualsAndHashCode public class CsvRow implements Row { /** * cell list */ private final List<CsvCell> cellList; /** * workbook */ private final CsvWorkbook csvWorkbook; /** * sheet */ private final CsvSheet csvSheet; /** * row index */ private Integer rowIndex; /** * style */ private CellStyle cellStyle; public CsvRow(CsvWorkbook csvWorkbook, CsvSheet csvSheet, Integer rowIndex) { cellList = Lists.newArrayList(); this.csvWorkbook = csvWorkbook; this.csvSheet = csvSheet; this.rowIndex = rowIndex; } @Override public Cell createCell(int column) { CsvCell cell = new CsvCell(csvWorkbook, csvSheet, this, column, null); cellList.add(cell); return cell; } @Override public Cell createCell(int column, CellType type) { CsvCell cell = new CsvCell(csvWorkbook, csvSheet, this, column, type); cellList.add(cell); return cell; } @Override public void removeCell(Cell cell) { cellList.remove(cell); } @Override public void setRowNum(int rowNum) { this.rowIndex = rowNum; } @Override public int getRowNum() { return rowIndex; } @Override public Cell getCell(int cellnum) { if (cellnum >= cellList.size()) { return null; } return cellList.get(cellnum - 1); } @Override public Cell getCell(int cellnum, MissingCellPolicy policy) { return getCell(cellnum); } @Override public short getFirstCellNum() { if (CollectionUtils.isEmpty(cellList)) { return -1; } return 0; } @Override public short getLastCellNum() { if (CollectionUtils.isEmpty(cellList)) { return -1; } return (short)cellList.size(); } @Override public int getPhysicalNumberOfCells() { return getRowNum(); } @Override public void setHeight(short height) { } @Override public void setZeroHeight(boolean zHeight) { } @Override public boolean getZeroHeight() { return false; } @Override public void setHeightInPoints(float height) { } @Override public short getHeight() { return 0; } @Override public float getHeightInPoints() { return 0; } @Override public boolean isFormatted() { return false; } @Override public CellStyle getRowStyle() { return cellStyle; } @Override public void setRowStyle(CellStyle style) { this.cellStyle = style; } @Override public Iterator<Cell> cellIterator() { return (Iterator<Cell>)(Iterator<? extends Cell>)cellList.iterator(); } @Override public Sheet getSheet() { return csvSheet; } @Override public int getOutlineLevel() { return 0; } @Override public void shiftCellsRight(int firstShiftColumnIndex, int lastShiftColumnIndex, int step) { } @Override public void shiftCellsLeft(int firstShiftColumnIndex, int lastShiftColumnIndex, int step) { } @Override public Iterator<Cell> iterator() { return cellIterator(); } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata/csv/CsvSheet.java
package ai.chat2db.excel.metadata.csv; import java.io.Closeable; import java.io.IOException; import java.math.BigDecimal; import java.util.Collection; import java.util.Iterator; import java.util.List; import java.util.Map; import ai.chat2db.excel.enums.ByteOrderMarkEnum; import ai.chat2db.excel.enums.NumericCellTypeEnum; import ai.chat2db.excel.exception.ExcelGenerateException; import ai.chat2db.excel.util.DateUtils; import ai.chat2db.excel.util.ListUtils; import ai.chat2db.excel.util.NumberDataFormatterUtils; import ai.chat2db.excel.util.StringUtils; import ai.chat2db.excel.constant.BuiltinFormats; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; import org.apache.commons.csv.CSVFormat; import org.apache.commons.csv.CSVPrinter; import org.apache.poi.ss.usermodel.AutoFilter; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.CellRange; import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.Comment; import org.apache.poi.ss.usermodel.DataValidation; import org.apache.poi.ss.usermodel.DataValidationHelper; import org.apache.poi.ss.usermodel.DateUtil; import org.apache.poi.ss.usermodel.Drawing; import org.apache.poi.ss.usermodel.Footer; import org.apache.poi.ss.usermodel.Header; import org.apache.poi.ss.usermodel.Hyperlink; import org.apache.poi.ss.usermodel.PageMargin; import org.apache.poi.ss.usermodel.PaneType; import org.apache.poi.ss.usermodel.PrintSetup; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.SheetConditionalFormatting; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.util.CellAddress; import org.apache.poi.ss.util.CellRangeAddress; import org.apache.poi.ss.util.PaneInformation; /** * csv sheet * * @author Jiaju Zhuang */ @Getter @Setter @EqualsAndHashCode public class CsvSheet implements Sheet, Closeable { /** * workbook */ private CsvWorkbook csvWorkbook; /** * output */ private Appendable out; /** * row cache */ private Integer rowCacheCount; /** * format */ public CSVFormat csvFormat; /** * last row index */ private Integer lastRowIndex; /** * row cache */ private List<CsvRow> rowCache; /** * csv printer */ private CSVPrinter csvPrinter; public CsvSheet(CsvWorkbook csvWorkbook, Appendable out) { this.csvWorkbook = csvWorkbook; this.out = out; this.rowCacheCount = 100; this.csvFormat = CSVFormat.DEFAULT; this.lastRowIndex = -1; } @Override public Row createRow(int rownum) { // Initialize the data when the row is first created initSheet(); lastRowIndex++; assert rownum == lastRowIndex : "csv create row must be in order."; printData(); CsvRow csvRow = new CsvRow(csvWorkbook, this, rownum); rowCache.add(csvRow); return csvRow; } private void initSheet() { if (csvPrinter != null) { return; } rowCache = ListUtils.newArrayListWithExpectedSize(rowCacheCount); try { if (csvWorkbook.getWithBom()) { ByteOrderMarkEnum byteOrderMark = ByteOrderMarkEnum.valueOfByCharsetName( csvWorkbook.getCharset().name()); if (byteOrderMark != null) { out.append(byteOrderMark.getStringPrefix()); } } csvPrinter = csvFormat.print(out); } catch (IOException e) { throw new ExcelGenerateException(e); } } @Override public void removeRow(Row row) { throw new UnsupportedOperationException("csv cannot move row."); } @Override public Row getRow(int rownum) { int actualRowIndex = rownum - (lastRowIndex - rowCache.size()) - 1; if (actualRowIndex < 0 || actualRowIndex > rowCache.size() - 1) { throw new UnsupportedOperationException("The current data does not exist or has been flushed to disk\n."); } return rowCache.get(actualRowIndex); } @Override public int getPhysicalNumberOfRows() { return lastRowIndex - rowCache.size(); } @Override public int getFirstRowNum() { if (lastRowIndex < 0) { return -1; } return 0; } @Override public int getLastRowNum() { return lastRowIndex; } @Override public void setColumnHidden(int columnIndex, boolean hidden) { } @Override public boolean isColumnHidden(int columnIndex) { return false; } @Override public void setRightToLeft(boolean value) { } @Override public boolean isRightToLeft() { return false; } @Override public void setColumnWidth(int columnIndex, int width) { } @Override public int getColumnWidth(int columnIndex) { return 0; } @Override public float getColumnWidthInPixels(int columnIndex) { return 0; } @Override public void setDefaultColumnWidth(int width) { } @Override public int getDefaultColumnWidth() { return 0; } @Override public short getDefaultRowHeight() { return 0; } @Override public float getDefaultRowHeightInPoints() { return 0; } @Override public void setDefaultRowHeight(short height) { } @Override public void setDefaultRowHeightInPoints(float height) { } @Override public CellStyle getColumnStyle(int column) { return null; } @Override public int addMergedRegion(CellRangeAddress region) { return 0; } @Override public int addMergedRegionUnsafe(CellRangeAddress region) { return 0; } @Override public void validateMergedRegions() { } @Override public void setVerticallyCenter(boolean value) { } @Override public void setHorizontallyCenter(boolean value) { } @Override public boolean getHorizontallyCenter() { return false; } @Override public boolean getVerticallyCenter() { return false; } @Override public void removeMergedRegion(int index) { } @Override public void removeMergedRegions(Collection<Integer> indices) { } @Override public int getNumMergedRegions() { return 0; } @Override public CellRangeAddress getMergedRegion(int index) { return null; } @Override public List<CellRangeAddress> getMergedRegions() { return null; } @Override public Iterator<Row> rowIterator() { return (Iterator<Row>)(Iterator<? extends Row>)rowCache.iterator(); } @Override public void setForceFormulaRecalculation(boolean value) { } @Override public boolean getForceFormulaRecalculation() { return false; } @Override public void setAutobreaks(boolean value) { } @Override public void setDisplayGuts(boolean value) { } @Override public void setDisplayZeros(boolean value) { } @Override public boolean isDisplayZeros() { return false; } @Override public void setFitToPage(boolean value) { } @Override public void setRowSumsBelow(boolean value) { } @Override public void setRowSumsRight(boolean value) { } @Override public boolean getAutobreaks() { return false; } @Override public boolean getDisplayGuts() { return false; } @Override public boolean getFitToPage() { return false; } @Override public boolean getRowSumsBelow() { return false; } @Override public boolean getRowSumsRight() { return false; } @Override public boolean isPrintGridlines() { return false; } @Override public void setPrintGridlines(boolean show) { } @Override public boolean isPrintRowAndColumnHeadings() { return false; } @Override public void setPrintRowAndColumnHeadings(boolean show) { } @Override public PrintSetup getPrintSetup() { return null; } @Override public Header getHeader() { return null; } @Override public Footer getFooter() { return null; } @Override public void setSelected(boolean value) { } @Override public double getMargin(short margin) { return 0; } @Override public double getMargin(PageMargin pageMargin) { return 0; } @Override public void setMargin(short margin, double size) { } @Override public void setMargin(PageMargin pageMargin, double v) { } @Override public boolean getProtect() { return false; } @Override public void protectSheet(String password) { } @Override public boolean getScenarioProtect() { return false; } @Override public void setZoom(int scale) { } @Override public short getTopRow() { return 0; } @Override public short getLeftCol() { return 0; } @Override public void showInPane(int topRow, int leftCol) { } @Override public void shiftRows(int startRow, int endRow, int n) { } @Override public void shiftRows(int startRow, int endRow, int n, boolean copyRowHeight, boolean resetOriginalRowHeight) { } @Override public void shiftColumns(int startColumn, int endColumn, int n) { } @Override public void createFreezePane(int colSplit, int rowSplit, int leftmostColumn, int topRow) { } @Override public void createFreezePane(int colSplit, int rowSplit) { } @Override public void createSplitPane(int xSplitPos, int ySplitPos, int leftmostColumn, int topRow, int activePane) { } @Override public void createSplitPane(int i, int i1, int i2, int i3, PaneType paneType) { } @Override public PaneInformation getPaneInformation() { return null; } @Override public void setDisplayGridlines(boolean show) { } @Override public boolean isDisplayGridlines() { return false; } @Override public void setDisplayFormulas(boolean show) { } @Override public boolean isDisplayFormulas() { return false; } @Override public void setDisplayRowColHeadings(boolean show) { } @Override public boolean isDisplayRowColHeadings() { return false; } @Override public void setRowBreak(int row) { } @Override public boolean isRowBroken(int row) { return false; } @Override public void removeRowBreak(int row) { } @Override public int[] getRowBreaks() { return new int[0]; } @Override public int[] getColumnBreaks() { return new int[0]; } @Override public void setColumnBreak(int column) { } @Override public boolean isColumnBroken(int column) { return false; } @Override public void removeColumnBreak(int column) { } @Override public void setColumnGroupCollapsed(int columnNumber, boolean collapsed) { } @Override public void groupColumn(int fromColumn, int toColumn) { } @Override public void ungroupColumn(int fromColumn, int toColumn) { } @Override public void groupRow(int fromRow, int toRow) { } @Override public void ungroupRow(int fromRow, int toRow) { } @Override public void setRowGroupCollapsed(int row, boolean collapse) { } @Override public void setDefaultColumnStyle(int column, CellStyle style) { } @Override public void autoSizeColumn(int column) { } @Override public void autoSizeColumn(int column, boolean useMergedCells) { } @Override public Comment getCellComment(CellAddress ref) { return null; } @Override public Map<CellAddress, ? extends Comment> getCellComments() { return null; } @Override public Drawing<?> getDrawingPatriarch() { return null; } @Override public Drawing<?> createDrawingPatriarch() { return null; } @Override public Workbook getWorkbook() { return csvWorkbook; } @Override public String getSheetName() { return null; } @Override public boolean isSelected() { return false; } @Override public CellRange<? extends Cell> setArrayFormula( String formula, CellRangeAddress range) { return null; } @Override public CellRange<? extends Cell> removeArrayFormula(Cell cell) { return null; } @Override public DataValidationHelper getDataValidationHelper() { return null; } @Override public List<? extends DataValidation> getDataValidations() { return null; } @Override public void addValidationData(DataValidation dataValidation) { } @Override public AutoFilter setAutoFilter(CellRangeAddress range) { return null; } @Override public SheetConditionalFormatting getSheetConditionalFormatting() { return null; } @Override public CellRangeAddress getRepeatingRows() { return null; } @Override public CellRangeAddress getRepeatingColumns() { return null; } @Override public void setRepeatingRows(CellRangeAddress rowRangeRef) { } @Override public void setRepeatingColumns(CellRangeAddress columnRangeRef) { } @Override public int getColumnOutlineLevel(int columnIndex) { return 0; } @Override public Hyperlink getHyperlink(int row, int column) { return null; } @Override public Hyperlink getHyperlink(CellAddress addr) { return null; } @Override public List<? extends Hyperlink> getHyperlinkList() { return null; } @Override public CellAddress getActiveCell() { return null; } @Override public void setActiveCell(CellAddress address) { } @Override public Iterator<Row> iterator() { return rowIterator(); } @Override public void close() throws IOException { // Avoid empty sheets initSheet(); flushData(); csvPrinter.flush(); csvPrinter.close(); } public void printData() { if (rowCache.size() >= rowCacheCount) { flushData(); } } public void flushData() { try { for (CsvRow row : rowCache) { Iterator<Cell> cellIterator = row.cellIterator(); int columnIndex = 0; while (cellIterator.hasNext()) { CsvCell csvCell = (CsvCell)cellIterator.next(); while (csvCell.getColumnIndex() > columnIndex++) { csvPrinter.print(null); } csvPrinter.print(buildCellValue(csvCell)); } csvPrinter.println(); } rowCache.clear(); } catch (IOException e) { throw new ExcelGenerateException(e); } } private String buildCellValue(CsvCell csvCell) { switch (csvCell.getCellType()) { case STRING: case ERROR: return csvCell.getStringCellValue(); case NUMERIC: Short dataFormat = null; String dataFormatString = null; if (csvCell.getCellStyle() != null) { dataFormat = csvCell.getCellStyle().getDataFormat(); dataFormatString = csvCell.getCellStyle().getDataFormatString(); } if (csvCell.getNumericCellType() == NumericCellTypeEnum.DATE) { if (csvCell.getDateValue() == null) { return null; } // date if (dataFormat == null) { dataFormatString = DateUtils.defaultDateFormat; dataFormat = csvWorkbook.createDataFormat().getFormat(dataFormatString); } if (dataFormatString == null) { dataFormatString = csvWorkbook.createDataFormat().getFormat(dataFormat); } return NumberDataFormatterUtils.format(BigDecimal.valueOf( DateUtil.getExcelDate(csvCell.getDateValue(), csvWorkbook.getUse1904windowing())), dataFormat, dataFormatString, csvWorkbook.getUse1904windowing(), csvWorkbook.getLocale(), csvWorkbook.getUseScientificFormat()); } else { if (csvCell.getNumberValue() == null) { return null; } //number if (dataFormat == null) { dataFormat = BuiltinFormats.GENERAL; dataFormatString = csvWorkbook.createDataFormat().getFormat(dataFormat); } if (dataFormatString == null) { dataFormatString = csvWorkbook.createDataFormat().getFormat(dataFormat); } return NumberDataFormatterUtils.format(csvCell.getNumberValue(), dataFormat, dataFormatString, csvWorkbook.getUse1904windowing(), csvWorkbook.getLocale(), csvWorkbook.getUseScientificFormat()); } case BOOLEAN: return csvCell.getBooleanValue().toString(); case BLANK: return StringUtils.EMPTY; default: return null; } } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata/csv/CsvWorkbook.java
package ai.chat2db.excel.metadata.csv; import java.io.IOException; import java.io.OutputStream; import java.nio.charset.Charset; import java.util.Iterator; import java.util.List; import java.util.Locale; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; import org.apache.commons.compress.utils.Lists; import org.apache.poi.ss.SpreadsheetVersion; import org.apache.poi.ss.formula.EvaluationWorkbook; import org.apache.poi.ss.formula.udf.UDFFinder; import org.apache.poi.ss.usermodel.CellReferenceType; import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.CreationHelper; import org.apache.poi.ss.usermodel.DataFormat; import org.apache.poi.ss.usermodel.Font; import org.apache.poi.ss.usermodel.Name; import org.apache.poi.ss.usermodel.PictureData; import org.apache.poi.ss.usermodel.Row.MissingCellPolicy; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.SheetVisibility; import org.apache.poi.ss.usermodel.Workbook; /** * csv workbook * * @author Jiaju Zhuang */ @Getter @Setter @EqualsAndHashCode public class CsvWorkbook implements Workbook { /** * output */ private Appendable out; /** * true if date uses 1904 windowing, or false if using 1900 date windowing. * <p> * default is false * */ private Boolean use1904windowing; /** * locale */ private Locale locale; /** * Whether to use scientific Format. * <p> * default is false */ private Boolean useScientificFormat; /** * data format */ private CsvDataFormat csvDataFormat; /** * sheet */ private CsvSheet csvSheet; /** * cell style */ private List<CsvCellStyle> csvCellStyleList; /** * charset. */ private Charset charset; /** * Set the encoding prefix in the csv file, otherwise the office may open garbled characters. * Default true. */ private Boolean withBom; public CsvWorkbook(Appendable out, Locale locale, Boolean use1904windowing, Boolean useScientificFormat, Charset charset, Boolean withBom) { this.out = out; this.locale = locale; this.use1904windowing = use1904windowing; this.useScientificFormat = useScientificFormat; this.charset = charset; this.withBom = withBom; } @Override public int getActiveSheetIndex() { return 0; } @Override public void setActiveSheet(int sheetIndex) { } @Override public int getFirstVisibleTab() { return 0; } @Override public void setFirstVisibleTab(int sheetIndex) { } @Override public void setSheetOrder(String sheetname, int pos) { } @Override public void setSelectedTab(int index) { } @Override public void setSheetName(int sheet, String name) { } @Override public String getSheetName(int sheet) { return null; } @Override public int getSheetIndex(String name) { return 0; } @Override public int getSheetIndex(Sheet sheet) { return 0; } @Override public Sheet createSheet() { assert csvSheet == null : "CSV repeat creation is not allowed."; csvSheet = new CsvSheet(this, out); return csvSheet; } @Override public Sheet createSheet(String sheetname) { assert csvSheet == null : "CSV repeat creation is not allowed."; csvSheet = new CsvSheet(this, out); return csvSheet; } @Override public Sheet cloneSheet(int sheetNum) { return null; } @Override public Iterator<Sheet> sheetIterator() { return null; } @Override public int getNumberOfSheets() { return 0; } @Override public Sheet getSheetAt(int index) { assert index == 0 : "CSV exists only in one sheet."; return csvSheet; } @Override public Sheet getSheet(String name) { return csvSheet; } @Override public void removeSheetAt(int index) { } @Override public Font createFont() { return null; } @Override public Font findFont(boolean bold, short color, short fontHeight, String name, boolean italic, boolean strikeout, short typeOffset, byte underline) { return null; } @Override public int getNumberOfFonts() { return 0; } @Override public int getNumberOfFontsAsInt() { return 0; } @Override public Font getFontAt(int idx) { return null; } @Override public CellStyle createCellStyle() { if (csvCellStyleList == null) { csvCellStyleList = Lists.newArrayList(); } CsvCellStyle csvCellStyle = new CsvCellStyle((short)csvCellStyleList.size()); csvCellStyleList.add(csvCellStyle); return csvCellStyle; } @Override public int getNumCellStyles() { return csvCellStyleList.size(); } @Override public CellStyle getCellStyleAt(int idx) { if (idx < 0 || idx >= csvCellStyleList.size()) { return null; } return csvCellStyleList.get(idx); } @Override public void write(OutputStream stream) throws IOException { csvSheet.close(); } @Override public void close() throws IOException { } @Override public int getNumberOfNames() { return 0; } @Override public Name getName(String name) { return null; } @Override public List<? extends Name> getNames(String name) { return null; } @Override public List<? extends Name> getAllNames() { return null; } @Override public Name createName() { return null; } @Override public void removeName(Name name) { } @Override public int linkExternalWorkbook(String name, Workbook workbook) { return 0; } @Override public void setPrintArea(int sheetIndex, String reference) { } @Override public void setPrintArea(int sheetIndex, int startColumn, int endColumn, int startRow, int endRow) { } @Override public String getPrintArea(int sheetIndex) { return null; } @Override public void removePrintArea(int sheetIndex) { } @Override public MissingCellPolicy getMissingCellPolicy() { return null; } @Override public void setMissingCellPolicy(MissingCellPolicy missingCellPolicy) { } @Override public DataFormat createDataFormat() { if (csvDataFormat != null) { return csvDataFormat; } csvDataFormat = new CsvDataFormat(locale); return csvDataFormat; } @Override public int addPicture(byte[] pictureData, int format) { return 0; } @Override public List<? extends PictureData> getAllPictures() { return null; } @Override public CreationHelper getCreationHelper() { return null; } @Override public boolean isHidden() { return false; } @Override public void setHidden(boolean hiddenFlag) { } @Override public boolean isSheetHidden(int sheetIx) { return false; } @Override public boolean isSheetVeryHidden(int sheetIx) { return false; } @Override public void setSheetHidden(int sheetIx, boolean hidden) { } @Override public SheetVisibility getSheetVisibility(int sheetIx) { return null; } @Override public void setSheetVisibility(int sheetIx, SheetVisibility visibility) { } @Override public void addToolPack(UDFFinder toopack) { } @Override public void setForceFormulaRecalculation(boolean value) { } @Override public boolean getForceFormulaRecalculation() { return false; } @Override public SpreadsheetVersion getSpreadsheetVersion() { return null; } @Override public int addOlePackage(byte[] oleData, String label, String fileName, String command) { return 0; } @Override public EvaluationWorkbook createEvaluationWorkbook() { return null; } @Override public CellReferenceType getCellReferenceType() { return null; } @Override public void setCellReferenceType(CellReferenceType cellReferenceType) { } @Override public Iterator<Sheet> iterator() { return null; } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata/data/CellData.java
package ai.chat2db.excel.metadata.data; import java.math.BigDecimal; import ai.chat2db.excel.enums.CellDataTypeEnum; import ai.chat2db.excel.metadata.AbstractCell; import ai.chat2db.excel.util.StringUtils; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; /** * Excel internal cell data. * * <p> * * @author Jiaju Zhuang */ @Getter @Setter @EqualsAndHashCode public class CellData<T> extends AbstractCell { /** * cell type */ private CellDataTypeEnum type; /** * {@link CellDataTypeEnum#NUMBER} */ private BigDecimal numberValue; /** * {@link CellDataTypeEnum#STRING} and{@link CellDataTypeEnum#ERROR} */ private String stringValue; /** * {@link CellDataTypeEnum#BOOLEAN} */ private Boolean booleanValue; /** * The resulting converted data. */ private T data; /** * formula */ private FormulaData formulaData; /** * Ensure that the object does not appear null */ public void checkEmpty() { if (type == null) { type = CellDataTypeEnum.EMPTY; } switch (type) { case STRING: case DIRECT_STRING: case ERROR: if (StringUtils.isEmpty(stringValue)) { type = CellDataTypeEnum.EMPTY; } return; case NUMBER: if (numberValue == null) { type = CellDataTypeEnum.EMPTY; } return; case BOOLEAN: if (booleanValue == null) { type = CellDataTypeEnum.EMPTY; } return; default: } } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata/data/ClientAnchorData.java
package ai.chat2db.excel.metadata.data; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; import org.apache.poi.ss.usermodel.ClientAnchor; import org.apache.poi.util.Internal; /** * A client anchor is attached to an excel worksheet. It anchors against * absolute coordinates, a top-left cell and fixed height and width, or * a top-left and bottom-right cell, depending on the {@link ClientAnchorData.AnchorType}: * <ol> * <li> {@link ClientAnchor.AnchorType#DONT_MOVE_AND_RESIZE} == absolute top-left coordinates and width/height, no * cell references * <li> {@link ClientAnchor.AnchorType#MOVE_DONT_RESIZE} == fixed top-left cell reference, absolute width/height * <li> {@link ClientAnchor.AnchorType#MOVE_AND_RESIZE} == fixed top-left and bottom-right cell references, dynamic * width/height * </ol> * Note this class only reports the current values for possibly calculated positions and sizes. * If the sheet row/column sizes or positions shift, this needs updating via external calculations. * * @author Jiaju Zhuang */ @Getter @Setter @EqualsAndHashCode public class ClientAnchorData extends CoordinateData { /** * top */ private Integer top; /** * right */ private Integer right; /** * bottom */ private Integer bottom; /** * left */ private Integer left; /** * anchor type */ private AnchorType anchorType; @Getter public enum AnchorType { /** * Move and Resize With Anchor Cells (0) * <p> * Specifies that the current drawing shall move and * resize to maintain its row and column anchors (i.e. the * object is anchored to the actual from and to row and column) * </p> */ MOVE_AND_RESIZE(ClientAnchor.AnchorType.MOVE_AND_RESIZE), /** * Don't Move but do Resize With Anchor Cells (1) * <p> * Specifies that the current drawing shall not move with its * row and column, but should be resized. This option is not normally * used, but is included for completeness. * </p> * Note: Excel has no setting for this combination, nor does the ECMA standard. */ DONT_MOVE_DO_RESIZE(ClientAnchor.AnchorType.DONT_MOVE_DO_RESIZE), /** * Move With Cells but Do Not Resize (2) * <p> * Specifies that the current drawing shall move with its * row and column (i.e. the object is anchored to the * actual from row and column), but that the size shall remain absolute. * </p> * <p> * If additional rows/columns are added between the from and to locations of the drawing, * the drawing shall move its to anchors as needed to maintain this same absolute size. * </p> */ MOVE_DONT_RESIZE(ClientAnchor.AnchorType.MOVE_DONT_RESIZE), /** * Do Not Move or Resize With Underlying Rows/Columns (3) * <p> * Specifies that the current start and end positions shall * be maintained with respect to the distances from the * absolute start point of the worksheet. * </p> * <p> * If additional rows/columns are added before the * drawing, the drawing shall move its anchors as needed * to maintain this same absolute position. * </p> */ DONT_MOVE_AND_RESIZE(ClientAnchor.AnchorType.DONT_MOVE_AND_RESIZE); ClientAnchor.AnchorType value; AnchorType(ClientAnchor.AnchorType value) { this.value = value; } /** * return the AnchorType corresponding to the code * * @param value the anchor type code * @return the anchor type enum */ @Internal public static ClientAnchorData.AnchorType byId(int value) { return values()[value]; } } }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata/data/CommentData.java
package ai.chat2db.excel.metadata.data; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; /** * comment * * @author Jiaju Zhuang */ @Getter @Setter @EqualsAndHashCode public class CommentData extends ClientAnchorData { /** * Name of the original comment author */ private String author; /** * rich text string */ private RichTextStringData richTextStringData; }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata/data/CoordinateData.java
package ai.chat2db.excel.metadata.data; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; /** * coordinate. * * @author Jiaju Zhuang */ @Getter @Setter @EqualsAndHashCode public class CoordinateData { /** * first row index.Priority is higher than {@link #relativeFirstRowIndex}. */ private Integer firstRowIndex; /** * first column index.Priority is higher than {@link #relativeFirstColumnIndex}. */ private Integer firstColumnIndex; /** * last row index.Priority is higher than {@link #relativeLastRowIndex}. */ private Integer lastRowIndex; /** * last column index.Priority is higher than {@link #relativeLastColumnIndex}. */ private Integer lastColumnIndex; /** * relative first row index */ private Integer relativeFirstRowIndex; /** * relative first column index */ private Integer relativeFirstColumnIndex; /** * relative last row index */ private Integer relativeLastRowIndex; /** *relative last column index */ private Integer relativeLastColumnIndex; }
0
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata
java-sources/ai/chat2db/excel/easyexcel-plus-core/0.0.1/ai/chat2db/excel/metadata/data/DataFormatData.java
package ai.chat2db.excel.metadata.data; import ai.chat2db.excel.util.StringUtils; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; /** * data format * * @author Jiaju Zhuang */ @Getter @Setter @EqualsAndHashCode public class DataFormatData { /** * index */ private Short index; /** * format */ private String format; /** * The source is not empty merge the data to the target. * * @param source source * @param target target */ public static void merge(DataFormatData source, DataFormatData target) { if (source == null || target == null) { return; } if (source.getIndex() != null) { target.setIndex(source.getIndex()); } if (StringUtils.isNotBlank(source.getFormat())) { target.setFormat(source.getFormat()); } } @Override public DataFormatData clone() { DataFormatData dataFormatData = new DataFormatData(); dataFormatData.setIndex(getIndex()); dataFormatData.setFormat(getFormat()); return dataFormatData; } }