Java Code Examples for com.fasterxml.jackson.databind.deser.SettableBeanProperty#getValueDeserializer()

The following examples show how to use com.fasterxml.jackson.databind.deser.SettableBeanProperty#getValueDeserializer() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BeanPropertyMap.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
protected SettableBeanProperty _rename(SettableBeanProperty prop, NameTransformer xf)
{
    if (prop == null) {
        return prop;
    }
    String newName = xf.transform(prop.getName());
    prop = prop.withSimpleName(newName);
    JsonDeserializer<?> deser = prop.getValueDeserializer();
    if (deser != null) {
        @SuppressWarnings("unchecked")
        JsonDeserializer<Object> newDeser = (JsonDeserializer<Object>)
            deser.unwrappingDeserializer(xf);
        if (newDeser != deser) {
            prop = prop.withValueDeserializer(newDeser);
        }
    }
    return prop;
}
 
Example 2
Source File: PropertyValueBuffer.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
protected Object _findMissing(SettableBeanProperty prop) throws JsonMappingException
{
    // First: do we have injectable value?
    Object injectableValueId = prop.getInjectableValueId();
    if (injectableValueId != null) {
        return _context.findInjectableValue(prop.getInjectableValueId(),
                prop, null);
    }
    // Second: required?
    if (prop.isRequired()) {
        _context.reportInputMismatch(prop, "Missing required creator property '%s' (index %d)",
                prop.getName(), prop.getCreatorIndex());
    }
    if (_context.isEnabled(DeserializationFeature.FAIL_ON_MISSING_CREATOR_PROPERTIES)) {
        _context.reportInputMismatch(prop,
                "Missing creator property '%s' (index %d); `DeserializationFeature.FAIL_ON_MISSING_CREATOR_PROPERTIES` enabled",
                prop.getName(), prop.getCreatorIndex());
    }
    // Third: default value
    JsonDeserializer<Object> deser = prop.getValueDeserializer();
    return deser.getNullValue(_context);
}
 
Example 3
Source File: UnwrappedPropertyHandler.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
public UnwrappedPropertyHandler renameAll(NameTransformer transformer)
{
    ArrayList<SettableBeanProperty> newProps = new ArrayList<SettableBeanProperty>(_properties.size());
    for (SettableBeanProperty prop : _properties) {
        String newName = transformer.transform(prop.getName());
        prop = prop.withSimpleName(newName);
        JsonDeserializer<?> deser = prop.getValueDeserializer();
        if (deser != null) {
            @SuppressWarnings("unchecked")
            JsonDeserializer<Object> newDeser = (JsonDeserializer<Object>)
                deser.unwrappingDeserializer(transformer);
            if (newDeser != deser) {
                prop = prop.withValueDeserializer(newDeser);
            }
        }
        newProps.add(prop);
    }
    return new UnwrappedPropertyHandler(newProps);
}