コード例 #1
0
 @Override
 public Object deserializeWithType(
     JsonParser jp, DeserializationContext ctxt, TypeDeserializer typeDeserializer)
     throws IOException, JsonProcessingException {
   // In future could check current token... for now this should be enough:
   return typeDeserializer.deserializeTypedFromObject(jp, ctxt);
 }
コード例 #2
0
  protected SettableBeanProperty(
      PropertyName propName,
      JavaType type,
      PropertyName wrapper,
      TypeDeserializer typeDeser,
      Annotations contextAnnotations,
      PropertyMetadata metadata) {
    // 09-Jan-2009, tatu: Intern()ing makes sense since Jackson parsed
    //  field names are (usually) interned too, hence lookups will be faster.
    // 23-Oct-2009, tatu: should this be disabled wrt [JACKSON-180]?
    //   Probably need not, given that namespace of field/method names
    //   is not unbounded, unlike potential JSON names.
    if (propName == null) {
      _propName = PropertyName.NO_NAME;
    } else {
      _propName = propName.internSimpleName();
    }
    _type = type;
    _wrapperName = wrapper;
    _metadata = metadata;
    _contextAnnotations = contextAnnotations;
    _viewMatcher = null;
    _nullProvider = null;

    // 30-Jan-2012, tatu: Important: contextualize TypeDeserializer now...
    if (typeDeser != null) {
      typeDeser = typeDeser.forProperty(this);
    }
    _valueTypeDeserializer = typeDeser;
    _valueDeserializer = MISSING_VALUE_DESERIALIZER;
  }
コード例 #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
 @Override
 public Object deserializeWithType(JsonParser jsonParser, DeserializationContext deserializationContext, TypeDeserializer typeDeserializer) throws IOException, JsonProcessingException {
     JsonToken jsonToken = jsonParser.getCurrentToken();
     switch (.$SwitchMap$com$fasterxml$jackson$core$JsonToken[jsonToken.ordinal()]) {
         default: {
             return null;
         }
         case 1: 
         case 2: 
         case 3: 
     }
     return typeDeserializer.deserializeTypedFromAny(jsonParser, deserializationContext);
 }
コード例 #5
0
 /**
  * Method called to finalize setup of this deserializer, when it is known for which property
  * deserializer is needed for.
  */
 @Override
 public JsonDeserializer<?> createContextual(DeserializationContext ctxt, BeanProperty property)
     throws JsonMappingException {
   // note: instead of finding key deserializer, with enums we actually
   // work with regular deserializers (less code duplication; but not
   // quite as clean as it ought to be)
   KeyDeserializer kd = _keyDeserializer;
   if (kd == null) {
     kd = ctxt.findKeyDeserializer(_mapType.getKeyType(), property);
   }
   JsonDeserializer<?> vd = _valueDeserializer;
   final JavaType vt = _mapType.getContentType();
   if (vd == null) {
     vd = ctxt.findContextualValueDeserializer(vt, property);
   } else { // if directly assigned, probably not yet contextual, so:
     vd = ctxt.handleSecondaryContextualization(vd, property, vt);
   }
   TypeDeserializer vtd = _valueTypeDeserializer;
   if (vtd != null) {
     vtd = vtd.forProperty(property);
   }
   return withResolved(kd, vd, vtd);
 }
コード例 #6
0
 @Override
 public Object deserializeWithType(
     JsonParser p, DeserializationContext ctxt, TypeDeserializer typeDeserializer)
     throws IOException {
   return typeDeserializer.deserializeTypedFromArray(p, ctxt);
 }
 public Object deserializeWithType(JsonParser paramJsonParser, DeserializationContext paramDeserializationContext, TypeDeserializer paramTypeDeserializer)
 {
   return paramTypeDeserializer.deserializeTypedFromArray(paramJsonParser, paramDeserializationContext);
 }