Stephen, I'm not very savvy on ErrorHandlers. In fact, I'm just now having to learn about them to get around this very issue. But my US$0.02 would be to have the solution for Marshalling and Unmarshalling use the same type object so that if a user wants to write a custom ErrorHandler, they might use it for both Marshalling and Unmarshalling.
But most of all - Thanks for looking into this issue!! And thanks for a great product!!! Patty -----Original Message----- From: Stephen Bash [mailto:[EMAIL PROTECTED] Sent: Friday, March 24, 2006 9:54 AM To: [email protected] Subject: Re: [castor-user] When unmarshalling, need Castor to validate entire document against schema instead of quitting after first validation error Just an addendum... Looking at ValidationContext more, I think it could be used inside an ErrorHandler in order to control/observe validation behavior. I guess the question is now do we modify UnmarshalHandler (the current implementation of ErrorHandler) to use a ValidationContext, or do we separate the ErrorHandler out as a separate object to allow user-swapping of ErrorHandlers? Obviously, in the latter case Castor can still provide one or two implementations of ErrorHandler for users who don't need to implement their own. Stephen On 3/24/06, Stephen Bash <[EMAIL PROTECTED]> wrote: > Keith- > > Skipping over the conversation of American colloquialisms (which would > be very fun at another time, because we have a lot of 'em), I'd like > to discuss the ValidationContext a bit. A (very) quick glance through > the code gives me the impression it was written more for the > marshalling process than unmarshalling. Do you think it is amenable > to both processes? > > I was thinking in a more general sense of just allowing the user to > specify an ErrorHandler (similar to EntityResolver, just add an > Unmarshaller.setErrorHandler method, if undefined, use a fail fast > system to mirror current practice) while providing a few basic ones in > the Castor distribution (to steal your terms, FailFastErrorHandler and > FailOnFatalErrorHandler). Longer term I was thinking a > StatefulErrorHandler would be nice, but it really depends on how much > information the ErrorHandler could get out of the UnmarshalListener at > runtime. This might be more along the lines of the ValidationContext, > but my brain isn't combining the two real well yet. > > In any case, let me know your thoughts (and everyone else is free to > throw in US$0.02 also). > > Thanks, > Stephen > > > On 3/24/06, Werner Guttmann <[EMAIL PROTECTED]> wrote: > > For those of you not being natively English, have a look at > > > > http://www.thefreedictionary.com/guys > > > > Where it (to my own surprise) it is stated that 'guys' really can be used > > in the sense as descibed by Keith. > > > > Guy, noun > > 1. Informal A man; a fellow. > > 2. guys Informal *** Persons of either sex. *** 3. Chiefly British A > > person of odd or grotesque appearance or dress. > > > > And I thought for a second that Keith is making up a story ... ;-) > > > > Werner > > > > > -----Original Message----- > > > From: Keith Visco [mailto:[EMAIL PROTECTED] > > > Sent: Freitag, 24. März 2006 07:44 > > > To: [email protected] > > > Subject: Re: [castor-user] When unmarshalling, need Castor to > > > validate entire document against schema instead of quitting after > > > first validation error > > > > > > > > > Oops. I just got a private e-mail from an observant member > > > pointing out my lack of attention to detail. Just to be clear, I > > > used the term "guys" > > > in a strictly generic way which included both genders. I should be > > > more careful to use gender-non-specific terms when addressing more > > > than one person. My apologies to the female audience. > > > > > > --Keith > > > > > > Keith Visco wrote: > > > > > > > > Hi guys, > > > > > > > > Take a look at ValidationContext and ValidationException. I > > > > already started the groundwork for this. You'll see that > > > ValidationException > > > > already supports chaining and ValidationContext has a > > > fail-fast flag. > > > > Unfortunately, disabling fail-fast has not yet been > > > implemented, but > > > > it was definately on my to-do list. I don't think it would be > > > > that difficult to implement for the Marshaller...but doing so in a > > > > "safe" > > > > manner during unmarshalling may be a bit more challenging. > > > > > > > > --Keith > > > > > > > > Werner Guttmann wrote: > > > > > > > >> Stephen, Patty > > > >> > > > >>> -----Original Message----- > > > >>> From: Stephen Bash [mailto:[EMAIL PROTECTED] Sent: > > > Donnerstag, 23. > > > >>> März 2006 14:45 > > > >>> To: [email protected] > > > >>> Subject: Re: [castor-user] When unmarshalling, need Castor to > > > >>> validate entire document against schema instead of quitting > > > >>> after first validation error > > > >>> > > > >>> Patty- > > > >>> > > > >>> Unfortunately, I don't think you can replace the ErrorHandler > > > >>> in such a way that the change will stick. When you call > > > unmarshal, the > > > >>> Unmarshaller sets the error handler just before starting > > > parsing. > > > >>> So that means the fix needs to live inside Castor, unless > > > we create > > > >>> a method for user-supplied ErrorHandlers. > > > >> > > > >> > > > >> If we decide to do so, why not a similar mechanism to > > > >> DTDResolver, which allows some sort of chaining. > > > >> > > > >> Werner > > > >> > > > >> ------------------------------------------------- > > > >> If you wish to unsubscribe from this list, please send an empty > > > >> message to the following address: > > > >> > > > >> [EMAIL PROTECTED] > > > >> ------------------------------------------------- > > > >> > > > >> > > > > > > > > > > > > ------------------------------------------------- > > > > If you wish to unsubscribe from this list, please send an empty > > > > message to the following address: > > > > > > > > [EMAIL PROTECTED] > > > > ------------------------------------------------- > > > > > > > > > > > > > > > > > ------------------------------------------------- > > > If you wish to unsubscribe from this list, please send an empty > > > message to the following address: > > > > > > [EMAIL PROTECTED] > > > ------------------------------------------------- > > > > > > > > > > > > > ------------------------------------------------- > > If you wish to unsubscribe from this list, please send an empty > > message to the following address: > > > > [EMAIL PROTECTED] > > ------------------------------------------------- > > > > > ------------------------------------------------- If you wish to unsubscribe from this list, please send an empty message to the following address: [EMAIL PROTECTED] -------------------------------------------------

