users@jaxb.java.net

Re: ValidationEventHandler returns only parent object through ValidationEvent.getLocator().getObject()

From: <MRist_at_lstelcom.com>
Date: Tue, 28 Sep 2004 14:59:00 +0200

>> my problem is, that JAXB report correct validation error message but its
>> locator returns only the parent object of the incorrect leaf (node).
>>
>> Why do you don't give the real JAXB object that cause the validation
error?

>Because sometimes it's not the object that causes the error but its
absence.

That's true.

>> With that information it whould be possible to walk through the whole
tree,
>> find parents....
>> I use on-demand validation. I want to validate the JAXB tree not a xml
>> file.
>> Therefore the parser can't report line and column information where the
>> error occures - I have no chance to get information of the real error
>> location.
>> Using other validators (JARV) will report the correct xml location
(line,
>> column) but I lose the connection to the corresponding JAXB object
model.
>>
>> I discussed this with Kohsuke a few months ago:
>> https://jaxb.dev.java.net/servlets/ReadMsg?list=users&msgNo=3303
>>
>>
>>>Or maybe we can just give you both the parent and the child node. Does
>>
>> that help?
>>
>> Yes that whould be a solution for me.
>> But do you want to implement this? Or can I attach this behaviour of
JAXB
>> validator for myself.

>Doesn't ValidationEventLocatorEx help you? I think having a parent
>object and a field name should be enough to localize the error.

I get errors from ValidationEventCollector and this delivers
ValidationEvent[].
The getLocator() of ValidationEvent returns a ValidationEventLocator and
not ValidationEventLocatorEx.
I don't know how to get ValidationEventLocatorEx.


>I'm also interested in on-demand validation that would, for instance,
>allow displaying detailed validation messages in a document editor.
That's what I want to do too.


regards,
Michael



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net