package foundation.io.object;
|
|
import foundation.util.Util;
|
|
public class Header {
|
|
private String title;
|
private int index;
|
private String fieldName;
|
private String format;
|
|
public Header(int index, String title, String fieldName) {
|
this.title = title;
|
this.index = index;
|
parseFieldName(fieldName);
|
}
|
|
private String parseFieldName(String value) {
|
if (Util.isEmpty(value)) {
|
return null;
|
}
|
|
value = value.trim();
|
|
if (!value.startsWith("{")) {
|
return null;
|
}
|
|
int fieldEndPos = value.indexOf("}");
|
this.fieldName = value.substring(1, fieldEndPos);
|
this.format = value.substring(fieldEndPos + 1);
|
|
return value;
|
}
|
|
public String getTitle() {
|
return title;
|
}
|
|
public void setTitle(String title) {
|
this.title = title;
|
}
|
|
public int getIndex() {
|
return index;
|
}
|
|
public void setIndex(int index) {
|
this.index = index;
|
}
|
|
public String getFieldName() {
|
return fieldName;
|
}
|
|
public void setFieldName(String fieldName) {
|
this.fieldName = fieldName;
|
}
|
|
public String getFormat() {
|
return format;
|
}
|
|
}
|