Example #1
0
/*     */   public JsonNode getSchema(SerializerProvider provider, Type typeHint)
/*     */     throws JsonMappingException
/*     */   {
/* 203 */     ObjectNode o = createSchemaNode("array", true);
/* 204 */     if (typeHint != null) {
/* 205 */       JavaType javaType = TypeFactory.type(typeHint);
/* 206 */       if (javaType.isArrayType()) {
/* 207 */         Class componentType = ((ArrayType)javaType).getContentType().getRawClass();
/*     */ 
/* 209 */         if (componentType == Object.class) {
/* 210 */           o.put("items", JsonSchema.getDefaultSchemaNode());
/*     */         } else {
/* 212 */           JsonSerializer ser = provider.findValueSerializer(componentType, this._property);
/* 213 */           JsonNode schemaNode = (ser instanceof SchemaAware) ? ((SchemaAware)ser).getSchema(provider, null) : JsonSchema.getDefaultSchemaNode();
/*     */ 
/* 216 */           o.put("items", schemaNode);
/*     */         }
/*     */       }
/*     */     }
/* 220 */     return o;
/*     */   }
Example #2
0
/*     */   public void resolve(SerializerProvider provider)
/*     */     throws JsonMappingException
/*     */   {
/* 230 */     if (this._staticTyping)
/* 231 */       this._elementSerializer = provider.findValueSerializer(this._elementType, this._property);
/*     */   }