throw new NullPointerException();
}
if (!component.isRendered()) return;
ResponseWriter writer = context.getResponseWriter();
DataTable comp = (DataTable)component;
// number of columns equals count of childern (UIColumn elements)
int columns = component.getChildCount();
// If no columns was found, the table element will not be rendered.
if (columns == 0) return;
writer.startElement(Attributes.TABLE, component);
RendererUtils.writeAttribute(Attributes.ID, comp.getClientId(context), writer);
RendererUtils.writeAttribute(Attributes.CLASS, comp.getStyleClass(), writer);
RendererUtils.writeAttribute(Attributes.XML_LANG, comp.getXmllang(), writer);
RendererUtils.writeAttribute(Attributes.ALIGN, comp.getAlign(), writer);
RendererUtils.writeAttribute(Attributes.COLUMNS, new Integer(columns), writer);
RendererUtils.writeAttribute(Attributes.TITLE, comp.getTitle(), writer);
if (hasHeaderOrFooter(context, component, true))
renderHeaderOrFooter(context, component, true);
renderChildren(context, component);