{
MarkupElement elem = stream.get();
stream.next();
if (elem instanceof WicketTag)
{
WicketTag wTag = (WicketTag)elem;
if (!insideBorderMarkup)
{
if (wTag.isBorderTag() && wTag.isOpen())
{
insideBorderMarkup = true;
continue;
}
else
{
throw new WicketRuntimeException(
"Unexpected tag encountered in markup of component border " +
getClass().getName() + ". Tag: " + wTag.toString() +
", expected tag: <wicket:border>");
}
}
else
{
if (wTag.isBodyTag())
{
break;
}
else
{
throw new WicketRuntimeException(
"Unexpected tag encountered in markup of component border " +
getClass().getName() + ". Tag: " + wTag.toString() +
", expected tag: <wicket:body> or </wicket:body>");
}
}
}
if (insideBorderMarkup)