You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Mike Janson <mj...@gene.COM> on 2003/08/13 04:02:38 UTC

commons-validator question: why isn't there a public accessor for field in ValidatorResult?

I was wondering if someone could tell me a practical reason why the 
field property of ValidatorResult is protected yet no public accessor 
exists for it.

I'm currently using DynaValidatorForms in Struts, and I have a 
requirement for field error-dependent flow control.  Unless there's some 
other way to track errors back to fields that I'm unaware of, the lack 
of a public accessor means I'm going to have to extend at least 4 
classes (including a fair chunk of code), including Validator and 
ValidatorResult (to add the accessor).

-Mike



Re: commons-validator question: why isn't there a public accessor for field in ValidatorResult?

Posted by David Graham <gr...@yahoo.com>.
--- Mike Janson <mj...@gene.COM> wrote:
> I was wondering if someone could tell me a practical reason why the 
> field property of ValidatorResult is protected yet no public accessor 
> exists for it.

That's a good question and if you look at the recent source you'll find a
TODO tag indicating that I have been confused by that field variable
myself :-).  It's not used in the code so I was considering removing it. 
However, if you need access to it, then we should add an accessor method. 
I have no idea why this wasn't done in the original versions.

David

> 
> I'm currently using DynaValidatorForms in Struts, and I have a 
> requirement for field error-dependent flow control.  Unless there's some
> 
> other way to track errors back to fields that I'm unaware of, the lack 
> of a public accessor means I'm going to have to extend at least 4 
> classes (including a fair chunk of code), including Validator and 
> ValidatorResult (to add the accessor).
> 
> -Mike
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com