io.ebeaninternal.server.deploy.meta.DeployBeanObtainJackson Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ebean Show documentation
Show all versions of ebean Show documentation
composite of common runtime dependencies for all platforms
package io.ebeaninternal.server.deploy.meta;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.introspect.AnnotatedClassResolver;
import io.ebean.config.ServerConfig;
/**
* Used to obtain the Jackson AnnotatedClass for a given bean type utlimately to obtain field level Jackson annotations.
*/
class DeployBeanObtainJackson {
private final ServerConfig serverConfig;
private final Class beanType;
DeployBeanObtainJackson(ServerConfig serverConfig, Class beanType) {
this.serverConfig = serverConfig;
this.beanType = beanType;
}
/**
* Return the Jackson AnnotatedClass for the given bean type.
*/
Object obtain() {
ObjectMapper objectMapper = (ObjectMapper) serverConfig.getObjectMapper();
JavaType javaType = objectMapper.getTypeFactory().constructType(beanType);
return AnnotatedClassResolver.resolve(objectMapper.getDeserializationConfig(), javaType, objectMapper.getDeserializationConfig());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy