Chapter 23. Event Handler and Exception Handler Interfaces

Table of Contents

Event Handlers
Exception Handlers

The –events command line switch causes hooks for user-defined event and exception handlers to be inserted into the generated Java decode methods. Event handlers fire when key message-processing events occur during the course of parsing an ASN.1 message. What the event handler does is up to you. Event handlers are similar in functionality to the Simple API for XML (SAX) that was described earlier for parsing XML messages.

The exception handler is invoked when the decoder would otherwise throw certain exceptions. You can choose to ignore the exception or throw a different exception.