This type represents what was formerly called the ASN.1 ANY type. The ANY and ANY DEFINED BY types are superseded as of ITU-T Recommendation X.680 version current December 1997 by the ability to define type classes. Modelling type classes is beyond the scope of this ASN.1 package although the package can be enhanced accordingly. ASN.1 type classes can contain components whose type is unspecified. Such components are called "open types". This class mimics an open type insofar as it decodes any type encountered in an encoded stream of ASN.1 types. On encoding the proper type is encoded in place of the open type. Decoding an open type that was not properly initialised either by a call to a creator with an argument or by decoding it from a valid ASN.1 encoding results in an {@link ASN1Null ASN1Null} being decoded.
This class enforces as an invariant that inner types have the same tagging as the type itself. For instance:
ASN1OpenType ot; ASN1Integer n; n = new Integer("42"); n.setExplicit(true); ot = new OpenType(new FooResolver()); ot.setExplicit(false); ot.setInnerType(n);
will cause the tagging method of
n
to be changed into EXPLICIT upon the call to
ot.setInnerType()
.
@author Volker Roth
@author Stefan Endler
@version "$Id: ASN1OpenType.java,v 1.3 2007/08/11 18:21:50 sendler Exp $"