Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

2. XML Schema and the SOA Data Model > Collecting Schema Validation Events Duri...

Collecting Schema Validation Events During Marshaling and Unmarshaling

Problem

You want to learn more about schema validation errors during unmarshaling so you can report more robust messages back to your user, receive validation failure events as they occur, and generally gain more control over the validation process.

Solution

Implement the javax.xml.bind.ValidationEventHandler interface to perform custom operations and set it into your marshaler or unmarshaler object. Also try the ValidationEventCollector utility.

This interface defines one method: handleEvent, which gives you the opportunity to perform custom event handling. To use it, you implement the interface and then register your implementation with the marshaler or unmarshaler, which will use your handler to collect validation events.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint