org.apache.wicket.markup.parser.filter
Class ExtendedOpenCloseTagExpander

java.lang.Object
  extended by org.apache.wicket.markup.parser.AbstractMarkupFilter
      extended by org.apache.wicket.markup.parser.filter.OpenCloseTagExpander
          extended by org.apache.wicket.markup.parser.filter.ExtendedOpenCloseTagExpander
All Implemented Interfaces:
IMarkupFilter

public class ExtendedOpenCloseTagExpander
extends OpenCloseTagExpander

MarkupFilter that expands all xhtml tag which are open-close in the markup but where the standard requires it to have a body. See WICKET-2650 for another use case where you want to avoid situations where your java code wants to render a body text, but because of the open-close tag Wicket's render engine will not call onComponentTagBody(). And you'll not get a warning or exception. This filter is not added by default. You may add it like:

 Application#init() {
   getMarkupSettings().setMarkupParserFactory() {
      new MarkupParserFactory() {
        MarkupParser newMarkupParser(final MarkupResourceStream resource) {
                  MarkupParser parser=super.newMarkupParser(resource);
            parser.appendMarkupFilter(new ExtendedOpenCloseTagExpander());
            return parser;
          }
       }
    }
 }
 
You may subclass ExtendedOpenCloseTagExpander and implement your own contains(String) to throw an exception or log a warning instead of changing open-close to open-body-close.

Author:
Juergen Donnerstag

Constructor Summary
ExtendedOpenCloseTagExpander()
           
 
Method Summary
protected  boolean contains(String name)
          Allows subclasses to easily expand the list of tag which needs to be expanded.
 
Methods inherited from class org.apache.wicket.markup.parser.filter.OpenCloseTagExpander
nextTag, onFound
 
Methods inherited from class org.apache.wicket.markup.parser.AbstractMarkupFilter
getParent, nextComponentTag, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtendedOpenCloseTagExpander

public ExtendedOpenCloseTagExpander()
Method Detail

contains

protected boolean contains(String name)
Description copied from class: OpenCloseTagExpander
Allows subclasses to easily expand the list of tag which needs to be expanded.

Overrides:
contains in class OpenCloseTagExpander
Returns:
true, if needs expansion
See Also:
OpenCloseTagExpander.contains(java.lang.String)


Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.