Class OpenCloseTagExpander
- java.lang.Object
-
- org.apache.wicket.markup.parser.AbstractMarkupFilter
-
- org.apache.wicket.markup.parser.filter.OpenCloseTagExpander
-
- All Implemented Interfaces:
IMarkupFilter
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
-
-
Field Summary
-
Fields inherited from class org.apache.wicket.markup.parser.AbstractMarkupFilter
REQUEST_COUNTER_KEY
-
-
Constructor Summary
Constructors Constructor Description OpenCloseTagExpander()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
contains(String name)
Allows subclasses to easily expand the list of tag which needs to be expanded.MarkupElement
nextElement()
Get the next xml element from the markup.protected MarkupElement
onComponentTag(ComponentTag tag)
Invoked when a ComponentTag was found.protected boolean
onFound(ComponentTag tag)
Can be subclassed to do other things.-
Methods inherited from class org.apache.wicket.markup.parser.AbstractMarkupFilter
getMarkupResourceStream, getNextFilter, getRequestUniqueId, getWicketNamespace, getWicketNamespace, onSpecialTag, postProcess, setNextFilter
-
-
-
-
Constructor Detail
-
OpenCloseTagExpander
public OpenCloseTagExpander()
-
-
Method Detail
-
nextElement
public MarkupElement nextElement() throws ParseException
Description copied from class:AbstractMarkupFilter
Get the next xml element from the markup. If eof, than retun null. Ignore raw markup. Invoke nextTag(tag) if a tag was found.- Specified by:
nextElement
in interfaceIMarkupFilter
- Overrides:
nextElement
in classAbstractMarkupFilter
- Returns:
- Return the next eligible MarkupElement. Null, if no more found.
- Throws:
ParseException
-
onComponentTag
protected MarkupElement onComponentTag(ComponentTag tag) throws ParseException
Description copied from class:AbstractMarkupFilter
Invoked when a ComponentTag was found.By default this method is also called for WicketTags.
- Specified by:
onComponentTag
in classAbstractMarkupFilter
- Returns:
- Usually the same as the tag attribute
- Throws:
ParseException
-
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.
-
-