Module org.apache.wicket.core
Class OpenCloseTagExpander
java.lang.Object
org.apache.wicket.markup.parser.AbstractMarkupFilter
org.apache.wicket.markup.parser.filter.OpenCloseTagExpander
- All Implemented Interfaces:
IMarkupFilter
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
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Allows subclasses to easily expand the list of tag which needs to be expanded.Get the next xml element from the markup.protected MarkupElement
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 Details
-
OpenCloseTagExpander
public OpenCloseTagExpander()
-
-
Method Details
-
nextElement
Description copied from class:AbstractMarkupFilter
Get the next xml element from the markup. If eof, than return 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
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
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
Allows subclasses to easily expand the list of tag which needs to be expanded.- Parameters:
name
-- Returns:
- true, if needs expansion
-