Class ASN1TypeCollection

All Implemented Interfaces:
ASN1Constants
Direct Known Subclasses:
ASN1Sequence, ASN1Set

public abstract class ASN1TypeCollection
extends ASN1Constructed
This abstract class represents ASN.1 type that is a collection of ASN.1 types.
See Also:
ASN.1
  • Field Details

    • type

      public final ASN1Type[] type
    • OPTIONAL

      public final boolean[] OPTIONAL
    • DEFAULT

      public final Object[] DEFAULT
  • Constructor Details

    • ASN1TypeCollection

      protected ASN1TypeCollection​(int tagNumber, ASN1Type[] type)
      Constructs ASN.1 collection type.
      Parameters:
      tagNumber - ASN.1 tag number
      type - a collection of one or more ASN.1 types.
      Throws:
      IllegalArgumentException - if tagNumber is invalid
  • Method Details

    • setOptional

      protected final void setOptional​(int index)
      Sets a collection component as optional
      Parameters:
      index - an index of a component
    • setDefault

      protected final void setDefault​(Object object, int index)
      Sets a default value for a collection component. The component also became an optional component.
      Parameters:
      object - a component's default value
      index - an index of a component
    • getValues

      protected void getValues​(Object object, Object[] values)
      Provides an object's values to be encoded Derived classes should override this method to provide encoding for a selected class of objects. The default implementation throws RuntimeException.
      Parameters:
      object - an object to be encoded
      values - an array to store an object's values to be encoded