/** * Method for constructing a {@link MapType} instance *<p> * NOTE: type modifiers are NOT called on constructed type itself; but are called * for contained types. * * @since 1.8 */ public MapType constructMapType(Class<? extends Map> mapClass, Class<?> keyClass, Class<?> valueClass) { return MapType.construct(mapClass, constructType(keyClass), constructType(valueClass)); }
/** * Method for constructing an {@link ArrayType}. *<p> * NOTE: type modifiers are NOT called on array type itself; but are called * for element type (and other contained types) */ public ArrayType constructArrayType(Class<?> elementType) { return ArrayType.construct(_constructType(elementType, null), null, null); }
/** * Method for constructing a {@link CollectionLikeType}. *<p> * NOTE: type modifiers are NOT called on constructed type itself; but are called * for contained types. * * @since 1.8 */ public CollectionLikeType constructCollectionLikeType(Class<?> collectionClass, Class<?> elementClass) { return CollectionLikeType.construct(collectionClass, constructType(elementClass)); }
/** * Method for constructing a {@link CollectionType}. *<p> * NOTE: type modifiers are NOT called on Collection type itself; but are called * for contained types. */ public CollectionType constructCollectionType(Class<? extends Collection> collectionClass, Class<?> elementClass) { return CollectionType.construct(collectionClass, constructType(elementClass)); }
protected synchronized HierarchicType _hashMapSuperInterfaceChain(HierarchicType current) { if (_cachedHashMapType == null) { HierarchicType base = current.deepCloneWithoutSubtype(); _doFindSuperInterfaceChain(base, Map.class); _cachedHashMapType = base.getSuperType(); } HierarchicType t = _cachedHashMapType.deepCloneWithoutSubtype(); current.setSuperType(t); t.setSubType(current); return current; }
/** * Convenience method for constructing {@link JavaType} out of given * type (typically <code>java.lang.Class</code>), but without explicit * context. * * @since 1.8 */ public JavaType constructType(Type t) { return _typeFactory.constructType(t); }
@Override public JsonDeserializer<?> findCollectionDeserializer(CollectionType type, DeserializationConfig config, DeserializerProvider provider, BeanDescription beanDesc, BeanProperty property, TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer) throws JsonMappingException { return (_classMappings == null) ? null : _classMappings.get(new ClassKey(type.getRawClass())); }
@Override public JsonDeserializer<?> findCollectionLikeDeserializer(CollectionLikeType type, DeserializationConfig config, DeserializerProvider provider, BeanDescription beanDesc, BeanProperty property, TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer) throws JsonMappingException { return (_classMappings == null) ? null : _classMappings.get(new ClassKey(type.getRawClass())); }
@Override public JsonDeserializer<?> findArrayDeserializer(ArrayType type, DeserializationConfig config, DeserializerProvider provider, BeanProperty property, TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer) throws JsonMappingException { return (_classMappings == null) ? null : _classMappings.get(new ClassKey(type.getRawClass())); }
public JavaType constructType(Type type, JavaType context) { TypeBindings b = (context == null) ? null : new TypeBindings(this, context); return _constructType(type, b); }
public JavaType[] findTypeParameters(Class<?> clz, Class<?> expType) { return findTypeParameters(clz, expType, new TypeBindings(this, clz)); }
@Override public ArrayType withValueHandler(Object h) { if (h == _valueHandler) { return this; } return new ArrayType(_componentType, _emptyArray, h, _typeHandler); }
@Override public SimpleType withTypeHandler(Object h) { return new SimpleType(_class, _typeNames, _typeParameters, _valueHandler, h); }
@Override protected JavaType _narrow(Class<?> subclass) { return new CollectionLikeType(subclass, _elementType, _valueHandler, _typeHandler); }
/** * Constructor used to create "child" instances; mostly to * allow delegation from explicitly defined local overrides * (local type variables for methods, constructors) to * contextual (class-defined) ones. * * @since 1.7 */ public TypeBindings childInstance() { return new TypeBindings(_typeFactory, this, _contextClass, _contextType); }
@Override public JavaType getValueType() { return SimpleType.construct(String.class); }
/** * Method for constructing a {@link MapLikeType} instance *<p> * NOTE: type modifiers are NOT called on constructed type itself; but are called * for contained types. * * @since 1.8 */ public MapLikeType constructMapLikeType(Class<?> mapClass, Class<?> keyClass, Class<?> valueClass) { return MapType.construct(mapClass, constructType(keyClass), constructType(valueClass)); }
protected synchronized HierarchicType _arrayListSuperInterfaceChain(HierarchicType current) { if (_cachedArrayListType == null) { HierarchicType base = current.deepCloneWithoutSubtype(); _doFindSuperInterfaceChain(base, List.class); _cachedArrayListType = base.getSuperType(); } HierarchicType t = _cachedArrayListType.deepCloneWithoutSubtype(); current.setSuperType(t); t.setSubType(current); return current; } }
protected JavaType _fromArrayType(GenericArrayType type, TypeBindings context) { JavaType compType = _constructType(type.getGenericComponentType(), context); return ArrayType.construct(compType, null, null); }
public JavaType constructType(Type type, Class<?> context) { TypeBindings b = (context == null) ? null : new TypeBindings(this, context); return _constructType(type, b); }