From: "Peter Donald" <[EMAIL PROTECTED]>
> Justa note that I would prefer that changes like this be discussed before
> they get done or at least implemented in a proposal branch first.
ok, but I understood you OKed some sort of a wrapper. I can back them out,
of course, if you are giving a -1 to this implementation (I understand you
are
from what I read, but please confirm). If you had provided these comments
earlier, it might have helped too.
> > The concept of validation here is somewhat similar to
EnumeratedAttribute.
>
> Type and validation of type are different concepts and shouldn't be merged
> together. There should be a method that allows validation to be extracted
EnumeratedAttribute, IIRC, performs validation also...
> outside the task but I don't like the way that you do it. For example lets
> consider that there may be N different types. Each instance of a type may
> have M rules applied to it. Thus under your system you could potentially
have
> N x M objects!!!! I would much prefer to have just M objects that could be
> composed together - much more manageable ;)
Hmm... what if the validator class composes the validation using
other smaller validator class methods? We can also do some daisy chaining
mechanism this way. Or, have I not understood correctly the issue you
are pointing out?
> Heres one way of "fixing" this - maybe to wait till Ant2. Lets call the
> objects that do checking "Validators". Each time we call a setter for
either
> an attribute or an element we call an associated chain of Validators
(chain
> may be null in which case zero validation occurs).
>
> The chain of validators is built up by looking at the TaskInfo object -
which
> lists all validators that must be run etc. Because writing the TaskInfo
> object would be monotonous we could have them automagically generated
based
> on comments in javadocs for the setters. ie. Something like
>
> /**
> * ...
> *
> * @validator org.apache.ant.validators.SourceValidator
> */
> void setSrc( File src )
> {
> }
This type of mechanism might not be ideal for the API user? What you say
will
have an effect only if setSrc is invoked by An't core. If say somebody uses
Ant's API to launch a task from some external environment for whatever
reason,
the checkings will not happen. I see you are proposing something similar to
@assert?
> This would mean much less objects required to do validating and so forth
and
> should be relatively easy to implement by Task writers (not so easy for us
> though).
Let me know.
Cheers,
Magesh
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>