private static final Log log = LogFactory.getLog(ChartPostProcessorTag.class);
static final long serialVersionUID = 2608233610238632442L;
public int doEndTag() throws JspException {
ChartPostProcessor pp = null;
try {
pp = (ChartPostProcessor) getObject();
if (pp == null) {
throw new JspException("Could not find ChartPostProcessor under ID '" + getId() + "'");
}
} catch (ClassCastException cce) {
throw new JspException("Bean under ID '" + getId() + "' is of type '"
+ getObject().getClass().getName() + "'.\nType expected:" + ChartPostProcessor.class.getName());
}
AbstractChartTag rt = (AbstractChartTag) PageUtils.findRoot(this, pageContext);
ChartPostProcessor cpp = (ChartPostProcessor) getObject();
if (cpp instanceof Serializable) {
rt.addChartPostProcessor(cpp, getParameters());
} else if (cpp instanceof NonSerializableChartPostProcessor) {
rt.addChartPostProcessor(((NonSerializableChartPostProcessor) cpp).getSerializablePostProcessor(), getParameters());
} else {
log.error("ChartPostProcessor "+cpp.getClass().getName()+" implements neither Serializable nor NonSerializableChartPostProcessor. It will be ignored.");
}
return doAfterEndTag(EVAL_PAGE);
}