use of com.alibaba.excel.converters.string.StringStringConverter in project easyexcel by alibaba.
the class DefaultConverterLoader method initDefaultWriteConverter.
private static void initDefaultWriteConverter() {
defaultWriteConverter = MapUtils.newHashMapWithExpectedSize(40);
putWriteConverter(new BigDecimalNumberConverter());
putWriteConverter(new BigIntegerNumberConverter());
putWriteConverter(new BooleanBooleanConverter());
putWriteConverter(new ByteNumberConverter());
putWriteConverter(new DateDateConverter());
putWriteConverter(new LocalDateTimeDateConverter());
putWriteConverter(new DoubleNumberConverter());
putWriteConverter(new FloatNumberConverter());
putWriteConverter(new IntegerNumberConverter());
putWriteConverter(new LongNumberConverter());
putWriteConverter(new ShortNumberConverter());
putWriteConverter(new StringStringConverter());
putWriteConverter(new FileImageConverter());
putWriteConverter(new InputStreamImageConverter());
putWriteConverter(new ByteArrayImageConverter());
putWriteConverter(new BoxingByteArrayImageConverter());
putWriteConverter(new UrlImageConverter());
// In some cases, it must be converted to string
putWriteStringConverter(new BigDecimalStringConverter());
putWriteStringConverter(new BigIntegerStringConverter());
putWriteStringConverter(new BooleanStringConverter());
putWriteStringConverter(new ByteStringConverter());
putWriteStringConverter(new DateStringConverter());
putWriteStringConverter(new LocalDateTimeStringConverter());
putWriteStringConverter(new DoubleStringConverter());
putWriteStringConverter(new FloatStringConverter());
putWriteStringConverter(new IntegerStringConverter());
putWriteStringConverter(new LongStringConverter());
putWriteStringConverter(new ShortStringConverter());
putWriteStringConverter(new StringStringConverter());
putWriteStringConverter(new BigIntegerStringConverter());
}
use of com.alibaba.excel.converters.string.StringStringConverter in project easyexcel by alibaba.
the class DefaultConverterLoader method initAllConverter.
private static void initAllConverter() {
allConverter = MapUtils.newHashMapWithExpectedSize(40);
putAllConverter(new BigDecimalBooleanConverter());
putAllConverter(new BigDecimalNumberConverter());
putAllConverter(new BigDecimalStringConverter());
putAllConverter(new BigIntegerBooleanConverter());
putAllConverter(new BigIntegerNumberConverter());
putAllConverter(new BigIntegerStringConverter());
putAllConverter(new BooleanBooleanConverter());
putAllConverter(new BooleanNumberConverter());
putAllConverter(new BooleanStringConverter());
putAllConverter(new ByteBooleanConverter());
putAllConverter(new ByteNumberConverter());
putAllConverter(new ByteStringConverter());
putAllConverter(new DateNumberConverter());
putAllConverter(new DateStringConverter());
putAllConverter(new LocalDateNumberConverter());
putAllConverter(new LocalDateTimeStringConverter());
putAllConverter(new DoubleBooleanConverter());
putAllConverter(new DoubleNumberConverter());
putAllConverter(new DoubleStringConverter());
putAllConverter(new FloatBooleanConverter());
putAllConverter(new FloatNumberConverter());
putAllConverter(new FloatStringConverter());
putAllConverter(new IntegerBooleanConverter());
putAllConverter(new IntegerNumberConverter());
putAllConverter(new IntegerStringConverter());
putAllConverter(new LongBooleanConverter());
putAllConverter(new LongNumberConverter());
putAllConverter(new LongStringConverter());
putAllConverter(new ShortBooleanConverter());
putAllConverter(new ShortNumberConverter());
putAllConverter(new ShortStringConverter());
putAllConverter(new StringBooleanConverter());
putAllConverter(new StringNumberConverter());
putAllConverter(new StringStringConverter());
putAllConverter(new StringErrorConverter());
putAllConverter(new BigIntegerStringConverter());
}
use of com.alibaba.excel.converters.string.StringStringConverter in project easyexcel by alibaba.
the class ParameterDataTest method readAndWrite7.
private void readAndWrite7(File file, ExcelTypeEnum type) {
EasyExcel.write(file, ParameterData.class).registerConverter(new StringStringConverter()).sheet().registerConverter(new StringStringConverter()).needHead(Boolean.FALSE).table(0).needHead(Boolean.TRUE).doWrite(data());
EasyExcel.read(file.getPath()).head(ParameterData.class).registerReadListener(new ParameterDataListener()).sheet().registerConverter(new StringStringConverter()).doRead();
}
use of com.alibaba.excel.converters.string.StringStringConverter in project easyexcel by alibaba.
the class ParameterDataTest method readAndWrite6.
private void readAndWrite6(File file, ExcelTypeEnum type) throws Exception {
ExcelWriter excelWriter = EasyExcel.write(new FileOutputStream(file)).excelType(type).head(ParameterData.class).relativeHeadRowIndex(0).build();
WriteSheet writeSheet = EasyExcel.writerSheet(0).relativeHeadRowIndex(0).needHead(Boolean.FALSE).build();
WriteTable writeTable = EasyExcel.writerTable(0).registerConverter(new StringStringConverter()).relativeHeadRowIndex(0).needHead(Boolean.TRUE).build();
excelWriter.write(data(), writeSheet, writeTable);
excelWriter.finish();
ExcelReader excelReader = EasyExcel.read(file.getPath(), new ParameterDataListener()).head(ParameterData.class).mandatoryUseInputStream(Boolean.FALSE).autoCloseStream(Boolean.TRUE).readCache(new MapCache()).build();
ReadSheet readSheet = EasyExcel.readSheet("0").head(ParameterData.class).use1904windowing(Boolean.FALSE).headRowNumber(1).sheetNo(0).build();
excelReader.read(readSheet);
excelReader.finish();
excelReader = EasyExcel.read(file.getPath(), new ParameterDataListener()).head(ParameterData.class).mandatoryUseInputStream(Boolean.FALSE).autoCloseStream(Boolean.TRUE).readCache(new MapCache()).build();
excelReader.read();
excelReader.finish();
}
Aggregations