Class ParserFactory


  • public class ParserFactory
    extends Object
    Defines static methods to create parsers for particular types.
    • Method Detail

      • forType

        public static <T> Parser<T> forType​(Type type)
        Creates a Parser for the given type, which should be one whose API conforms to CGIN's pattern for an ASN.1 type. This is necessary for parameterized types, such as ArrayDataObject and ArrayOfDataObject, and works for non-parameterized types too (by delegating to forClass(Class)).
        Parameters:
        type - a Type corresponding to an ASN.1 type
        Returns:
        a parser for values of that ASN.1 type
      • forClass

        public static <T> Parser<T> forClass​(Class<T> clazz)
        Creates a Parser for the given class, which should be one whose API conforms to CGIN's pattern for an ASN.1 type represented by a Class. This is insufficient for parameterized types - see forType(Type).
        Parameters:
        clazz - a Class corresponding to an ASN.1 type
        Returns:
        a parser for values of that ASN.1 type