Class 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
    • Constructor Detail

      • OpenCloseTagExpander

        public OpenCloseTagExpander()
    • Method Detail

      • nextElement

        public MarkupElement nextElement()
                                  throws java.text.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 interface IMarkupFilter
        Overrides:
        nextElement in class AbstractMarkupFilter
        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: AbstractMarkupFilter
        Invoked when a ComponentTag was found.

        By default this method is also called for WicketTags.

        Specified by:
        onComponentTag in class AbstractMarkupFilter
        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