@Override public JsonDeserializer<?> findMapLikeDeserializer(MapLikeType type, DeserializationConfig config, DeserializerProvider provider, BeanDescription beanDesc, BeanProperty property, KeyDeserializer keyDeserializer, TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer) throws JsonMappingException { return (_classMappings == null) ? null : _classMappings.get(new ClassKey(type.getRawClass())); }
@Override public MapLikeType withTypeHandler(Object h) { return new MapLikeType(_class, _keyType, _valueType, _valueHandler, h); }
@Override public StringBuilder getErasedSignature(StringBuilder sb) { return _classSignature(_class, sb, true); }
JavaType keyType = type.getKeyType(); JavaType contentType = type.getContentType();
@Override public JsonDeserializer<?> findMapLikeDeserializer(MapLikeType type, DeserializationConfig config, DeserializerProvider provider, BeanDescription beanDesc, BeanProperty property, KeyDeserializer keyDeserializer, TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer) throws JsonMappingException { if (type.getRawClass() == Map.class) { return new JSMapDeserializer(type, keyDeserializer, provider.findValueDeserializer(config, type.getContentType(), property), elementTypeDeserializer); } return super.findMapLikeDeserializer(type, config, provider, beanDesc, property, keyDeserializer, elementTypeDeserializer, elementDeserializer); }
if (mlt.isTrueMapType()) { return (JsonDeserializer<Object>)_factory.createMapDeserializer(config, this, (MapType) mlt, property);
/** * 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, JavaType keyType, JavaType valueType) { return MapLikeType.construct(mapClass, keyType, valueType); }
@Override public JavaType narrowContentsBy(Class<?> contentClass) { // Can do a quick check first: if (contentClass == _valueType.getRawClass()) { return this; } return new MapLikeType(_class, _keyType, _valueType.narrowBy(contentClass)).copyHandlers(this); }
type = (T) ((MapLikeType) type).narrowKey(keyClass); } catch (IllegalArgumentException iae) { throw new JsonMappingException("Failed to narrow key type "+type+" with key-type annotation ("+keyClass.getName()+"): "+iae.getMessage(), null, iae);
JavaType keyType = type.getKeyType(); JavaType contentType = type.getContentType();
MapLikeType mlt = (MapLikeType) type; JsonSerializer<Object> keySerializer = findKeySerializer(config, beanDesc.getClassInfo(), property); if (mlt.isTrueMapType()) { return buildMapSerializer(config, (MapType) mlt, beanDesc, property, staticTyping, keySerializer, elementTypeSerializer, elementValueSerializer);
/** * Method that can be used to construct "raw" Map-like type; meaning that its * parameterization is unknown. * This is similar to using <code>Object.class</code> parameterization, * and is equivalent to calling: *<pre> * typeFactory.constructMapLikeType(collectionClass, typeFactory.unknownType(), typeFactory.unknownType()); *<pre> *<p> * This method should only be used if parameterization is completely unavailable. * * @since 1.9 */ public MapLikeType constructRawMapLikeType(Class<?> mapClass) { return MapLikeType.construct(mapClass, unknownType(), unknownType()); }
@Override public JavaType widenContentsBy(Class<?> contentClass) { if (contentClass == _valueType.getRawClass()) { return this; } return new MapLikeType(_class, _keyType, _valueType.widenBy(contentClass)).copyHandlers(this); }
type = (T) ((MapLikeType) type).narrowKey(keyClass); } catch (IllegalArgumentException iae) { throw new JsonMappingException("Failed to narrow key type "+type+" with key-type annotation ("+keyClass.getName()+"): "+iae.getMessage(), null, iae);
public static MapLikeType construct(Class<?> rawType, JavaType keyT, JavaType valueT) { // nominally component types will be just Object.class return new MapLikeType(rawType, keyT, valueT, null, null); }
JavaType keyType = type.getKeyType(); JavaType contentType = type.getContentType();
@Override public StringBuilder getGenericSignature(StringBuilder sb) { _classSignature(_class, sb, false); sb.append('<'); _keyType.getGenericSignature(sb); _valueType.getGenericSignature(sb); sb.append(">;"); return sb; }
if (mlt.isTrueMapType()) { return (JsonDeserializer<Object>)_factory.createMapDeserializer(config, this, (MapType) mlt, property);
/** * 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, JavaType keyType, JavaType valueType) { return MapLikeType.construct(mapClass, keyType, valueType); }
@Override public JsonDeserializer<?> findMapLikeDeserializer(MapLikeType type, DeserializationConfig config, DeserializerProvider provider, BeanDescription beanDesc, BeanProperty property, KeyDeserializer keyDeserializer, TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer) throws JsonMappingException { return (_classMappings == null) ? null : _classMappings.get(new ClassKey(type.getRawClass())); }