I think Jonathan (Carlson) is right on this. If he wants to override e.g. PatternValidator in order to provide his own implementation of the errorMessage method (errorMessage(input, component)), that's really understandable.

I propose to make the validate methods final of the AbstractValidator subclasses, and remove the final tag from the classes. The alternative would be to fiddle with pre-post fixes etc, but I really the template methods of AbstractValidator as a user, and having a focus on resource keys (who say's everyone will get their messages from resource files anyway) will also blur things.

Eelco

Jonathan Locke wrote:



Jonathan Carlson wrote:

(I am using CVS as of last Monday or so)
In order to use the cool new errorMessage(...) methods in AbstractValidator, I would like to suclass RequiredValidator and PatternValidator (and probably others as well) to provide my own error resourceKey and resourceModel map.
However, the AbstractValidator subclasses are final. Could we please open these up or else provide a way to provide our own resoruceKey and resourceModel without subclassing? (Like maybe with getters and setters). I was willing to copy the logic from RequiredValidator to my own validator class, but the PatternValidator is more complex and I really shouldn't have to copy all that stuff, right?


btw, for anyone who has been wondering about the usefulness of defensive programming with final, private, etc... this is a perfect example. there's possibly some use case here we didn't anticipate. if these classes had been extensible, there might be dozens of people out there subclassing them in order to implement functionality that we might ultimately decide should be part of the API. and with all those unanticipated subclasses to support, we'd have very little flexibility to change our AbstractValidator subclasses in the future without breaking the world.

anyway, what problem are you trying to solve, jonathan?

I'm curious about your response. Thanks!
- Jonathan



********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager.

www.katun.com
**********************************************************************



------------------------------------------------------- The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt _______________________________________________ Wicket-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-user




-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to