Package com.norconex.commons.lang.bean
Class BeanMapper.BeanMapperBuilder
java.lang.Object
com.norconex.commons.lang.bean.BeanMapper.BeanMapperBuilder
- Enclosing class:
BeanMapper
-
Method Summary
Modifier and TypeMethodDescriptionbuild()canonicalNameSupportDisabled(boolean canonicalNameSupportDisabled) Whether to disable resolving of fully qualified class names in source when reading.classLoader(ClassLoader classLoader) The class loader to use to load classes.configurableDetectionDisabled(boolean configurableDetectionDisabled) Whether to disable detectingConfigurableclasses, which whenfalse(i.e., enabled), will automatically mark the configuration class as@validand ignore the configurable class properties when writing/reading.defaultPolymorphicType(Class<?> defaultPolymorphicTypeKey, Class<?> defaultPolymorphicTypeValue) defaultPolymorphicTypes(Map<? extends Class<?>, ? extends Class<?>> defaultPolymorphicTypes) flowMapperConfig(@NonNull FlowMapperConfig flowMapperConfig) Optionally setup support for using flow/conditions in your your source.ignoredProperties(Collection<? extends String> ignoredProperties) ignoredProperty(String ignoredProperty) ignoreUnknownProperties(boolean ignoreUnknownProperties) Whether to silently ignored unknown mapped properties when reading.indent(boolean indent) Whether to indent elements when writing.mapperBuilderCustomizer(Consumer<com.fasterxml.jackson.databind.cfg.MapperBuilder<?, ?>> mapperBuilderCustomizer) Consumes the internal JacksonMapperBuilderfor custom initialization.polymorphicServiceLoaderDisabled(boolean polymorphicServiceLoaderDisabled) Whether to disable detecting polymorphic types and their subtypes using Java Service Loader (SPI) mechanism.polymorphicType(Class<?> polymorphicTypeKey, Predicate<String> polymorphicTypeValue) polymorphicTypeImpl(Class<?> polymorphicTypeImplKey, List<Class<?>> polymorphicTypeImplValue) polymorphicTypeImpls(Map<? extends Class<?>, ? extends List<Class<?>>> polymorphicTypeImpls) polymorphicTypes(Map<? extends Class<?>, ? extends Predicate<String>> polymorphicTypes) skipValidation(boolean skipValidation) Whether to skip validation when reading.toString()treatEmptyAsNull(boolean treatEmptyAsNull) Whether to treat empty strings asnullwhen reading.unboundPropertyMapping(String unboundPropertyMappingKey, Class<?> unboundPropertyMappingValue) unboundPropertyMappings(Map<? extends String, ? extends Class<?>> unboundPropertyMappings)
-
Method Details
-
ignoreUnknownProperties
Whether to silently ignored unknown mapped properties when reading.- Returns:
this.
-
treatEmptyAsNull
Whether to treat empty strings asnullwhen reading.- Returns:
this.
-
canonicalNameSupportDisabled
public BeanMapper.BeanMapperBuilder canonicalNameSupportDisabled(boolean canonicalNameSupportDisabled) Whether to disable resolving of fully qualified class names in source when reading.- Returns:
this.
-
configurableDetectionDisabled
public BeanMapper.BeanMapperBuilder configurableDetectionDisabled(boolean configurableDetectionDisabled) Whether to disable detectingConfigurableclasses, which whenfalse(i.e., enabled), will automatically mark the configuration class as@validand ignore the configurable class properties when writing/reading.- Returns:
this.
-
polymorphicServiceLoaderDisabled
public BeanMapper.BeanMapperBuilder polymorphicServiceLoaderDisabled(boolean polymorphicServiceLoaderDisabled) Whether to disable detecting polymorphic types and their subtypes using Java Service Loader (SPI) mechanism.- Returns:
this.- See Also:
-
skipValidation
Whether to skip validation when reading.- Returns:
this.
-
indent
Whether to indent elements when writing.- Returns:
this.
-
classLoader
The class loader to use to load classes. Defaults to this class class loader.- Returns:
this.
-
mapperBuilderCustomizer
public BeanMapper.BeanMapperBuilder mapperBuilderCustomizer(Consumer<com.fasterxml.jackson.databind.cfg.MapperBuilder<?, ?>> mapperBuilderCustomizer) Consumes the internal JacksonMapperBuilderfor custom initialization.- Returns:
this.
-
polymorphicType
public BeanMapper.BeanMapperBuilder polymorphicType(Class<?> polymorphicTypeKey, Predicate<String> polymorphicTypeValue) -
polymorphicTypes
public BeanMapper.BeanMapperBuilder polymorphicTypes(Map<? extends Class<?>, ? extends Predicate<String>> polymorphicTypes) -
clearPolymorphicTypes
-
unboundPropertyMapping
public BeanMapper.BeanMapperBuilder unboundPropertyMapping(String unboundPropertyMappingKey, Class<?> unboundPropertyMappingValue) -
unboundPropertyMappings
public BeanMapper.BeanMapperBuilder unboundPropertyMappings(Map<? extends String, ? extends Class<?>> unboundPropertyMappings) -
clearUnboundPropertyMappings
-
defaultPolymorphicType
public BeanMapper.BeanMapperBuilder defaultPolymorphicType(Class<?> defaultPolymorphicTypeKey, Class<?> defaultPolymorphicTypeValue) -
defaultPolymorphicTypes
public BeanMapper.BeanMapperBuilder defaultPolymorphicTypes(Map<? extends Class<?>, ? extends Class<?>> defaultPolymorphicTypes) -
clearDefaultPolymorphicTypes
-
polymorphicTypeImpl
public BeanMapper.BeanMapperBuilder polymorphicTypeImpl(Class<?> polymorphicTypeImplKey, List<Class<?>> polymorphicTypeImplValue) -
polymorphicTypeImpls
public BeanMapper.BeanMapperBuilder polymorphicTypeImpls(Map<? extends Class<?>, ? extends List<Class<?>>> polymorphicTypeImpls) -
clearPolymorphicTypeImpls
-
flowMapperConfig
public BeanMapper.BeanMapperBuilder flowMapperConfig(@NonNull @NonNull FlowMapperConfig flowMapperConfig) Optionally setup support for using flow/conditions in your your source.- Returns:
this.
-
ignoredProperty
-
ignoredProperties
public BeanMapper.BeanMapperBuilder ignoredProperties(Collection<? extends String> ignoredProperties) -
clearIgnoredProperties
-
build
-
toString
-