Implementation of ElementProcessor to handle the "Cell" tag.
This element has several attributes and may contain other elements.
| Method from org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements.EPCell Detail: |
public void endProcessing() throws IOException {
String content = getContent();
if (content != null && locale != null) {
// if there is a locale then set it (otherwise the default locale
// will be used)
getCell().setLocale(new Locale(locale, locale.toUpperCase()));
}
if (content != null && !content.trim().equals("")) {
getCell().setContent(getContent());
}
if(getColumns() != -1 && getRows() != -1) {
getSheet().addMergedRegion(new Region(getRow(),(short)getColumn(),getRow() + getRows() - 1,(short)(getColumn() + getColumns() - 1)));
}
}
end processing -- apply content to the cell. |
protected Cell getCell() {
return _cell;
}
|
public int getCellType() throws IOException, NullPointerException {
if (!_value_type_fetched) {
String valueString = getValue(_value_type_attribute);
if (valueString != null) {
_value_type = NumericConverter.extractInteger(valueString, _cell_type_validator);
}
_value_type_fetched = true;
}
return _value_type.intValue();
}
|
public int getColumn() throws IOException {
if (_col == null) {
_col = NumericConverter.extractNonNegativeInteger(getValue(_col_attribute));
}
return _col.intValue();
}
|
public int getColumns() throws IOException, NullPointerException {
if (!_cols_fetched) {
String valueString = getValue(_cols_attribute);
if (valueString != null) {
_cols = NumericConverter.extractPositiveInteger(valueString);
_cols_fetched = true;
}
}
return _cols_fetched ?_cols.intValue() : -1;
}
|
public String getContent() {
String content = getData();
return content;
}
|
public int getExpressionId() throws IOException, NullPointerException {
if (!_expr_id_fetched) {
String valueString = getValue(_expr_id_attribute);
if (valueString != null) {
_expr_id = NumericConverter.extractPositiveInteger(valueString);
}
_expr_id_fetched = true;
}
return _expr_id.intValue();
}
|
public String getFormat() throws IOException {
if (!_value_format_fetched) {
_value_format = getValue(_value_format_attribute);
_value_format_fetched = true;
}
return _value_format;
}
|
public int getRow() throws IOException {
if (_row == null) {
_row = NumericConverter.extractNonNegativeInteger(getValue(_row_attribute));
}
return _row.intValue();
}
|
public int getRows() throws IOException, NullPointerException {
if (!_rows_fetched) {
String valueString = getValue(_rows_attribute);
if (valueString != null) {
_rows = NumericConverter.extractPositiveInteger(valueString);
_rows_fetched = true;
}
}
return _rows_fetched ? _rows.intValue() : -1 ;
}
|
public void initialize(Attribute[] attributes,
ElementProcessor parent) throws IOException {
super.initialize(attributes, parent);
// default value (when < gmr:Cell > has no ValueType attribute)
int cellType = CellType.CELL_TYPE_FORMULA;
try {
cellType = getCellType();
} catch (NullPointerException ignored) {
}
_cell = getSheet().getRow(getRow()).createCell(getColumn(), cellType);
}
Override of initialize() implementation |
public void setLocale(String locale) {
this.locale = locale;
}
|