Package org.apache.johnzon.mapper
Class MapperConfig
- java.lang.Object
-
- org.apache.johnzon.mapper.MapperConfig
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
MapperConfig.CustomEnumConverter<A>
-
Field Summary
-
Constructor Summary
Constructors Constructor Description MapperConfig(LazyConverterMap adapters, Map<Class<?>,ObjectConverter.Writer<?>> objectConverterWriters, Map<Class<?>,ObjectConverter.Reader<?>> objectConverterReaders, int version, boolean close, boolean skipNull, boolean skipEmptyArray, boolean treatByteArrayAsBase64, boolean treatByteArrayAsBase64URL, boolean readAttributeBeforeWrite, AccessMode accessMode, Charset encoding, Comparator<String> attributeOrder, boolean failOnUnknown, SerializeValueFilter serializeValueFilter, boolean useBigDecimalForFloats, Boolean deduplicateObjects, Map<Class<?>,Class<?>> interfaceImplementationMapping, boolean useJsRange, boolean useBigDecimalForObjectNumbers, int maxBigDecimalScale, boolean supportEnumMapDeserialization, Function<String,Class<?>> typeLoader, Function<Class<?>,String> discriminatorMapper, String discriminator, Predicate<Class<?>> deserializationPredicate, Predicate<Class<?>> serializationPredicate, Function<Class<?>,MapperConfig.CustomEnumConverter<?>> enumConverterFactory)
Deprecated.MapperConfig(LazyConverterMap adapters, Map<Class<?>,ObjectConverter.Writer<?>> objectConverterWriters, Map<Class<?>,ObjectConverter.Reader<?>> objectConverterReaders, int version, boolean close, boolean skipNull, boolean skipEmptyArray, boolean treatByteArrayAsBase64, boolean treatByteArrayAsBase64URL, boolean readAttributeBeforeWrite, AccessMode accessMode, Charset encoding, Comparator<String> attributeOrder, boolean failOnUnknown, SerializeValueFilter serializeValueFilter, boolean useBigDecimalForFloats, Boolean deduplicateObjects, Map<Class<?>,Class<?>> interfaceImplementationMapping, boolean useJsRange, boolean useBigDecimalForObjectNumbers, int maxBigDecimalScale, boolean supportEnumMapDeserialization, Function<String,Class<?>> typeLoader, Function<Class<?>,String> discriminatorMapper, String discriminator, Predicate<Class<?>> deserializationPredicate, Predicate<Class<?>> serializationPredicate, Function<Class<?>,MapperConfig.CustomEnumConverter<?>> enumConverterFactory, SnippetFactory snippet, Function<MapperConfig,Mappings> mappingsFactory)
-
Method Summary
-
-
-
Field Detail
-
NO_CONVERTER
private static final ObjectConverter.Codec NO_CONVERTER
-
version
private final int version
-
useJsRange
private final boolean useJsRange
-
close
private final boolean close
-
skipNull
private final boolean skipNull
-
skipEmptyArray
private final boolean skipEmptyArray
-
treatByteArrayAsBase64
private final boolean treatByteArrayAsBase64
-
treatByteArrayAsBase64URL
private final boolean treatByteArrayAsBase64URL
-
readAttributeBeforeWrite
private final boolean readAttributeBeforeWrite
-
supportEnumMapDeserialization
private final boolean supportEnumMapDeserialization
-
accessMode
private final AccessMode accessMode
-
encoding
private final Charset encoding
-
adapters
private final LazyConverterMap adapters
-
reverseAdapters
private final ConcurrentMap<Adapter<?,?>,AdapterKey> reverseAdapters
-
objectConverterWriters
private final Map<Class<?>,ObjectConverter.Writer<?>> objectConverterWriters
-
objectConverterReaders
private final Map<Class<?>,ObjectConverter.Reader<?>> objectConverterReaders
-
attributeOrder
private final Comparator<String> attributeOrder
-
failOnUnknown
private final boolean failOnUnknown
-
serializeValueFilter
private final SerializeValueFilter serializeValueFilter
-
useBigDecimalForFloats
private final boolean useBigDecimalForFloats
-
deduplicateObjects
private final Boolean deduplicateObjects
-
useBigDecimalForObjectNumbers
private final boolean useBigDecimalForObjectNumbers
-
maxBigDecimalScale
private int maxBigDecimalScale
-
discriminator
private final String discriminator
-
objectConverterWriterCache
private final Map<Class<?>,ObjectConverter.Writer<?>> objectConverterWriterCache
-
objectConverterReaderCache
private final Map<Class<?>,ObjectConverter.Reader<?>> objectConverterReaderCache
-
noParserAdapterTypes
private final Collection<Type> noParserAdapterTypes
-
noGeneratorAdapterTypes
private final Collection<Type> noGeneratorAdapterTypes
-
enumConverterFactory
private final Function<Class<?>,MapperConfig.CustomEnumConverter<?>> enumConverterFactory
-
snippet
private final SnippetFactory snippet
-
mappingsFactory
private final Function<MapperConfig,Mappings> mappingsFactory
-
-
Constructor Detail
-
MapperConfig
@Deprecated public MapperConfig(LazyConverterMap adapters, Map<Class<?>,ObjectConverter.Writer<?>> objectConverterWriters, Map<Class<?>,ObjectConverter.Reader<?>> objectConverterReaders, int version, boolean close, boolean skipNull, boolean skipEmptyArray, boolean treatByteArrayAsBase64, boolean treatByteArrayAsBase64URL, boolean readAttributeBeforeWrite, AccessMode accessMode, Charset encoding, Comparator<String> attributeOrder, boolean failOnUnknown, SerializeValueFilter serializeValueFilter, boolean useBigDecimalForFloats, Boolean deduplicateObjects, Map<Class<?>,Class<?>> interfaceImplementationMapping, boolean useJsRange, boolean useBigDecimalForObjectNumbers, int maxBigDecimalScale, boolean supportEnumMapDeserialization, Function<String,Class<?>> typeLoader, Function<Class<?>,String> discriminatorMapper, String discriminator, Predicate<Class<?>> deserializationPredicate, Predicate<Class<?>> serializationPredicate, Function<Class<?>,MapperConfig.CustomEnumConverter<?>> enumConverterFactory)
Deprecated.
-
MapperConfig
public MapperConfig(LazyConverterMap adapters, Map<Class<?>,ObjectConverter.Writer<?>> objectConverterWriters, Map<Class<?>,ObjectConverter.Reader<?>> objectConverterReaders, int version, boolean close, boolean skipNull, boolean skipEmptyArray, boolean treatByteArrayAsBase64, boolean treatByteArrayAsBase64URL, boolean readAttributeBeforeWrite, AccessMode accessMode, Charset encoding, Comparator<String> attributeOrder, boolean failOnUnknown, SerializeValueFilter serializeValueFilter, boolean useBigDecimalForFloats, Boolean deduplicateObjects, Map<Class<?>,Class<?>> interfaceImplementationMapping, boolean useJsRange, boolean useBigDecimalForObjectNumbers, int maxBigDecimalScale, boolean supportEnumMapDeserialization, Function<String,Class<?>> typeLoader, Function<Class<?>,String> discriminatorMapper, String discriminator, Predicate<Class<?>> deserializationPredicate, Predicate<Class<?>> serializationPredicate, Function<Class<?>,MapperConfig.CustomEnumConverter<?>> enumConverterFactory, SnippetFactory snippet, Function<MapperConfig,Mappings> mappingsFactory)
-
-
Method Detail
-
getSnippet
public SnippetFactory getSnippet()
-
getEnumConverterFactory
public Function<Class<?>,MapperConfig.CustomEnumConverter<?>> getEnumConverterFactory()
-
getNoParserAdapterTypes
public Collection<Type> getNoParserAdapterTypes()
-
getNoGeneratorAdapterTypes
public Collection<Type> getNoGeneratorAdapterTypes()
-
getDiscriminator
public String getDiscriminator()
-
isUseBigDecimalForObjectNumbers
public boolean isUseBigDecimalForObjectNumbers()
-
getMaxBigDecimalScale
public int getMaxBigDecimalScale()
-
isUseJsRange
public boolean isUseJsRange()
-
getInterfaceImplementationMapping
public Map<Class<?>,Class<?>> getInterfaceImplementationMapping()
-
getSerializeValueFilter
public SerializeValueFilter getSerializeValueFilter()
-
findObjectConverterReader
public ObjectConverter.Reader findObjectConverterReader(Class clazz)
Search for anObjectConverter
for the given class. If noObjectConverter
was found for the specific class, the whole type hierarchy will be scanned for a matchingObjectConverter
. In case the given class implements more than on interfaces and for at least two we have configured anObjectConverter
theObjectConverter
for the first interface we get will be taken.- Parameters:
clazz
- theClass
- Returns:
- the found
ObjectConverter
ornull
if noObjectConverter
has been found - Throws:
IllegalArgumentException
- ifclazz
isnull
-
findObjectConverterWriter
public ObjectConverter.Writer findObjectConverterWriter(Class clazz)
-
findObjectConverter
private <T> T findObjectConverter(Class clazz, Map<Class<?>,T> from, Map<Class<?>,T> cache)
-
isFailOnUnknown
public boolean isFailOnUnknown()
-
getVersion
public int getVersion()
-
isClose
public boolean isClose()
-
isSkipNull
public boolean isSkipNull()
-
isSkipEmptyArray
public boolean isSkipEmptyArray()
-
isTreatByteArrayAsBase64
public boolean isTreatByteArrayAsBase64()
-
isTreatByteArrayAsBase64URL
public boolean isTreatByteArrayAsBase64URL()
-
isReadAttributeBeforeWrite
public boolean isReadAttributeBeforeWrite()
-
getAccessMode
public AccessMode getAccessMode()
-
getEncoding
public Charset getEncoding()
-
getAdapters
public LazyConverterMap getAdapters()
-
getReverseAdapters
public ConcurrentMap<Adapter<?,?>,AdapterKey> getReverseAdapters()
-
getObjectConverterWriters
public Map<Class<?>,ObjectConverter.Writer<?>> getObjectConverterWriters()
-
getObjectConverterReaders
public Map<Class<?>,ObjectConverter.Reader<?>> getObjectConverterReaders()
-
getAttributeOrder
public Comparator<String> getAttributeOrder()
-
isUseBigDecimalForFloats
public boolean isUseBigDecimalForFloats()
-
isDeduplicateObjects
public boolean isDeduplicateObjects()
-
isSupportEnumContainerDeserialization
public boolean isSupportEnumContainerDeserialization()
-
getMappingsFactory
public Function<MapperConfig,Mappings> getMappingsFactory()
-
-