Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.fasterxml.jackson.databind.deser.impl;
 
 import java.util.*;
 
Object that is responsible for handling acrobatics related to deserializing "unwrapped" values; sets of properties that are embedded (inlined) as properties of parent JSON object.
    
    public UnwrappedPropertyHandler()  { }
    public void addProperty(SettableBeanProperty property) {
        .add(property);
    }
    public void renameAll(NameTransformer transformer)
    {
        Iterator<SettableBeanPropertyit = oldProps.iterator();
        .clear();
        while (it.hasNext()) {
            SettableBeanProperty prop = it.next();
            String newName = transformer.transform(prop.getName());
            prop = prop.withName(newName);
            JsonDeserializer<?> deser = prop.getValueDeserializer();
            if (deser != null) {
                @SuppressWarnings("unchecked")
                JsonDeserializer<ObjectnewDeser = (JsonDeserializer<Object>)
                    deser.unwrappingDeserializer(transformer);
                if (newDeser != deser) {
                    prop = prop.withValueDeserializer(newDeser);
                }
            }
            .add(prop);
        }
    }
    
    public Object processUnwrapped(JsonParser originalParserDeserializationContext ctxtObject bean,
            TokenBuffer buffered)
        throws IOExceptionJsonProcessingException
    {
        for (int i = 0, len = .size(); i < len; ++i) {
            SettableBeanProperty prop = .get(i);
            JsonParser jp = buffered.asParser();
            jp.nextToken();
            prop.deserializeAndSet(jpctxtbean);
        }
        return bean;
    }
New to GrepCode? Check out our FAQ X