Hi, all. I notice that throughout the code HTML element and attribute names are hard-coded. Does Wicket have a list of HTML name and attribute constants that we could reference? I would find that a lot safer, and perhaps even more readable. Not only that, it would allow us to quickly find all the places that use the e.g. HTML.Element.EM element.

Secondly, in the same vein, I see lots of code like this:

if(tag.getName().equalsIgnoreCase("a"))...

That's also tedious and error-prone---I can't trust myself not to forget to do a case-insensitive comparison. Perhaps there could be a ComponentTag.hasName() method that does this for me? So the above would be:

if(tag.hasName(HTML.Element.EM))...

On the other hand, perhaps Wicket is wanting to support other contexts such as general XML, in which case case-sensitive matching is necessary. (I would imagine that the entire codebase plays loosely with whether or not matching is case-sensitive, though. More research is necessary on my part.)

What do you think at least about having HTML element/attribute constants? That my be an area I can contribute to in the short term.

Garret

Reply via email to