Top Description Inners Fields Constructors Methods
com.fasterxml.jackson.databind.type

public Class TypeParser

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.util.*, com.fasterxml.jackson.databind.JavaType, com.fasterxml.jackson.databind.util.ClassUtil

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

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static class

Field Summary

Modifier and TypeField and Description
protected final TypeFactory
protected static final int
MAX_TYPE_LENGTH

Maximum length of canonical type definition we will try to parse.

protected static final int
MAX_TYPE_NESTING

Maximum levels of nesting allowed for parameterized types.

private static final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected IllegalArgumentException
private static String
protected Class<?>
public JavaType
parse(String canonical)

protected JavaType
parseType(TypeParser.MyTokenizer tokens, int nestingAllowed)

protected List<JavaType>
parseTypes(TypeParser.MyTokenizer tokens, int nestingAllowed)

public TypeParser
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_factoryback to summary
protected final TypeFactory _factory
MAX_TYPE_LENGTHback to summary
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
MAX_TYPE_NESTINGback to summary
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
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

TypeParserback to summary
public TypeParser(TypeFactory f)

Method Detail

_problemback to summary
protected IllegalArgumentException _problem(TypeParser.MyTokenizer tokens, String msg)
_quoteTruncatedback to summary
private static String _quoteTruncated(String str)
findClassback to summary
protected Class<?> findClass(String className, TypeParser.MyTokenizer tokens)
parseback to summary
public JavaType parse(String canonical) throws IllegalArgumentException
parseTypeback to summary
protected JavaType parseType(TypeParser.MyTokenizer tokens, int nestingAllowed) throws IllegalArgumentException
parseTypesback to summary
protected List<JavaType> parseTypes(TypeParser.MyTokenizer tokens, int nestingAllowed) throws IllegalArgumentException
withFactoryback to summary
public TypeParser withFactory(TypeFactory f)
Since
2.6.2
com.fasterxml.jackson.databind.type back to summary

protected final Class TypeParser.MyTokenizer

extends StringTokenizer
Class Inheritance

Field Summary

Modifier and TypeField and Description
protected int
protected final String
protected String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
public String
public boolean
hasMoreTokens()

Overrides java.util.StringTokenizer.hasMoreTokens.

Tests if there are more tokens available from this tokenizer's string.

public String
nextToken()

Overrides java.util.StringTokenizer.nextToken.

Returns the next token from this string tokenizer.

public void
Inherited from java.util.StringTokenizer:
countTokenshasMoreElementsnextElementnextToken

Field Detail

_indexback to summary
protected int _index
_inputback to summary
protected final String _input
_pushbackTokenback to summary
protected String _pushbackToken

Constructor Detail

MyTokenizerback to summary
public MyTokenizer(String str)

Method Detail

getAllInputback to summary
public String getAllInput()
getRemainingInputback to summary
public String getRemainingInput()
hasMoreTokensback to summary
public boolean hasMoreTokens()

Overrides java.util.StringTokenizer.hasMoreTokens.

Doc from java.util.StringTokenizer.hasMoreTokens.

Tests if there are more tokens available from this tokenizer's string. If this method returns true, then a subsequent call to nextToken with no argument will successfully return a token.

Returns:boolean

true if and only if there is at least one token in the string after the current position; false otherwise.

Annotations
@Override
nextTokenback to summary
public String nextToken()

Overrides java.util.StringTokenizer.nextToken.

Doc from java.util.StringTokenizer.nextToken.

Returns the next token from this string tokenizer.

Returns:String

the next token from this string tokenizer.

Annotations
@Override
pushBackback to summary
public void pushBack(String token)