com.fasterxml.jackson.databind.type

## Class TypeParser

- java.lang.Object
- - com.fasterxml.jackson.databind.type.TypeParser

All Implemented Interfaces:
  Serializable

    public class TypeParser
    extends Object
    implements Serializable

Simple recursive-descent parser for parsing canonical `JavaType` representations and constructing type instances.

See Also:
  Serialized Form

### Field Summary

Fields
`protected TypeFactory` `_factory`
`protected static int` `MAX_TYPE_LENGTH` Maximum length of canonical type definition we will try to parse.
`protected static int` `MAX_TYPE_NESTING` Maximum levels of nesting allowed for parameterized types.

### Constructor Summary

Constructors
Constructor and Description
`TypeParser(TypeFactory f)`

### Method Summary

All Methods Instance Methods Concrete Methods
`protected IllegalArgumentException` `_problem(com.fasterxml.jackson.databind.type.TypeParser.MyTokenizer tokens, String msg)`
`protected Class<?>` `findClass(String className, com.fasterxml.jackson.databind.type.TypeParser.MyTokenizer tokens)`
`JavaType` `parse(String canonical)`
`protected JavaType` `parseType(com.fasterxml.jackson.databind.type.TypeParser.MyTokenizer tokens, int nestingAllowed)`
`protected List<JavaType>` `parseTypes(com.fasterxml.jackson.databind.type.TypeParser.MyTokenizer tokens, int nestingAllowed)`
`TypeParser` `withFactory(TypeFactory f)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### MAX_TYPE_LENGTH

    protected static final int MAX_TYPE_LENGTH

Maximum length of canonical type definition we will try to parse. Used as protection for malformed generic type declarations.

Since:
  2.16
See Also:
  Constant Field Values

#### MAX_TYPE_NESTING

    protected static final int MAX_TYPE_NESTING

Maximum levels of nesting allowed for parameterized types. Used as protection for malformed generic type declarations.

Since:
  2.16
See Also:
  Constant Field Values

#### _factory

    protected final TypeFactory _factory

### Constructor Detail

#### TypeParser

    public TypeParser(TypeFactory f)

### Method Detail

#### withFactory

    public TypeParser withFactory(TypeFactory f)

Since:
  2.6.2

#### parse

    public JavaType parse(String canonical)
                   throws IllegalArgumentException

Throws:
  `IllegalArgumentException`

#### parseType

    protected JavaType parseType(com.fasterxml.jackson.databind.type.TypeParser.MyTokenizer tokens,
                                 int nestingAllowed)
                          throws IllegalArgumentException

Throws:
  `IllegalArgumentException`

#### parseTypes

    protected List<JavaType> parseTypes(com.fasterxml.jackson.databind.type.TypeParser.MyTokenizer tokens,
                                        int nestingAllowed)
                                 throws IllegalArgumentException

Throws:
  `IllegalArgumentException`

#### findClass

    protected Class<?> findClass(String className,
                                 com.fasterxml.jackson.databind.type.TypeParser.MyTokenizer tokens)

#### _problem

    protected IllegalArgumentException _problem(com.fasterxml.jackson.databind.type.TypeParser.MyTokenizer tokens,
                                                String msg)