ioinformarics.oss.jackson.module.jsonld.internal.JsonldResourceSerializerModifier Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jackson-jsonld Show documentation
Show all versions of jackson-jsonld Show documentation
JSON-LD Module for Jackson
The newest version!
package ioinformarics.oss.jackson.module.jsonld.internal;
import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.databind.ser.BeanSerializerModifier;
import com.fasterxml.jackson.databind.ser.std.BeanSerializerBase;
import ioinformarics.oss.jackson.module.jsonld.annotation.JsonldResource;
import ioinformarics.oss.jackson.module.jsonld.util.AnnotationsUtils;
/**
* @author Alexander De Leon
*/
public class JsonldResourceSerializerModifier extends BeanSerializerModifier {
@Override
public JsonSerializer> modifySerializer(SerializationConfig config, BeanDescription beanDesc, JsonSerializer> serializer) {
if(AnnotationsUtils.isAnnotationPresent(beanDesc.getBeanClass(), JsonldResource.class) && serializer instanceof BeanSerializerBase){
return new JsonldResourceSerializer((BeanSerializerBase) serializer);
}
return serializer;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy