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 booleancontains(java.lang.String name)Allows subclasses to easily expand the list of tag which needs to be expanded.MarkupElementnextElement()Get the next xml element from the markup.protected MarkupElementonComponentTag(ComponentTag tag)Invoked when a ComponentTag was found.protected booleanonFound(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
-
-
-
-
Method Detail
-
nextElement
public MarkupElement nextElement() throws java.text.ParseException
Description copied from class:AbstractMarkupFilterGet 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:
nextElementin interfaceIMarkupFilter- Overrides:
nextElementin classAbstractMarkupFilter- Returns:
- Return the next eligible MarkupElement. Null, if no more found.
- Throws:
java.text.ParseException
-
onComponentTag
protected MarkupElement onComponentTag(ComponentTag tag) throws java.text.ParseException
Description copied from class:AbstractMarkupFilterInvoked when a ComponentTag was found.By default this method is also called for WicketTags.
- Specified by:
onComponentTagin classAbstractMarkupFilter- Returns:
- Usually the same as the tag attribute
- Throws:
java.text.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.
-
contains
protected boolean contains(java.lang.String name)
Allows subclasses to easily expand the list of tag which needs to be expanded.- Parameters:
name-- Returns:
- true, if needs expansion
-
-