コード例 #1
0
 public JsonNode getSchema(SerializerProvider paramSerializerProvider, Type paramType)
     throws JsonMappingException {
   ObjectNode localObjectNode = createSchemaNode("array", true);
   if (paramType != null) {
     paramType = paramSerializerProvider.constructType(paramType);
     if (paramType.isArrayType()) {
       paramType = ((ArrayType) paramType).getContentType().getRawClass();
       if (paramType != Object.class) {
         break label54;
       }
       localObjectNode.set("items", JsonSchema.getDefaultSchemaNode());
     }
   }
   return localObjectNode;
   label54:
   paramType = paramSerializerProvider.findValueSerializer(paramType, this._property);
   if ((paramType instanceof SchemaAware)) {}
   for (paramSerializerProvider =
           ((SchemaAware) paramType).getSchema(paramSerializerProvider, null);
       ;
       paramSerializerProvider = JsonSchema.getDefaultSchemaNode()) {
     localObjectNode.set("items", paramSerializerProvider);
     return localObjectNode;
   }
 }
コード例 #2
0
 public JsonNode getSchema(SerializerProvider paramSerializerProvider, Type paramType)
     throws JsonMappingException {
   ObjectNode localObjectNode1 = createSchemaNode("object", true);
   if ((paramType instanceof ParameterizedType)) {
     Object localObject = ((ParameterizedType) paramType).getActualTypeArguments();
     if (localObject.length == 2) {
       paramType = paramSerializerProvider.constructType(localObject[0]);
       localObject = paramSerializerProvider.constructType(localObject[1]);
       ObjectNode localObjectNode2 = JsonNodeFactory.instance.objectNode();
       Enum[] arrayOfEnum = (Enum[]) paramType.getRawClass().getEnumConstants();
       int j = arrayOfEnum.length;
       int i = 0;
       if (i < j) {
         Enum localEnum = arrayOfEnum[i];
         paramType =
             paramSerializerProvider.findValueSerializer(
                 ((JavaType) localObject).getRawClass(), this._property);
         if ((paramType instanceof SchemaAware)) {}
         for (paramType = ((SchemaAware) paramType).getSchema(paramSerializerProvider, null);
             ;
             paramType = JsonSchema.getDefaultSchemaNode()) {
           localObjectNode2.set(
               paramSerializerProvider
                   .getConfig()
                   .getAnnotationIntrospector()
                   .findEnumValue(localEnum),
               paramType);
           i += 1;
           break;
         }
       }
       localObjectNode1.set("properties", localObjectNode2);
     }
   }
   return localObjectNode1;
 }
コード例 #3
0
 public void testSerializationContext() throws Exception {
   SerializerProvider ctxt = MAPPER.getSerializerProvider();
   assertNull(ctxt.constructType(null));
 }