if (markup == null)
{
throw new MarkupException("Markup not found. Component: " + toString());
}
final MarkupStream markupStream = new MarkupStream(markup);
// Get mutable copy of next tag
final ComponentTag openTag = markupStream.getTag();
final ComponentTag tag = openTag.mutable();
// Call any tag handler
onComponentTag(tag);
// If we're an openclose tag
if (!tag.isOpenClose() && !tag.isOpen())
{
// We were something other than <tag> or <tag/>
markupStream.throwMarkupException("Method renderComponent called on bad markup element: " +
tag);
}
if (tag.isOpenClose() && openTag.isOpen())
{
markupStream.throwMarkupException("You can not modify a open tag to open-close: " + tag);
}
try
{
// Render open tag
if (getRenderBodyOnly() == false)
{
renderComponentTag(tag);
}
markupStream.next();
// Render the body only if open-body-close. Do not render if open-close.
if (tag.isOpen())
{
// Render the body. The default strategy will simply call the component's