Class ParserFactory
- java.lang.Object
-
- ParserFactory
-
public class ParserFactory extends Object
Defines static methods to create parsers for particular types.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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.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.
-
-
-
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 ArrayDataObjectand 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 - seeforType(Type)
.- Parameters:
clazz
- a Class corresponding to an ASN.1 type- Returns:
- a parser for values of that ASN.1 type
-
-