wicket.markup.parser.filter
Class WicketParamTagHandler

java.lang.Object
  extended bywicket.markup.parser.AbstractMarkupFilter
      extended bywicket.markup.parser.filter.WicketParamTagHandler
All Implemented Interfaces:
IMarkupFilter

public final class WicketParamTagHandler
extends AbstractMarkupFilter

This is a markup inline filter. It identifies Wicket parameter tags like <wicket:param key=value/> and assigns the key/value pair to the attribute list of the immediately preceding Wicket component.

Example:

    <table><tr wicket:id="myTable">
      <wicket:param rowsPerPage=10/>
      ...
    </tr></table>
 

Author:
Juergen Donnerstag

Constructor Summary
WicketParamTagHandler(IMarkupFilter parent)
          Construct.
 
Method Summary
 MarkupElement nextTag()
          Get the next tags from the next MarkupFilter in the chain.
 void setStripWicketTag(boolean strip)
          Enable/disable removing Wicket param tags
 
Methods inherited from class wicket.markup.parser.AbstractMarkupFilter
getParent, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WicketParamTagHandler

public WicketParamTagHandler(IMarkupFilter parent)
Construct.

Parameters:
parent - The next MarkupFilter in the chain
Method Detail

setStripWicketTag

public void setStripWicketTag(boolean strip)
Enable/disable removing Wicket param tags

Parameters:
strip - True, if Wicket param tags shall be removed

nextTag

public final MarkupElement nextTag()
                            throws java.text.ParseException
Get the next tags from the next MarkupFilter in the chain. Identify wicket param tags and handle them as described above.

Note: IXmlPullParser which is the last element in the chain returns XmlTag objects which are derived from MarkupElement. WicketParamTagHandler hwoever assumes that the next MarkupFilter in the chain returns either ComponentTags or ComponentWicketTags. Both are subclasses of MarkupElement as well. Thus, WicketParamTagHandler can not be the first MarkupFilter immediately following the IXmlPullParser. Some inline filter converting XmlTags into ComponentTags must preceed it.

Returns:
The next MarkupElement from markup. If null, no more tags are available
Throws:
java.text.ParseException
See Also:
IMarkupFilter.nextTag()


Copyright © 2004-2005 Wicket developers. All Rights Reserved.