Package icu.easyj.poi.excel.model
Class ExcelCellMapping
java.lang.Object
icu.easyj.poi.excel.model.ExcelCellMapping
- All Implemented Interfaces:
Serializable
model中的属性和excel表格中的列的映射关系
- Author:
- wangliang181230
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAlign()getAnno()shortstatic List<ExcelCellMapping>getCellMappingList(Class<?> clazz, ExcelMapping mapping) 获取属性与表格的映射关系intstatic intgetCellWidthByText(String text, int size, boolean isBold) 根据文本获取列宽 中文算两个长度getColor()shortstatic shortgetColorIndex(String color) 获取颜色的数字值,即颜色值从16进制转换为10进制后的值getField()intgetWidth()booleanisHidden()booleanvoidvoidvoidsetBackgroundColor(String backgroundColor) voidsetBackgroundColorIndex(short backgroundColorIndex) voidsetCellNum(int cellNum) voidvoidsetColorIndex(short colorIndex) voidvoidsetConvertMap(Map<String, String> convertMap) voidsetConvertMap2(Map<String, String> convertMap2) voidsetFalseText(String falseText) voidvoidvoidsetHeadComment(String headComment) voidsetHeadName(String headName) voidsetHidden(boolean hidden) voidsetTrueText(String trueText) voidsetVerAlign(String verAlign) voidsetWidth(int width) voidsetWrapText(boolean wrapText) static ExcelCellMappingtoMapping(ExcelCell anno, Class<?> clazz, Field f, ExcelMapping mapping) 注解转换为映射类对象
-
Constructor Details
-
ExcelCellMapping
public ExcelCellMapping()
-
-
Method Details
-
getField
-
setField
-
getColumn
-
setColumn
-
getAnno
-
setAnno
-
getHeadName
-
setHeadName
-
getHeadComment
-
setHeadComment
-
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
-
setColor
-
getColorIndex
public short getColorIndex() -
setColorIndex
public void setColorIndex(short colorIndex) -
getBackgroundColor
-
setBackgroundColor
-
getBackgroundColorIndex
public short getBackgroundColorIndex() -
setBackgroundColorIndex
public void setBackgroundColorIndex(short backgroundColorIndex) -
getFormat
-
setFormat
-
getAlign
-
setAlign
-
getVerAlign
-
setVerAlign
-
getTrueText
-
setTrueText
-
getFalseText
-
setFalseText
-
getConvertMap
-
setConvertMap
-
getConvertMap2
-
setConvertMap2
-
getCellMappingList
获取属性与表格的映射关系- Parameters:
clazz- the clazzmapping- excel表映射- Returns:
- cellMappingList excel列映射列表
-
toMapping
public static ExcelCellMapping toMapping(ExcelCell anno, Class<?> clazz, Field f, ExcelMapping mapping) 注解转换为映射类对象- Parameters:
anno- 列注解clazz- 数据类型f- 字段mapping- 表映射- Returns:
- 列映射
-
getCellWidthByText
根据文本获取列宽 中文算两个长度- Parameters:
text- 文本内容size- 字体大小isBold- 是否为粗体- Returns:
- 列宽
-
getColorIndex
获取颜色的数字值,即颜色值从16进制转换为10进制后的值- Parameters:
color- 颜色- Returns:
- colorIndex 颜色index值
-