}
encodeMenuItem(context, menu, menuItem);
writer.endElement("li");
}
else if(element instanceof Submenu) {
Submenu submenu = (Submenu) element;
String style = submenu.getStyle();
String styleClass = submenu.getStyleClass();
styleClass = styleClass == null ? Menu.TIERED_SUBMENU_CLASS : Menu.TIERED_SUBMENU_CLASS + " " + styleClass;
writer.startElement("li", null);
if(shouldRenderId(submenu)) {
writer.writeAttribute("id", submenu.getClientId(), null);
}
writer.writeAttribute("class", styleClass, null);
if(style != null) {
writer.writeAttribute("style", style, null);
}