コード例 #1
0
 /**
  * Convenience method, functionally same as:
  *
  * <pre>
  *  getDeserializerProvider().findKeyDeserializer(getConfig(), propertyType, property);
  * </pre>
  */
 public final KeyDeserializer findKeyDeserializer(JavaType keyType, BeanProperty property)
     throws JsonMappingException {
   KeyDeserializer kd = _cache.findKeyDeserializer(this, _factory, keyType);
   // Second: contextualize?
   if (kd instanceof ContextualKeyDeserializer) {
     kd = ((ContextualKeyDeserializer) kd).createContextual(this, property);
   }
   return kd;
 }
コード例 #2
0
 /**
  * Method for finding a value deserializer, and creating a contextual version if necessary, for
  * value reached via specified property.
  */
 @SuppressWarnings("unchecked")
 public final JsonDeserializer<Object> findContextualValueDeserializer(
     JavaType type, BeanProperty property) throws JsonMappingException {
   JsonDeserializer<Object> deser = _cache.findValueDeserializer(this, _factory, type);
   if (deser != null) {
     if (deser instanceof ContextualDeserializer) {
       deser =
           (JsonDeserializer<Object>)
               ((ContextualDeserializer) deser).createContextual(this, property);
     }
   }
   return deser;
 }
コード例 #3
0
 /** Method for finding a deserializer for root-level value. */
 @SuppressWarnings("unchecked")
 public final JsonDeserializer<Object> findRootValueDeserializer(JavaType type)
     throws JsonMappingException {
   JsonDeserializer<Object> deser = _cache.findValueDeserializer(this, _factory, type);
   if (deser == null) { // can this occur?
     return null;
   }
   if (deser instanceof ContextualDeserializer) {
     deser =
         (JsonDeserializer<Object>) ((ContextualDeserializer) deser).createContextual(this, null);
   }
   TypeDeserializer typeDeser = _factory.findTypeDeserializer(_config, type);
   if (typeDeser != null) {
     // important: contextualize to indicate this is for root value
     typeDeser = typeDeser.forProperty(null);
     return new TypeWrappedDeserializer(typeDeser, deser);
   }
   return deser;
 }
コード例 #4
0
 /** Method for checking whether we could find a deserializer for given type. */
 public boolean hasValueDeserializerFor(JavaType type) {
   return _cache.hasValueDeserializerFor(this, _factory, type);
 }