com.objsys.asn1j.runtime
Class Asn1TraceHandler

java.lang.Object
  extended by com.objsys.asn1j.runtime.Asn1TraceHandler
All Implemented Interfaces:
Asn1NamedEventHandler

public class Asn1TraceHandler
extends java.lang.Object
implements Asn1NamedEventHandler

This class is a standard named event handler for printing the data in an encoded message in a human-readable format. Note that this handler will work with data encoded using any of the encoding rules (BER, DER, or PER).


Constructor Summary
Asn1TraceHandler()
          This constructor sets the output stream to standard output.
Asn1TraceHandler(java.io.PrintStream ps)
          This constructor sets the output stream to the given PrintStream.
 
Method Summary
 void characters(java.lang.String svalue, short typeCode)
          The characters callback method is invoked when content (primitive data) is encountered.
 void endElement(java.lang.String name, int index)
          The endElement callback method is invoked when the end of an element within a constructed type (SEQUENCE, SET, SEQUENCE OF, SET OF, or CHOICE) is detected.
 void startElement(java.lang.String name, int index)
          The startElement callback method is invoked when the start of an element within a constructed type (SEQUENCE, SET, SEQUENCE OF, SET OF, or CHOICE) is encountered.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Asn1TraceHandler

public Asn1TraceHandler()
This constructor sets the output stream to standard output.


Asn1TraceHandler

public Asn1TraceHandler(java.io.PrintStream ps)
This constructor sets the output stream to the given PrintStream.

Method Detail

characters

public void characters(java.lang.String svalue,
                       short typeCode)
The characters callback method is invoked when content (primitive data) is encountered. A stringified representation of the parsed value is returned.

Specified by:
characters in interface Asn1NamedEventHandler
Parameters:
svalue - Stringified representation of the parsed value. The representation will be in ASN.1 value format.
typeCode - Identifier specifying the type of the parsed data variable. The enumerated list of values that might appear here is provided in the the Asn1Type class (see the documentation on this class for a full list of the names).

startElement

public void startElement(java.lang.String name,
                         int index)
The startElement callback method is invoked when the start of an element within a constructed type (SEQUENCE, SET, SEQUENCE OF, SET OF, or CHOICE) is encountered.

Specified by:
startElement in interface Asn1NamedEventHandler
Parameters:
name - Name of the parsed element.
index - Index of element in array. Only used for SEQUENCE OF or SET OF elements. Set to -1 for all others.

endElement

public void endElement(java.lang.String name,
                       int index)
The endElement callback method is invoked when the end of an element within a constructed type (SEQUENCE, SET, SEQUENCE OF, SET OF, or CHOICE) is detected.

Specified by:
endElement in interface Asn1NamedEventHandler
Parameters:
name - Name of the parsed element.
index - Index of element in array. Only used for SEQUENCE OF or SET OF elements. Set to -1 for all others.