Class MapperBuilder


  • public class MapperBuilder
    extends Object
    • Field Detail

      • readerFactory

        private jakarta.json.JsonReaderFactory readerFactory
      • generatorFactory

        private jakarta.json.stream.JsonGeneratorFactory generatorFactory
      • provider

        private jakarta.json.spi.JsonProvider provider
      • builderFactory

        private jakarta.json.JsonBuilderFactory builderFactory
      • supportHiddenAccess

        private boolean supportHiddenAccess
      • maxSize

        private int maxSize
      • bufferSize

        private int bufferSize
      • bufferStrategy

        private String bufferStrategy
      • autoAdjustStringBuffers

        private boolean autoAdjustStringBuffers
      • supportConstructors

        private boolean supportConstructors
      • useGetterForCollections

        private boolean useGetterForCollections
      • accessModeName

        private String accessModeName
      • pretty

        private boolean pretty
      • version

        private int version
      • snippetMaxLength

        private int snippetMaxLength
      • close

        private boolean close
      • skipNull

        private boolean skipNull
      • skipEmptyArray

        private boolean skipEmptyArray
      • supportsComments

        private boolean supportsComments
      • treatByteArrayAsBase64

        private boolean treatByteArrayAsBase64
      • treatByteArrayAsBase64URL

        private boolean treatByteArrayAsBase64URL
      • readAttributeBeforeWrite

        private boolean readAttributeBeforeWrite
      • encoding

        private Charset encoding
      • ignoredForFields

        private Map<Class<?>,​String[]> ignoredForFields
      • interfaceImplementationMapping

        private Map<Class<?>,​Class<?>> interfaceImplementationMapping
      • primitiveConverters

        private boolean primitiveConverters
      • failOnUnknownProperties

        private boolean failOnUnknownProperties
      • useBigDecimalForFloats

        private boolean useBigDecimalForFloats
      • deduplicateObjects

        private Boolean deduplicateObjects
      • useJsRange

        private boolean useJsRange
      • useBigDecimalForObjectNumbers

        private boolean useBigDecimalForObjectNumbers
      • maxBigDecimalScale

        private int maxBigDecimalScale
      • supportEnumContainerDeserialization

        private boolean supportEnumContainerDeserialization
      • skipAccessModeWrapper

        private boolean skipAccessModeWrapper
      • deserializationPredicate

        private Predicate<Class<?>> deserializationPredicate
      • serializationPredicate

        private Predicate<Class<?>> serializationPredicate
      • discriminator

        private String discriminator
    • Constructor Detail

      • MapperBuilder

        public MapperBuilder()
    • Method Detail

      • build

        public Mapper build()
      • setSnippetMaxLength

        public MapperBuilder setSnippetMaxLength​(int snippetMaxLength)
      • setUseShortISO8601Format

        public MapperBuilder setUseShortISO8601Format​(boolean useShortISO8601Format)
      • setUseBigIntegerStringAdapter

        public MapperBuilder setUseBigIntegerStringAdapter​(boolean convertBigIntegerToString)
      • setUseBigDecimalStringAdapter

        public MapperBuilder setUseBigDecimalStringAdapter​(boolean convertBigDecimalToString)
      • setAdaptersDateTimeFormatterString

        public MapperBuilder setAdaptersDateTimeFormatterString​(String dateTimeFormatter)
      • setInterfaceImplementationMapping

        public MapperBuilder setInterfaceImplementationMapping​(Map<Class<?>,​Class<?>> interfaceImplementationMapping)
      • setFailOnUnknownProperties

        public MapperBuilder setFailOnUnknownProperties​(boolean failOnUnknownProperties)
      • setSupportGetterForCollections

        public MapperBuilder setSupportGetterForCollections​(boolean useGetterForCollections)
      • setSupportsComments

        public MapperBuilder setSupportsComments​(boolean supportsComments)
      • setBufferSize

        public MapperBuilder setBufferSize​(int bufferSize)
      • setAccessModeFieldFilteringStrategyName

        public MapperBuilder setAccessModeFieldFilteringStrategyName​(String mode)
      • setSupportHiddenAccess

        public MapperBuilder setSupportHiddenAccess​(boolean supportHiddenAccess)
      • setReaderFactory

        public MapperBuilder setReaderFactory​(jakarta.json.JsonReaderFactory readerFactory)
      • setGeneratorFactory

        public MapperBuilder setGeneratorFactory​(jakarta.json.stream.JsonGeneratorFactory generatorFactory)
      • setProvider

        public MapperBuilder setProvider​(jakarta.json.spi.JsonProvider provider)
      • setBuilderFactory

        public MapperBuilder setBuilderFactory​(jakarta.json.JsonBuilderFactory builderFactory)
      • setDoCloseOnStreams

        public MapperBuilder setDoCloseOnStreams​(boolean doCloseOnStreams)
      • setSkipNull

        public MapperBuilder setSkipNull​(boolean skipNull)
      • setSkipEmptyArray

        public MapperBuilder setSkipEmptyArray​(boolean skipEmptyArray)
      • setTreatByteArrayAsBase64

        public MapperBuilder setTreatByteArrayAsBase64​(boolean treatByteArrayAsBase64)
      • setTreatByteArrayAsBase64URL

        public MapperBuilder setTreatByteArrayAsBase64URL​(boolean treatByteArrayAsBase64URL)
      • setSupportConstructors

        public MapperBuilder setSupportConstructors​(boolean supportConstructors)
      • setReadAttributeBeforeWrite

        public MapperBuilder setReadAttributeBeforeWrite​(boolean readAttributeBeforeWrite)
      • setPrimitiveConverters

        public MapperBuilder setPrimitiveConverters​(boolean val)
      • setUseBigDecimalForFloats

        public MapperBuilder setUseBigDecimalForFloats​(boolean useBigDecimalForFloats)
      • setAutoAdjustStringBuffers

        public MapperBuilder setAutoAdjustStringBuffers​(boolean autoAdjustStringBuffers)
      • setDeduplicateObjects

        public MapperBuilder setDeduplicateObjects​(Boolean deduplicateObjects)
        If any non-primitive Java Object gets serialised more than just one time, then we write a JsonPointer to the first occurrence instead. This will effectively also avoid endless loops in data with cycles! An example: Assume you have a Person with a name 'Sarah' and her daughter, a Person with the name 'Clemens' both stored in a JSON array. Given the Java Code:
         Person sarah = new Person("Sarah");
         Person clemens = new Person("Clemens");
         clemens.setMother(sarah);
         Person[] family = new Person[]{sarah, clemens};
         
        Transformed to JSON this will now look like the following:
         [{"name":"Sarah"},{"name":"Clemens","mother":"/0"}]
         
        That means instead of serialising 'mother' as full object we will now only store a JsonPointer to the Person 'Sarah'. When deserialised back Johnzon will automatically de-reference the JsonPointer back to the correct instance. Possible values:
        • true: deduplicate objects
        • false: do not deduplicate objects
        • null: dedupliate based on the JohnzonDeduplicateObjects annotation. This is the default
      • setUseJsRange

        public MapperBuilder setUseJsRange​(boolean value)
      • setUseBigDecimalForObjectNumbers

        public MapperBuilder setUseBigDecimalForObjectNumbers​(boolean value)
      • setMaxBigDecimalScale

        public MapperBuilder setMaxBigDecimalScale​(int maxBigDecimalScale)
      • setSupportEnumContainerDeserialization

        public MapperBuilder setSupportEnumContainerDeserialization​(boolean supportEnumContainerDeserialization)
      • setPolymorphicSerializationPredicate

        public MapperBuilder setPolymorphicSerializationPredicate​(Predicate<Class<?>> serializationPredicate)
      • setPolymorphicDeserializationPredicate

        public MapperBuilder setPolymorphicDeserializationPredicate​(Predicate<Class<?>> deserializationPredicate)
      • setPolymorphicDiscriminator

        public MapperBuilder setPolymorphicDiscriminator​(String value)
      • setSkipAccessModeWrapper

        public MapperBuilder setSkipAccessModeWrapper​(boolean skipAccessModeWrapper)