com.objsys.asn1j.runtime
Class Asn1ElementTracker

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

public class Asn1ElementTracker
extends java.lang.Object
implements Asn1NamedEventHandler

Maintains an element stack so that a full name for the current element can be obtained. This simply pushes/pops elements on/off the element stack when the event handler methods are invoked.


Constructor Summary
Asn1ElementTracker()
           
 
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.
 java.lang.String getCurrentElement()
           
 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

Asn1ElementTracker

public Asn1ElementTracker()
Method Detail

characters

public void characters(java.lang.String svalue,
                       short typeCode)
Description copied from interface: Asn1NamedEventHandler
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).

endElement

public void endElement(java.lang.String name,
                       int index)
Description copied from interface: Asn1NamedEventHandler
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.

startElement

public void startElement(java.lang.String name,
                         int index)
Description copied from interface: Asn1NamedEventHandler
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.

getCurrentElement

public java.lang.String getCurrentElement()