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

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

public class OpenCloseTagExpander
extends AbstractMarkupFilter

MarkupFilter that expands certain open-close tag as separate open and close tags. Firefox, unless it gets text/xml mime type, treats these open-close tags as open tags which results in corrupted DOM. This happens even with xhtml doctype. In addition, some tags are required open-body-close for Wicket to work properly.

Author:
Juergen Donnerstag, Matej Knopp

Constructor Summary
OpenCloseTagExpander()
           
 
Method Summary
protected  boolean contains(String name)
          Allows subclasses to easily expand the list of tag which needs to be expanded.
 MarkupElement nextTag()
          Get the next MarkupElement from the parent MarkupFilter and handle it if the specific filter criteria are met.
protected  boolean onFound(ComponentTag tag)
          Can be subclassed to do other things.
 
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

OpenCloseTagExpander

public OpenCloseTagExpander()
Method Detail

nextTag

public MarkupElement nextTag()
                      throws ParseException
Description copied from interface: IMarkupFilter
Get the next MarkupElement from the parent MarkupFilter and handle it if the specific filter criteria are met. Depending on the filter, it may return the MarkupElement unchanged, modified or remove it by asking the parent handler for the next tag.

Returns:
Return the next eligible MarkupElement
Throws:
ParseException
See Also:
IMarkupFilter.nextTag()

onFound

protected boolean onFound(ComponentTag tag)
Can be subclassed to do other things. E.g. instead of changing it you may simply want to log a warning.

Parameters:
tag -
Returns:
Must be true to automatically create and add a close tag.

contains

protected boolean contains(String name)
Allows subclasses to easily expand the list of tag which needs to be expanded.

Parameters:
name -
Returns:
true, if needs expansion


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