com.fasterxml.jackson.databind.deser.BeanDeserializerBuilder Java Examples

The following examples show how to use com.fasterxml.jackson.databind.deser.BeanDeserializerBuilder. 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: BeanDeserializerModifierForIgnorables.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Override
public BeanDeserializerBuilder updateBuilder(
	DeserializationConfig config, BeanDescription beanDesc,
	BeanDeserializerBuilder builder) {
	if (!type.equals(beanDesc.getBeanClass())) {
		return builder;
	}

	for (String ignorable : ignorables) {
		builder.addIgnorable(ignorable);
	}
	return builder;
}
 
Example #2
Source File: BeanDeserializerModifierForIgnorables.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public BeanDeserializerBuilder updateBuilder(
	DeserializationConfig config, BeanDescription beanDesc,
	BeanDeserializerBuilder builder) {
	if (!type.equals(beanDesc.getBeanClass())) {
		return builder;
	}

	for (String ignorable : ignorables) {
		builder.addIgnorable(ignorable);
	}
	return builder;
}
 
Example #3
Source File: AbstractBeanDeserializer.java    From caravan with Apache License 2.0 5 votes vote down vote up
public AbstractBeanDeserializer(BeanDeserializerBuilder builder,
    BeanDescription beanDesc,
    BeanPropertyMap properties,
    Map<String, SettableBeanProperty> backRefs, HashSet<String> ignorableProps,
    boolean ignoreAllUnknown, boolean hasViews) {
  super(builder, beanDesc, properties, backRefs, ignorableProps, ignoreAllUnknown, hasViews);
}
 
Example #4
Source File: KeeperBeanDeserializerModifier.java    From haven-platform with Apache License 2.0 5 votes vote down vote up
@Override
public BeanDeserializerBuilder updateBuilder(DeserializationConfig config, BeanDescription beanDesc, BeanDeserializerBuilder builder) {
    for (BeanPropertyDefinition propDef : beanDesc.findProperties()) {
        if (!propDef.hasGetter() || propDef.hasSetter()) {
            continue;
        }
        AnnotatedMember getter = propDef.getAccessor();
        if (!Keeper.class.equals(getter.getRawType())) {
            continue;
        }

        builder.addOrReplaceProperty(new CustomGetterBeanProperty(propDef, getter), true);
    }
    return builder;
}
 
Example #5
Source File: JacksonUtils.java    From JglTF with MIT License 5 votes vote down vote up
/**
 * Creates a BeanDeserializerModifier that replaces the 
 * SettableBeanProperties in the BeanDeserializerBuilder with
 * ErrorReportingSettableBeanProperty instances that forward
 * information about errors when setting bean properties to the
 * given consumer. (Don't ask ... )  
 * 
 * @param jsonErrorConsumer The consumer for {@link JsonError}s.
 * If this is <code>null</code>, then no errors will be reported.
 * @return The modifier
 */
private static BeanDeserializerModifier 
    createErrorHandlingBeanDeserializerModifier(
        Consumer<? super JsonError> jsonErrorConsumer)
{
    return new BeanDeserializerModifier()
    {
        @Override
        public BeanDeserializerBuilder updateBuilder(
            DeserializationConfig config,
            BeanDescription beanDesc,
            BeanDeserializerBuilder builder)
        {
            Iterator<SettableBeanProperty> propertiesIterator =
                builder.getProperties();
            while (propertiesIterator.hasNext())
            {
                SettableBeanProperty property = propertiesIterator.next();
                SettableBeanProperty wrappedProperty =
                    new ErrorReportingSettableBeanProperty(
                        property, jsonErrorConsumer);
                builder.addOrReplaceProperty(wrappedProperty, true);
            }
            return builder;
        }
    };    
}
 
Example #6
Source File: JacksonDeserializer.java    From hawkular-alerts with Apache License 2.0 5 votes vote down vote up
@Override
public BeanDeserializerBuilder updateBuilder(DeserializationConfig config, BeanDescription beanDesc,
        BeanDeserializerBuilder builder) {
    if (!thinnables.contains(beanDesc.getBeanClass())) {
        return builder;
    }
    for (String ignore : ignorables) {
        builder.addIgnorable(ignore);
    }
    return builder;
}
 
Example #7
Source File: BeanDeserializerModifierForIgnorables.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public BeanDeserializerBuilder updateBuilder(
	DeserializationConfig config, BeanDescription beanDesc,
	BeanDeserializerBuilder builder) {
	if (!type.equals(beanDesc.getBeanClass())) {
		return builder;
	}

	for (String ignorable : ignorables) {
		builder.addIgnorable(ignorable);
	}
	return builder;
}
 
Example #8
Source File: DurationDeserializer.java    From caravan with Apache License 2.0 4 votes vote down vote up
public DurationDeserializer(BeanDeserializerBuilder builder, BeanDescription beanDesc,
    BeanPropertyMap properties, Map<String, SettableBeanProperty> backRefs,
    HashSet<String> ignorableProps, boolean ignoreAllUnknown, boolean hasViews) {
  super(builder, beanDesc, properties, backRefs, ignorableProps, ignoreAllUnknown, hasViews);
}
 
Example #9
Source File: CalendarDeserializer.java    From caravan with Apache License 2.0 4 votes vote down vote up
public CalendarDeserializer(BeanDeserializerBuilder builder,
    BeanDescription beanDesc, BeanPropertyMap properties,
    Map<String, SettableBeanProperty> backRefs, HashSet<String> ignorableProps,
    boolean ignoreAllUnknown, boolean hasViews) {
  super(builder, beanDesc, properties, backRefs, ignorableProps, ignoreAllUnknown, hasViews);
}
 
Example #10
Source File: XMLGregorianCalendarDeserializer.java    From caravan with Apache License 2.0 4 votes vote down vote up
public XMLGregorianCalendarDeserializer(BeanDeserializerBuilder builder,
    BeanDescription beanDesc, BeanPropertyMap properties,
    Map<String, SettableBeanProperty> backRefs, HashSet<String> ignorableProps,
    boolean ignoreAllUnknown, boolean hasViews) {
  super(builder, beanDesc, properties, backRefs, ignorableProps, ignoreAllUnknown, hasViews);
}
 
Example #11
Source File: AbstractTypeCustomizationFactory.java    From caravan with Apache License 2.0 4 votes vote down vote up
public BuilderAndPropertyMap(BeanDeserializerBuilder builder, BeanPropertyMap propertyMap, BeanDescription beanDesc) {
  this.builder = builder;
  this.propertyMap = propertyMap;
  this.beanDesc = beanDesc;
}
 
Example #12
Source File: BigDecimalDeserializer.java    From caravan with Apache License 2.0 4 votes vote down vote up
public BigDecimalDeserializer(BeanDeserializerBuilder builder,
    BeanDescription beanDesc, BeanPropertyMap properties,
    Map<String, SettableBeanProperty> backRefs, HashSet<String> ignorableProps,
    boolean ignoreAllUnknown, boolean hasViews) {
  super(builder, beanDesc, properties, backRefs, ignorableProps, ignoreAllUnknown, hasViews);
}
 
Example #13
Source File: CustomBeanDeserializerFactory.java    From caravan with Apache License 2.0 4 votes vote down vote up
@Override
public void addBeanProps(DeserializationContext ctxt, BeanDescription beanDesc, BeanDeserializerBuilder builder) throws JsonMappingException {
  super.addBeanProps(ctxt, beanDesc, builder);
}
 
Example #14
Source File: CustomBeanDeserializerFactory.java    From caravan with Apache License 2.0 4 votes vote down vote up
@Override
public void addObjectIdReader(DeserializationContext ctxt, BeanDescription beanDesc, BeanDeserializerBuilder builder) throws JsonMappingException {
  super.addObjectIdReader(ctxt, beanDesc, builder);
}
 
Example #15
Source File: CustomBeanDeserializerFactory.java    From caravan with Apache License 2.0 4 votes vote down vote up
@Override
public void addBackReferenceProperties(DeserializationContext ctxt, BeanDescription beanDesc, BeanDeserializerBuilder builder) throws JsonMappingException {
  super.addBackReferenceProperties(ctxt, beanDesc, builder);
}
 
Example #16
Source File: CustomBeanDeserializerFactory.java    From caravan with Apache License 2.0 4 votes vote down vote up
@Override
public void addInjectables(DeserializationContext ctxt, BeanDescription beanDesc, BeanDeserializerBuilder builder) throws JsonMappingException {
  super.addInjectables(ctxt, beanDesc, builder);
}