public final Markup loadMarkup(final MarkupContainer container,
final MarkupResourceStream markupResourceStream, final IMarkupLoader baseLoader,
final boolean enforceReload) throws IOException, ResourceStreamNotFoundException
{
// read and parse the markup
Markup markup = baseLoader.loadMarkup(container, markupResourceStream, null, enforceReload);
// Check if markup contains <wicket:extend> which tells us that
// we need to read the inherited markup as well.
int extendIndex = requiresBaseMarkup(markup);
if (extendIndex == -1)
{
// return a MarkupStream for the markup
return markup;
}
// Load the base markup
final Markup baseMarkup = getBaseMarkup(container, markup, enforceReload);
if (baseMarkup == Markup.NO_MARKUP)
{
throw new MarkupNotFoundException(
"Base markup of inherited markup not found. Component class: " +
markup.getMarkupResourceStream()