i like this idea. it is in tune with the idea that wicket might someday handle other kinds of markup. if the idea can be implemented without any imports from wicket.markup, it is general enough to be in wicket.util.parse.markup. otherwise, i think it belongs in wicket.markup.parser (since the name xml implies to me standards compliant xml, which it would not be). in fact, i suspect that this won't quite shape up to be general enough to be in wicket.util.


i'll try to work on the components in wicket.markup this afternoon so you can work on this refactor. sound good?

Juergen Donnerstag wrote:

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





-------------------------------------------------------
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