com.objsys.asn1j.runtime
Class Asn1Context
java.lang.Object
com.objsys.asn1j.runtime.Asn1Context
public class Asn1Context
- extends java.lang.Object
This class is a holder for things which are to be contained in an encoder or
decoder. Since we have multiple base classes for encoders/decoders
(Asn1MessageBuffer and Asn1OutputStream), this class provides a single
container for all of those things which would otherwise be contained in
the various base classes.
This class also provides a location for some convenience methods related
to the contained objects (e.g. getCurrentElement).
Thread-safety: a given instance of this class should be accessed by a single
thread.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
eventDispatcher
public Asn1NamedEventDispatcher eventDispatcher
- The named event dispatcher for this context.
Asn1Context
public Asn1Context()
enableElementTracking
public void enableElementTracking()
- Enable element name tracking. This can be useful for error reporting.
Element name tracking must be enabled for getCurrentElement to be of
any use.
getCurrentElement
public java.lang.String getCurrentElement()
- Return the name of the current element. This is only useful if
you have called enableElementTracking at the start of encoding/decoding.
The name returned will be in the form element1.element2...,
If you have not enabled element tracking, an exception will be thrown.