public JsonNode getSchema(SerializerProvider provider, Type typeHint) throws JsonMappingException { ObjectNode o = createSchemaNode("array", true); if (typeHint != null) { JavaType javaType = TypeFactory.type(typeHint); if (javaType.isArrayType()) { Class<?> componentType = ((ArrayType) javaType).getContentType().getRawClass(); JsonSerializer<Object> ser = provider.findValueSerializer(componentType); JsonNode schemaNode = (ser instanceof SchemaAware) ? ((SchemaAware) ser).getSchema(provider, null) : JsonSchema.getDefaultSchemaNode(); o.put("items", schemaNode); } } return o; }
@SuppressWarnings("unchecked") public static <T> T[] string2Array(String json, Class<T> clazz) { JavaType type = ArrayType.construct(typeFactory.constructType(clazz)); try { return (T[]) mapper.readValue(json, type); } catch(Exception e) { return null; } }
@Override public JsonDeserializer<?> createArrayDeserializer(final DeserializationConfig config, final DeserializerProvider p, final ArrayType type, final BeanProperty property) throws JsonMappingException { return nonCollectionPageStrategy.createArrayDeserializer(config, p, type, property); }
protected JsonSerializer<?> buildArraySerializer(SerializationConfig paramSerializationConfig, ArrayType paramArrayType, BasicBeanDescription paramBasicBeanDescription, BeanProperty paramBeanProperty, boolean paramBoolean, TypeSerializer paramTypeSerializer, JsonSerializer<Object> paramJsonSerializer) { Class localClass = paramArrayType.getRawClass(); Object localObject; if ([Ljava.lang.String.class == localClass) localObject = new ArraySerializers.StringArraySerializer(paramBeanProperty); do { return localObject; localObject = (JsonSerializer)_arraySerializers.get(localClass.getName()); } while (localObject != null); return (JsonSerializer<?>)new ObjectArraySerializer(paramArrayType.getContentType(), paramBoolean, paramTypeSerializer, paramBeanProperty, paramJsonSerializer); }
public JsonSerializer<?> buildContainerSerializer(SerializationConfig paramSerializationConfig, JavaType paramJavaType, BasicBeanDescription paramBasicBeanDescription, BeanProperty paramBeanProperty, boolean paramBoolean) { TypeSerializer localTypeSerializer = createTypeSerializer(paramSerializationConfig, paramJavaType.getContentType(), paramBeanProperty); if (localTypeSerializer != null) paramBoolean = false; JsonSerializer localJsonSerializer1; while (true) { localJsonSerializer1 = findContentSerializer(paramSerializationConfig, paramBasicBeanDescription.getClassInfo(), paramBeanProperty); if (!paramJavaType.isMapLikeType()) break; MapLikeType localMapLikeType = (MapLikeType)paramJavaType; JsonSerializer localJsonSerializer2 = findKeySerializer(paramSerializationConfig, paramBasicBeanDescription.getClassInfo(), paramBeanProperty); if (localMapLikeType.isTrueMapType()) { return buildMapSerializer(paramSerializationConfig, (MapType)localMapLikeType, paramBasicBeanDescription, paramBeanProperty, paramBoolean, localJsonSerializer2, localTypeSerializer, localJsonSerializer1); if (paramBoolean) continue; paramBoolean = usesStaticTyping(paramSerializationConfig, paramBasicBeanDescription, localTypeSerializer, paramBeanProperty); continue; } return buildMapLikeSerializer(paramSerializationConfig, localMapLikeType, paramBasicBeanDescription, paramBeanProperty, paramBoolean, localJsonSerializer2, localTypeSerializer, localJsonSerializer1); } if (paramJavaType.isCollectionLikeType()) { CollectionLikeType localCollectionLikeType = (CollectionLikeType)paramJavaType; if (localCollectionLikeType.isTrueCollectionType()) return buildCollectionSerializer(paramSerializationConfig, (CollectionType)localCollectionLikeType, paramBasicBeanDescription, paramBeanProperty, paramBoolean, localTypeSerializer, localJsonSerializer1); return buildCollectionLikeSerializer(paramSerializationConfig, localCollectionLikeType, paramBasicBeanDescription, paramBeanProperty, paramBoolean, localTypeSerializer, localJsonSerializer1); } if (paramJavaType.isArrayType()) return buildArraySerializer(paramSerializationConfig, (ArrayType)paramJavaType, paramBasicBeanDescription, paramBeanProperty, paramBoolean, localTypeSerializer, localJsonSerializer1); return null; }
public JsonDeserializer<?> findArrayDeserializer(ArrayType paramArrayType, DeserializationConfig paramDeserializationConfig, DeserializerProvider paramDeserializerProvider, BeanProperty paramBeanProperty, TypeDeserializer paramTypeDeserializer, JsonDeserializer<?> paramJsonDeserializer) throws JsonMappingException { if (this._classMappings == null) return null; return (JsonDeserializer)this._classMappings.get(new ClassKey(paramArrayType.getRawClass())); }
public JsonDeserializer<?> createArrayDeserializer(DeserializationConfig paramDeserializationConfig, DeserializerProvider paramDeserializerProvider, ArrayType paramArrayType, BeanProperty paramBeanProperty) throws JsonMappingException { JavaType localJavaType = paramArrayType.getContentType(); JsonDeserializer localJsonDeserializer1 = (JsonDeserializer)localJavaType.getValueHandler(); if (localJsonDeserializer1 == null) { Object localObject = (JsonDeserializer)_arrayDeserializers.get(localJavaType); if (localObject != null) { JsonDeserializer localJsonDeserializer3 = _findCustomArrayDeserializer(paramArrayType, paramDeserializationConfig, paramDeserializerProvider, paramBeanProperty, null, null); if (localJsonDeserializer3 != null) localObject = localJsonDeserializer3; return localObject; } if (localJavaType.isPrimitive()) throw new IllegalArgumentException("Internal error: primitive type (" + paramArrayType + ") passed, no array deserializer found"); } TypeDeserializer localTypeDeserializer = (TypeDeserializer)localJavaType.getTypeHandler(); if (localTypeDeserializer == null) localTypeDeserializer = findTypeDeserializer(paramDeserializationConfig, localJavaType, paramBeanProperty); JsonDeserializer localJsonDeserializer2 = _findCustomArrayDeserializer(paramArrayType, paramDeserializationConfig, paramDeserializerProvider, paramBeanProperty, localTypeDeserializer, localJsonDeserializer1); if (localJsonDeserializer2 != null) return localJsonDeserializer2; if (localJsonDeserializer1 == null) localJsonDeserializer1 = paramDeserializerProvider.findValueDeserializer(paramDeserializationConfig, localJavaType, paramBeanProperty); return (JsonDeserializer<?>)new ArrayDeserializer(paramArrayType, localJsonDeserializer1, localTypeDeserializer); }
protected JsonDeserializer<Object> _createDeserializer(DeserializationConfig paramDeserializationConfig, JavaType paramJavaType, BeanProperty paramBeanProperty) throws JsonMappingException { if (paramJavaType.isEnumType()) return this._factory.createEnumDeserializer(paramDeserializationConfig, this, paramJavaType, paramBeanProperty); if (paramJavaType.isContainerType()) { if (paramJavaType.isArrayType()) return this._factory.createArrayDeserializer(paramDeserializationConfig, this, (ArrayType)paramJavaType, paramBeanProperty); if (paramJavaType.isMapLikeType()) { MapLikeType localMapLikeType = (MapLikeType)paramJavaType; if (localMapLikeType.isTrueMapType()) return this._factory.createMapDeserializer(paramDeserializationConfig, this, (MapType)localMapLikeType, paramBeanProperty); return this._factory.createMapLikeDeserializer(paramDeserializationConfig, this, localMapLikeType, paramBeanProperty); } if (paramJavaType.isCollectionLikeType()) { CollectionLikeType localCollectionLikeType = (CollectionLikeType)paramJavaType; if (localCollectionLikeType.isTrueCollectionType()) return this._factory.createCollectionDeserializer(paramDeserializationConfig, this, (CollectionType)localCollectionLikeType, paramBeanProperty); return this._factory.createCollectionLikeDeserializer(paramDeserializationConfig, this, localCollectionLikeType, paramBeanProperty); } } if (JsonNode.class.isAssignableFrom(paramJavaType.getRawClass())) return this._factory.createTreeDeserializer(paramDeserializationConfig, this, paramJavaType, paramBeanProperty); return this._factory.createBeanDeserializer(paramDeserializationConfig, this, paramJavaType, paramBeanProperty); }
public ArrayDeserializer(ArrayType paramArrayType, JsonDeserializer<Object> paramJsonDeserializer, TypeDeserializer paramTypeDeserializer) { super([Ljava.lang.Object.class); this._arrayType = paramArrayType; this._elementClass = paramArrayType.getContentType().getRawClass(); if (this._elementClass == Object.class); for (boolean bool = true; ; bool = false) { this._untyped = bool; this._elementDeserializer = paramJsonDeserializer; this._elementTypeDeserializer = paramTypeDeserializer; return; } }
public JsonDeserializer<?> createArrayDeserializer(DeserializationConfig paramDeserializationConfig, DeserializerProvider paramDeserializerProvider, ArrayType paramArrayType, BeanProperty paramBeanProperty) throws JsonMappingException { ClassKey localClassKey = new ClassKey(paramArrayType.getRawClass()); if (this._directClassMappings != null) { JsonDeserializer localJsonDeserializer = (JsonDeserializer)this._directClassMappings.get(localClassKey); if (localJsonDeserializer != null) return localJsonDeserializer; } return super.createArrayDeserializer(paramDeserializationConfig, paramDeserializerProvider, paramArrayType, paramBeanProperty); }
protected JsonDeserializer<?> _findCustomArrayDeserializer(ArrayType paramArrayType, DeserializationConfig paramDeserializationConfig, DeserializerProvider paramDeserializerProvider, BeanProperty paramBeanProperty, TypeDeserializer paramTypeDeserializer, JsonDeserializer<?> paramJsonDeserializer) throws JsonMappingException { Iterator localIterator = this._factoryConfig.deserializers().iterator(); while (localIterator.hasNext()) { JsonDeserializer localJsonDeserializer = ((Deserializers)localIterator.next()).findArrayDeserializer(paramArrayType, paramDeserializationConfig, paramDeserializerProvider, paramBeanProperty, paramTypeDeserializer, paramJsonDeserializer); if (localJsonDeserializer != null) return localJsonDeserializer; } return null; }
public ArrayDeserializer(ArrayType arrayType, JsonDeserializer<Object> elemDeser, TypeDeserializer elemTypeDeser) { super(Object[].class); _arrayType = arrayType; _elementClass = arrayType.getContentType().getRawClass(); _untyped = (_elementClass == Object.class); _elementDeserializer = elemDeser; _elementTypeDeserializer = elemTypeDeser; }
protected JsonSerializer<?> buildArraySerializer(SerializationConfig paramSerializationConfig, ArrayType paramArrayType, BasicBeanDescription paramBasicBeanDescription, BeanProperty paramBeanProperty, boolean paramBoolean, TypeSerializer paramTypeSerializer, JsonSerializer<Object> paramJsonSerializer) { Class localClass = paramArrayType.getRawClass(); Object localObject; if ([Ljava.lang.String.class == localClass) localObject = new StdArraySerializers.StringArraySerializer(paramBeanProperty); do { return localObject; localObject = (JsonSerializer)_arraySerializers.get(localClass.getName()); } while (localObject != null); return new ObjectArraySerializer(paramArrayType.getContentType(), paramBoolean, paramTypeSerializer, paramBeanProperty, paramJsonSerializer); }
public JsonSerializer<?> buildContainerSerializer(SerializationConfig paramSerializationConfig, JavaType paramJavaType, BasicBeanDescription paramBasicBeanDescription, BeanProperty paramBeanProperty, boolean paramBoolean) { TypeSerializer localTypeSerializer = createTypeSerializer(paramSerializationConfig, paramJavaType.getContentType(), paramBeanProperty); boolean bool; if (localTypeSerializer != null) bool = false; while (true) { JsonSerializer localJsonSerializer1 = findContentSerializer(paramSerializationConfig, paramBasicBeanDescription.getClassInfo(), paramBeanProperty); if (paramJavaType.isMapLikeType()) { MapLikeType localMapLikeType = (MapLikeType)paramJavaType; JsonSerializer localJsonSerializer2 = findKeySerializer(paramSerializationConfig, paramBasicBeanDescription.getClassInfo(), paramBeanProperty); if (localMapLikeType.isTrueMapType()) { return buildMapSerializer(paramSerializationConfig, (MapType)localMapLikeType, paramBasicBeanDescription, paramBeanProperty, bool, localJsonSerializer2, localTypeSerializer, localJsonSerializer1); if (!paramBoolean) bool = usesStaticTyping(paramSerializationConfig, paramBasicBeanDescription, localTypeSerializer, paramBeanProperty); } else { return buildMapLikeSerializer(paramSerializationConfig, localMapLikeType, paramBasicBeanDescription, paramBeanProperty, bool, localJsonSerializer2, localTypeSerializer, localJsonSerializer1); } } else { if (paramJavaType.isCollectionLikeType()) { CollectionLikeType localCollectionLikeType = (CollectionLikeType)paramJavaType; if (localCollectionLikeType.isTrueCollectionType()) return buildCollectionSerializer(paramSerializationConfig, (CollectionType)localCollectionLikeType, paramBasicBeanDescription, paramBeanProperty, bool, localTypeSerializer, localJsonSerializer1); return buildCollectionLikeSerializer(paramSerializationConfig, localCollectionLikeType, paramBasicBeanDescription, paramBeanProperty, bool, localTypeSerializer, localJsonSerializer1); } if (paramJavaType.isArrayType()) return buildArraySerializer(paramSerializationConfig, (ArrayType)paramJavaType, paramBasicBeanDescription, paramBeanProperty, bool, localTypeSerializer, localJsonSerializer1); return null; bool = paramBoolean; } } }
public ObjectArrayDeserializer(ArrayType paramArrayType, JsonDeserializer<Object> paramJsonDeserializer, TypeDeserializer paramTypeDeserializer) { super([Ljava.lang.Object.class); this._arrayType = paramArrayType; this._elementClass = paramArrayType.getContentType().getRawClass(); if (this._elementClass == Object.class); for (boolean bool = true; ; bool = false) { this._untyped = bool; this._elementDeserializer = paramJsonDeserializer; this._elementTypeDeserializer = paramTypeDeserializer; return; } }
protected JsonDeserializer<Object> _createDeserializer(DeserializationConfig paramDeserializationConfig, JavaType paramJavaType, BeanProperty paramBeanProperty) { if (paramJavaType.isEnumType()) return this._factory.createEnumDeserializer(paramDeserializationConfig, this, paramJavaType, paramBeanProperty); if (paramJavaType.isContainerType()) { if (paramJavaType.isArrayType()) return this._factory.createArrayDeserializer(paramDeserializationConfig, this, (ArrayType)paramJavaType, paramBeanProperty); if (paramJavaType.isMapLikeType()) { MapLikeType localMapLikeType = (MapLikeType)paramJavaType; if (localMapLikeType.isTrueMapType()) return this._factory.createMapDeserializer(paramDeserializationConfig, this, (MapType)localMapLikeType, paramBeanProperty); return this._factory.createMapLikeDeserializer(paramDeserializationConfig, this, localMapLikeType, paramBeanProperty); } if (paramJavaType.isCollectionLikeType()) { CollectionLikeType localCollectionLikeType = (CollectionLikeType)paramJavaType; if (localCollectionLikeType.isTrueCollectionType()) return this._factory.createCollectionDeserializer(paramDeserializationConfig, this, (CollectionType)localCollectionLikeType, paramBeanProperty); return this._factory.createCollectionLikeDeserializer(paramDeserializationConfig, this, localCollectionLikeType, paramBeanProperty); } } if (JsonNode.class.isAssignableFrom(paramJavaType.getRawClass())) return this._factory.createTreeDeserializer(paramDeserializationConfig, this, paramJavaType, paramBeanProperty); return this._factory.createBeanDeserializer(paramDeserializationConfig, this, paramJavaType, paramBeanProperty); }
protected JsonDeserializer<?> _findCustomArrayDeserializer(ArrayType paramArrayType, DeserializationConfig paramDeserializationConfig, DeserializerProvider paramDeserializerProvider, BeanProperty paramBeanProperty, TypeDeserializer paramTypeDeserializer, JsonDeserializer<?> paramJsonDeserializer) { Iterator localIterator = this._factoryConfig.deserializers().iterator(); while (localIterator.hasNext()) { JsonDeserializer localJsonDeserializer = ((Deserializers)localIterator.next()).findArrayDeserializer(paramArrayType, paramDeserializationConfig, paramDeserializerProvider, paramBeanProperty, paramTypeDeserializer, paramJsonDeserializer); if (localJsonDeserializer != null) return localJsonDeserializer; } return null; }
public abstract JsonDeserializer<?> createArrayDeserializer(DeserializationConfig paramDeserializationConfig, DeserializerProvider paramDeserializerProvider, ArrayType paramArrayType, BeanProperty paramBeanProperty) throws JsonMappingException;
@Deprecated public final JsonDeserializer<?> createArrayDeserializer(DeserializationConfig paramDeserializationConfig, ArrayType paramArrayType, DeserializerProvider paramDeserializerProvider) throws JsonMappingException { return createArrayDeserializer(paramDeserializationConfig, paramDeserializerProvider, paramArrayType, null); }
public abstract JsonDeserializer<?> findArrayDeserializer(ArrayType paramArrayType, DeserializationConfig paramDeserializationConfig, DeserializerProvider paramDeserializerProvider, BeanProperty paramBeanProperty, TypeDeserializer paramTypeDeserializer, JsonDeserializer<?> paramJsonDeserializer) throws JsonMappingException;
public JsonDeserializer<?> findArrayDeserializer(ArrayType paramArrayType, DeserializationConfig paramDeserializationConfig, DeserializerProvider paramDeserializerProvider, BeanProperty paramBeanProperty, TypeDeserializer paramTypeDeserializer, JsonDeserializer<?> paramJsonDeserializer) throws JsonMappingException { return null; }
public JsonSerializer<?> findArraySerializer(SerializationConfig paramSerializationConfig, ArrayType paramArrayType, BeanDescription paramBeanDescription, BeanProperty paramBeanProperty, TypeSerializer paramTypeSerializer, JsonSerializer<Object> paramJsonSerializer) { return findSerializer(paramSerializationConfig, paramArrayType, paramBeanDescription, paramBeanProperty); }
protected abstract JsonDeserializer<?> _findCustomArrayDeserializer(ArrayType paramArrayType, DeserializationConfig paramDeserializationConfig, DeserializerProvider paramDeserializerProvider, BeanProperty paramBeanProperty, TypeDeserializer paramTypeDeserializer, JsonDeserializer<?> paramJsonDeserializer) throws JsonMappingException;
@Deprecated public ArrayDeserializer(ArrayType paramArrayType, JsonDeserializer<Object> paramJsonDeserializer) { this(paramArrayType, paramJsonDeserializer, null); }
public JsonSerializer<?> findArraySerializer(SerializationConfig paramSerializationConfig, ArrayType paramArrayType, BeanDescription paramBeanDescription, BeanProperty paramBeanProperty, TypeSerializer paramTypeSerializer, JsonSerializer<Object> paramJsonSerializer) { return null; }
@Deprecated public ArrayDeserializer(ArrayType arrayType, JsonDeserializer<Object> elemDeser) { this(arrayType, elemDeser, null); }