public final class PojoCodecProvider extends java.lang.Object implements CodecProvider
Modifier and Type | Class and Description |
---|---|
static class |
PojoCodecProvider.Builder
A Builder for the PojoCodecProvider
|
Modifier and Type | Field and Description |
---|---|
private boolean |
automatic |
private java.util.Map<java.lang.Class<?>,ClassModel<?>> |
classModels |
private java.util.List<Convention> |
conventions |
private DiscriminatorLookup |
discriminatorLookup |
private java.util.Set<java.lang.String> |
packages |
Modifier | Constructor and Description |
---|---|
private |
PojoCodecProvider(boolean automatic,
java.util.Map<java.lang.Class<?>,ClassModel<?>> classModels,
java.util.Set<java.lang.String> packages,
java.util.List<Convention> conventions) |
Modifier and Type | Method and Description |
---|---|
static PojoCodecProvider.Builder |
builder()
Creates a Builder so classes or packages can be registered and configured before creating an immutable CodecProvider.
|
private static <T> ClassModel<T> |
createClassModel(java.lang.Class<T> clazz,
java.util.List<Convention> conventions) |
<T> Codec<T> |
get(java.lang.Class<T> clazz,
CodecRegistry registry)
Get a
Codec using the given context, which includes, most importantly, the Class for which a Codec is required. |
(package private) <T> PojoCodec<T> |
getPojoCodec(java.lang.Class<T> clazz,
CodecRegistry registry) |
private final boolean automatic
private final java.util.Map<java.lang.Class<?>,ClassModel<?>> classModels
private final java.util.Set<java.lang.String> packages
private final java.util.List<Convention> conventions
private final DiscriminatorLookup discriminatorLookup
private PojoCodecProvider(boolean automatic, java.util.Map<java.lang.Class<?>,ClassModel<?>> classModels, java.util.Set<java.lang.String> packages, java.util.List<Convention> conventions)
public static PojoCodecProvider.Builder builder()
PojoCodecProvider.Builder.register(Class[])
public <T> Codec<T> get(java.lang.Class<T> clazz, CodecRegistry registry)
CodecProvider
Codec
using the given context, which includes, most importantly, the Class for which a Codec
is required.get
in interface CodecProvider
T
- the type of the class for which a Codec is requiredclazz
- the Class for which to get a Codecregistry
- the registry to use for resolving dependent Codec instances<T> PojoCodec<T> getPojoCodec(java.lang.Class<T> clazz, CodecRegistry registry)
private static <T> ClassModel<T> createClassModel(java.lang.Class<T> clazz, java.util.List<Convention> conventions)