All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.kovizone.poi.ooxml.plus.processor.ExcelColumnProcessors Maven / Gradle / Ivy

The newest version!
package com.kovizone.poi.ooxml.plus.processor;


import com.kovizone.poi.ooxml.plus.api.anno.ExcelColumn;
import com.kovizone.poi.ooxml.plus.api.processor.WriteProcessor;
import com.kovizone.poi.ooxml.plus.command.ExcelCommand;
import com.kovizone.poi.ooxml.plus.util.StringUtils;

import java.lang.reflect.Field;

/**
 * 

{@link ExcelColumn}注解的处理器

* * @author KoviChen */ public class ExcelColumnProcessors implements WriteProcessor { /** * 数据标题行 */ public static final String DATA_TITLE_CELL_STYLE_NAME = "DATA_TITLE_CELL_STYLE_NAME"; /** * 数据体行 */ public static final String DATA_BODY_CELL_STYLE_NAME = "DATA_BODY_CELL_STYLE_NAME"; @Override public void dataTitleProcess(ExcelColumn excelColumn, ExcelCommand excelCommand, Field targetField) { String dateTitle = excelColumn.value(); if (!StringUtils.isEmpty(dateTitle)) { excelCommand.setCellValue(dateTitle); } int cellWidth = excelColumn.width(); excelCommand.setCellWidth(cellWidth); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy