com.fasterxml.jackson.module.mrbean.MrBeanModule Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jackson-module-mrbean Show documentation
Show all versions of jackson-module-mrbean Show documentation
Functionality for implementing interfaces and abstract types
dynamically ("bean materialization"), integrated with Jackson (although usable externally as well)
package com.fasterxml.jackson.module.mrbean;
import com.fasterxml.jackson.core.Version;
public class MrBeanModule extends com.fasterxml.jackson.databind.Module
{
/**
* Configured materializer instance to register with deserializer factory.
*/
protected AbstractTypeMaterializer _materializer;
/*
/**********************************************************
/* Life-cycle
/**********************************************************
*/
public MrBeanModule() {
this(new AbstractTypeMaterializer());
}
public MrBeanModule(AbstractTypeMaterializer materializer) {
_materializer = materializer;
}
@Override
public String getModuleName() {
return getClass().getSimpleName();
}
@Override
public Version version() {
return PackageVersion.VERSION;
}
@Override
public void setupModule(SetupContext context)
{
// All we really need to for now is to register materializer:
context.addAbstractTypeResolver(_materializer);
}
/*
/**********************************************************
/* Extended API
/**********************************************************
*/
/**
* Accessor for getting internal {@link AbstractTypeMaterializer}.
*/
public AbstractTypeMaterializer getMaterializer() {
return _materializer;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy