Class MarkupParser currently a) tokenizes the markup into xml tag, b)
identifies ComponentTags and RawMarkup c) remove comments d) remove
<wicket:remove> regions e) identify autolinks f) handle html specific
issues (automatically closing tags) etc.. What I want to make clear
with this list is that MarkupParser needs some refactoring. I've tried
it and the solutions looks like:

1) Create java.util.xml package which contains a (wicket independent)
XML streaming parser. By means of next() it returns XmlTags which are
subclasses of MarkupElement like RawMarkup and ComponentTag. The XML
parser is still the same we are currently using, it is just refactored
into a separate package.

2) Each elements contained in the list above is copied into a separate
handler class implementing an interface with two methods
'MarkupElement handleTag(final MarkupElement tag)' and getParent(). By
means of getParent() a chain of responsibilities is build which is
easily extensible.

3) MarkupParser is reduced to invoking the XML parser, the handlers
(from 2) and to create the Markup object (list of Wicket relevant
tags)

The changes should not change any behaviour nor require any
modification to your components. It is merely about how to generate
the list of relevant MarkupElements.

I hope it makes sense what I've written. Due to the amount of CVS
commits, what would be your suggestion on when to commit these
changes?

Juergen


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to