columnInfo.setNestedList(this.nestedColumnInfoList);
rowTag.addColumnInfo(columnInfo);
}
DisplayProvider displayProvider = rowTag.getDisplayProvider();
StringBuffer sb = new StringBuffer(displayProvider.getCellPreProcess(getCellAttributes()));
boolean hasBodyContent = false;
if (displayProvider.doesIncludeBodyContent() && bodyContent != null && bodyContent.getString() != null
&& bodyContent.getString().trim().length() > 0)
{
sb.append(bodyContent.getString().trim());
bodyContent.clearBody();
hasBodyContent = true;
}
{
if (property != null && rowTag.getBeanName() != null)
{
try
{
Object bean = pageContext.getAttribute(rowTag.getBeanName());
if (bean != null)
{
Object value = null;
try
{
value = PropertyUtils.getProperty(bean, property);
}
catch (Exception e)
{
//Do nothing, if you want to handle this exception, then
// use a try catch in the body content.
LOGGER.error("<vlh:column> Error getting property='" + property + "' from the iterated JavaBean name='"
+ rowTag.getBeanName() + "'\n The row's JavaBean was >>>" + bean
+ "<<<\n Check the syntax or the spelling of the column's property!");
}
if (value != null)
{
if (sum != null && value instanceof Number)
{
double doubleValue = ((Number) value).doubleValue();
Double sumValue = (Double) pageContext.getAttribute(sum);
if (sumValue == null)
{
sumValue = new Double(doubleValue);
}
else
{
sumValue = new Double(sumValue.doubleValue() + doubleValue);
}
pageContext.setAttribute(sum, sumValue);
}
if( ! hasBodyContent)
{
String formattedValue = JspUtils.format(value, format, locale);
if (groupKey == null
|| (config.getCellInterceptor() == null || !config.getCellInterceptor().isHidden(pageContext, groupKey,
property, formattedValue)))
{
sb.append(displayProvider.emphase(formattedValue, getEmphasisPattern(), getColumnStyleClass()));
}
}
}
else if (!hasBodyContent)
{
if (LOGGER.isDebugEnabled())
{
LOGGER.debug("The property '" + property + "' of the iterated JavaBean '" + bean + "' is null!");
}
Object nullValue = (defaultValue == null) ? config.getNullToken() : defaultValue;
if (groupKey == null
|| (config.getCellInterceptor() == null || !config.getCellInterceptor().isHidden(pageContext, groupKey,
property, nullValue)))
{
sb.append(nullValue);
}
}
}
}
catch (Exception e)
{
final String message = "DefaultColumnTag.doEndTag() - <vlh:column> error getting property: " + property + " from bean.";
LOGGER.error(message, e);
throw new JspException(message, e);
}
}
}
sb.append(displayProvider.getCellPostProcess());
JspUtils.write(pageContext, sb.toString());
release();
return EVAL_PAGE;