use of jodd.lagarto.TagVisitor in project jodd by oblac.
the class HtmlStaplerFilter method createParsingProcessor.
@Override
protected LagartoParsingProcessor createParsingProcessor() {
if (!enabled) {
return null;
}
return new LagartoParsingProcessor(true) {
@Override
protected char[] parse(TagWriter rootTagWriter, HttpServletRequest request) {
TagVisitor visitor = rootTagWriter;
if (stripHtml) {
visitor = new StripHtmlTagAdapter(rootTagWriter) {
@Override
public void end() {
super.end();
if (log.isDebugEnabled()) {
log.debug("Stripped: " + getStrippedCharsCount() + " chars");
}
}
};
}
String servletPath = DispatcherUtil.getServletPath(request);
HtmlStaplerTagAdapter htmlStaplerTagAdapter = new HtmlStaplerTagAdapter(bundlesManager, servletPath, visitor);
// todo add more adapters
char[] content = invokeLagarto(htmlStaplerTagAdapter);
return htmlStaplerTagAdapter.postProcess(content);
}
};
}
Aggregations