use of org.apache.wicket.markup.parser.filter.WicketNamespaceHandler in project wicket by apache.
the class MarkupParser method initializeMarkupFilters.
/**
* Initialize Wicket's MarkupParser with all necessary markup filters. You may subclass this
* method, to add your own filters to the list.
*
* @param markup
* @return The list of markup filter
*/
@Override
protected MarkupFilterList initializeMarkupFilters(final Markup markup) {
// MarkupFilterList is a simple extension of ArrayList providing few additional helpers
final MarkupFilterList filters = new MarkupFilterList();
MarkupResourceStream markupResourceStream = markup.getMarkupResourceStream();
filters.add(new WicketTagIdentifier(markupResourceStream));
filters.add(new HtmlHandler());
filters.add(new WicketRemoveTagHandler(markupResourceStream));
filters.add(new WicketLinkTagHandler(markupResourceStream));
filters.add(new AutoLabelTagHandler(markupResourceStream));
filters.add(new WicketNamespaceHandler(markupResourceStream));
filters.add(new WicketMessageTagHandler(markupResourceStream));
// Provided the wicket component requesting the markup is known ...
if ((markupResourceStream != null) && (markupResourceStream.getResource() != null)) {
final ContainerInfo containerInfo = markupResourceStream.getContainerInfo();
if (containerInfo != null) {
// Pages require additional handlers
if (Page.class.isAssignableFrom(containerInfo.getContainerClass())) {
filters.add(new HtmlHeaderSectionHandler(markup));
}
filters.add(new HeadForceTagIdHandler(containerInfo.getContainerClass()));
}
}
filters.add(new OpenCloseTagExpander());
filters.add(new RelativePathPrefixHandler(markupResourceStream));
filters.add(new EnclosureHandler(markupResourceStream));
filters.add(new InlineEnclosureHandler(markupResourceStream));
// Append it. See WICKET-4390
filters.add(new StyleAndScriptIdentifier(), StyleAndScriptIdentifier.class);
filters.add(new WicketContainerTagHandler(markupResourceStream, Application.get().usesDevelopmentConfig()));
return filters;
}
Aggregations