com.talanlabs.componentjackson.ComponentValueInstantiators Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of component-jackson Show documentation
Show all versions of component-jackson Show documentation
Module Jackson for Component Bean
The newest version!
package com.talanlabs.componentjackson;
import com.fasterxml.jackson.databind.BeanDescription;
import com.fasterxml.jackson.databind.DeserializationConfig;
import com.fasterxml.jackson.databind.deser.ValueInstantiator;
import com.fasterxml.jackson.databind.module.SimpleValueInstantiators;
import com.talanlabs.component.IComponent;
import com.talanlabs.component.factory.ComponentFactory;
public class ComponentValueInstantiators extends SimpleValueInstantiators {
@Override
public ValueInstantiator findValueInstantiator(DeserializationConfig config, BeanDescription beanDesc, ValueInstantiator defaultInstantiator) {
if (ComponentFactory.getInstance().isComponentType(beanDesc.getBeanClass())) {
defaultInstantiator = new ComponentValueInstantiator((Class extends IComponent>) beanDesc.getBeanClass(), defaultInstantiator);
}
return super.findValueInstantiator(config, beanDesc, defaultInstantiator);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy