Jérôme BERNARD wrote:

2005/11/26, Dennis Sosnoski <[EMAIL PROTECTED]>:

[...]
The actual binding definition validation handling is built into the
org.jibx.binding.model.BindingElement class, in the validateBinding()
method. This actually prints out the errors to System.out, but the
methods it uses are all public and could be used directly for other
types of reporting.

I'm having problems trying to hook in BindingElement.validateBinding().
Basically the problem is BindingElement.validateBinding() calls
BindingElement.readBinding() which throws JiBXException and do not
"populate" the ValidationContext.

Am I missing something obvious??
I suspect the part you're missing is that the binding model itself uses JiBX data binding, so the binding needs to be compiled whenever you regenerate the binding model classes - but you can't run the binding compiler normally without the binding model. There's a special command line switch that makes the binding compiler skip the binding validation step, added to allow the binding model binding to be compiled. This is the "-s" switch. You can look at the "compile-bind" target in the main JiBX build.xml (in the build directory) to see this in use.

This can be a nuisance when working with an IDE, since any time you modify one of the binding model classes you need to recompile the binding. I use a separate build-binding.xml Ant script to handle this from within Eclipse; that way I can just right click on the build-binding.xml file, select Run as/Ant task, and have the binding compiled. I'll check this file in before I send this message (I'm composing the message on a plane, so can't do either the check in or the send right now).

 - Dennis



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
jibx-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-devs

Reply via email to