To define event handlers, two things must be done:
One or more new classes must implement the Asn1NamedEventHandler interface.
Objects of these classes must be created and registered prior to calling the generated decode method for a particular type.
The best way to illustrate this procedure is through examples. We will first show a simple event handler application to provide a customized formatted printout of the fields in a BER message. Then we will show a simple XML converter class that will convert the data in a BER message to XML.