Class ExcelCellMapping

java.lang.Object
icu.easyj.poi.excel.model.ExcelCellMapping
All Implemented Interfaces:
Serializable

public class ExcelCellMapping extends Object implements Serializable
model中的属性和excel表格中的列的映射关系
Author:
wangliang181230
See Also:
  • Constructor Details

    • ExcelCellMapping

      public ExcelCellMapping()
  • Method Details

    • getField

      public Field getField()
    • setField

      public void setField(Field field)
    • getColumn

      public String getColumn()
    • setColumn

      public void setColumn(String column)
    • getAnno

      public ExcelCell getAnno()
    • setAnno

      public void setAnno(ExcelCell anno)
    • getHeadName

      public String getHeadName()
    • setHeadName

      public void setHeadName(String headName)
    • getHeadComment

      public String getHeadComment()
    • setHeadComment

      public void setHeadComment(String headComment)
    • getCellNum

      public int getCellNum()
    • setCellNum

      public void setCellNum(int cellNum)
    • getWidth

      public int getWidth()
    • setWidth

      public void setWidth(int width)
    • isWrapText

      public boolean isWrapText()
    • setWrapText

      public void setWrapText(boolean wrapText)
    • isHidden

      public boolean isHidden()
    • setHidden

      public void setHidden(boolean hidden)
    • getColor

      public String getColor()
    • setColor

      public void setColor(String color)
    • getColorIndex

      public short getColorIndex()
    • setColorIndex

      public void setColorIndex(short colorIndex)
    • getBackgroundColor

      public String getBackgroundColor()
    • setBackgroundColor

      public void setBackgroundColor(String backgroundColor)
    • getBackgroundColorIndex

      public short getBackgroundColorIndex()
    • setBackgroundColorIndex

      public void setBackgroundColorIndex(short backgroundColorIndex)
    • getFormat

      public String getFormat()
    • setFormat

      public void setFormat(String format)
    • getAlign

      public String getAlign()
    • setAlign

      public void setAlign(String align)
    • getVerAlign

      public String getVerAlign()
    • setVerAlign

      public void setVerAlign(String verAlign)
    • getTrueText

      public String getTrueText()
    • setTrueText

      public void setTrueText(String trueText)
    • getFalseText

      public String getFalseText()
    • setFalseText

      public void setFalseText(String falseText)
    • getConvertMap

      public Map<String,String> getConvertMap()
    • setConvertMap

      public void setConvertMap(Map<String,String> convertMap)
    • getConvertMap2

      public Map<String,String> getConvertMap2()
    • setConvertMap2

      public void setConvertMap2(Map<String,String> convertMap2)
    • getCellMappingList

      public static List<ExcelCellMapping> getCellMappingList(Class<?> clazz, ExcelMapping mapping)
      获取属性与表格的映射关系
      Parameters:
      clazz - the clazz
      mapping - excel表映射
      Returns:
      cellMappingList excel列映射列表
    • toMapping

      public static ExcelCellMapping toMapping(ExcelCell anno, Class<?> clazz, Field f, ExcelMapping mapping)
      注解转换为映射类对象
      Parameters:
      anno - 列注解
      clazz - 数据类型
      f - 字段
      mapping - 表映射
      Returns:
      列映射
    • getCellWidthByText

      public static int getCellWidthByText(String text, int size, boolean isBold)
      根据文本获取列宽 中文算两个长度
      Parameters:
      text - 文本内容
      size - 字体大小
      isBold - 是否为粗体
      Returns:
      列宽
    • getColorIndex

      public static short getColorIndex(String color)
      获取颜色的数字值,即颜色值从16进制转换为10进制后的值
      Parameters:
      color - 颜色
      Returns:
      colorIndex 颜色index值