The generation of code for XER or XML may cause the following inner class definition to be generated:
public class SaxHandler extends Asn1XerSaxHandler {
Asn1XerSaxHandler mElemSaxHandler;
StringBuffer mCurrElemValue;
SaxHandler() {
<code ..>
}
public void startElement (String namespaceURI, String localName,
String qName, Attributes atts)
throws SAXException
{
<code ..>
}
public void characters (char[] ch, int start, int length)
throws SAXException
{
<code ..>
}
public void endElement (String namespaceURI,
String localName, String qName)
throws SAXException
{
<code ..>
}
}
This is an implementation of a standard SAX content handler class. As the XML parser software parses messages, the methods within this class are invoked with the parsed content. The startElement method is invoked after a start element tag (<tag>) is parsed. The characters method is invoked one or more times to pass the content between tags into the application. The endElement method is invoked when an end element tag (</tag>) is encountered.
The ASN1C compiler generates custom code for each ASN.1 type within a given specification to parse the XML contents and fill in the generated Java objects.