You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

119 lines
2.5 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package com.wb.excel.api;
import com.wb.excel.api.converter.Converter;
import com.wb.excel.api.util.StringUtil;
import java.io.Serializable;
import java.lang.reflect.Field;
/**
* DataTable中的表头包含本列的一些限制条件。<br/>
* 现有:列名、是否必须、是否允许重复、说明字段以及数据类型
* Created by edward on 9/19/14.
*/
public class WColumn implements Serializable {
/**
* 列名
*/
private String name;
/**
* 该列的最大宽度
*/
private int cellWidth;
/**
* 是否为隐藏列如果为隐藏列在导出Excel文件时会被忽略
*/
private boolean isHidden;
/**
* 是否是必输列
*/
private boolean isRequired;
/**
* 该列的描述字段
*/
private String description;
/**
* 列转换器
*/
private Converter converter;
private Field field;
public WColumn() {
this.name = "";
this.cellWidth = 1;
this.isHidden = false;
this.isRequired = false;
this.description = "";
}
public WColumn(String name) {
this.name = name;
this.cellWidth = 1;
this.isHidden = false;
this.isRequired = false;
this.description = "";
}
//----------- getter & setter --------------
public String getName() {
return name;
}
public void setName(String name) {
if (StringUtil.getByteLength(name) > cellWidth) {
cellWidth = StringUtil.getByteLength(name);
}
this.name = name;
}
public Field getField() {
return field;
}
public void setField(Field field) {
this.field = field;
}
public int getCellWidth() {
return cellWidth;
}
public void setCellWidth(int cellWidth) {
this.cellWidth = cellWidth;
}
public boolean isHidden() {
return isHidden;
}
public void setHidden(boolean isHidden) {
this.isHidden = isHidden;
}
public boolean isRequired() {
return isRequired;
}
public void setRequired(boolean isRequired) {
this.isRequired = isRequired;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Converter getConverter() {
return converter;
}
public void setConverter(Converter converter) {
this.converter = converter;
}
}

Powered by TurnKey Linux.