Package org.apache.juneau.commons.bean
Class BeanConfigContext.Builder
java.lang.Object
org.apache.juneau.commons.bean.BeanConfigContext.Builder
- Enclosing class:
- BeanConfigContext
Builder for
BeanConfigContext.-
Method Summary
Modifier and TypeMethodDescriptionSets the activeAnnotationProvider.beanClassVisibility(Visibility value) Sets the minimum bean class visibility.Sets the minimum bean constructor visibility.beanFieldVisibility(Visibility value) Sets the minimum bean field visibility.beanMapPutReturnsOldValue(boolean value) Toggles whetherBeanMap.put(String,Object)returns the previous value rather thannull .Sets theBeanMetaInitializerSPI hook for marshalling-sideBeanMetaconstruction.beanMethodVisibility(Visibility value) Sets the minimum bean method visibility.Sets theBeanPropertyPostProcessorSPI hook for marshalling-side bean-property post-processing.beansRequireDefaultConstructor(boolean value) Toggles the requirement that beans have a no-arg default constructor.beansRequireSerializable(boolean value) Toggles the requirement that beans implementSerializable.beansRequireSettersForGetters(boolean value) Toggles the requirement that bean getters have matching setters.beansRequireSomeProperties(boolean value) Toggles the requirement that beans expose at least one property.Sets the activeBeanStoreused for factory-based bean instantiation.beanTypePropertyName(String value) Sets the property name used to embed the bean dictionary type (default:"_type" ).build()Builds a newBeanConfigContextfrom this builder's state.findFluentSetters(boolean value) Toggles fluent-setter detection (setters that returnthis ).ignoreInvocationExceptionsOnGetters(boolean value) Toggles silent suppression of exceptions thrown by bean property getters.ignoreInvocationExceptionsOnSetters(boolean value) Toggles silent suppression of exceptions thrown by bean property setters.ignoreMissingSetters(boolean value) Toggles silent ignoring of properties without setters during deserialization.ignoreTransientFields(boolean value) Toggles exclusion oftransientfields from bean property detection.ignoreUnknownBeanProperties(boolean value) Toggles silent ignoring of unknown properties on incoming bean payloads.ignoreUnknownNullBeanProperties(boolean value) Toggles silent ignoring of attempts to set unknown bean properties tonull .notABeanPredicate(Predicate<ClassInfo> value) Installs a custom predicate that fully overridesBeanConfigContext.isNotABean(ClassInfo).notBeanClasses(Class<?>... values) Adds classes (and supertypes) that should be excluded from bean detection.notBeanClasses(Collection<? extends Class<?>> values) Replaces the not-a-bean class set.notBeanPackageNames(String... values) Adds package names whose classes should be excluded from bean detection.notBeanPackageNames(Collection<String> values) Replaces the not-a-bean package name set.notBeanPackagePrefixes(String... values) Adds package prefixes whose classes should be excluded from bean detection.notBeanPackagePrefixes(Collection<String> values) Replaces the not-a-bean package prefix set.propertyNamer(PropertyNamer value) Sets thePropertyNamerused to derive property names.recordComponentOrder(boolean value) Toggles record component (declaration) ordering forRecordbeans.unsortedProperties(boolean value) Toggles declaration order (instead of alphabetical order) for bean properties.useInterfaceProxies(boolean value) Toggles automatic creation of interface proxies for bean interfaces.useJavaBeanIntrospector(boolean value) Toggles use ofIntrospectorfor property discovery.
-
Method Details
-
build
Builds a newBeanConfigContextfrom this builder's state.- Returns:
- A new immutable
BeanConfigContext.
-
beanClassVisibility
Sets the minimum bean class visibility.- Parameters:
value- The visibility threshold. Must not benull .- Returns:
- This object.
-
beanConstructorVisibility
Sets the minimum bean constructor visibility.- Parameters:
value- The visibility threshold. Must not benull .- Returns:
- This object.
-
beanFieldVisibility
Sets the minimum bean field visibility.- Parameters:
value- The visibility threshold. Must not benull .- Returns:
- This object.
-
beanMethodVisibility
Sets the minimum bean method visibility.- Parameters:
value- The visibility threshold. Must not benull .- Returns:
- This object.
-
beanMapPutReturnsOldValue
Toggles whetherBeanMap.put(String,Object)returns the previous value rather thannull .- Parameters:
value- The new value.- Returns:
- This object.
-
beansRequireDefaultConstructor
Toggles the requirement that beans have a no-arg default constructor.- Parameters:
value- The new value.- Returns:
- This object.
-
beansRequireSerializable
Toggles the requirement that beans implementSerializable.- Parameters:
value- The new value.- Returns:
- This object.
-
beansRequireSettersForGetters
Toggles the requirement that bean getters have matching setters.- Parameters:
value- The new value.- Returns:
- This object.
-
beansRequireSomeProperties
Toggles the requirement that beans expose at least one property.- Parameters:
value- The new value.- Returns:
- This object.
-
findFluentSetters
Toggles fluent-setter detection (setters that returnthis ).- Parameters:
value- The new value.- Returns:
- This object.
-
ignoreInvocationExceptionsOnGetters
Toggles silent suppression of exceptions thrown by bean property getters.- Parameters:
value- The new value.- Returns:
- This object.
-
ignoreInvocationExceptionsOnSetters
Toggles silent suppression of exceptions thrown by bean property setters.- Parameters:
value- The new value.- Returns:
- This object.
-
ignoreMissingSetters
Toggles silent ignoring of properties without setters during deserialization.- Parameters:
value- The new value.- Returns:
- This object.
-
ignoreTransientFields
Toggles exclusion oftransientfields from bean property detection.- Parameters:
value- The new value.- Returns:
- This object.
-
ignoreUnknownBeanProperties
Toggles silent ignoring of unknown properties on incoming bean payloads.- Parameters:
value- The new value.- Returns:
- This object.
-
ignoreUnknownNullBeanProperties
Toggles silent ignoring of attempts to set unknown bean properties tonull .- Parameters:
value- The new value.- Returns:
- This object.
-
unsortedProperties
Toggles declaration order (instead of alphabetical order) for bean properties.- Parameters:
value- The new value.- Returns:
- This object.
-
recordComponentOrder
Toggles record component (declaration) ordering forRecordbeans.- Parameters:
value- The new value.- Returns:
- This object.
-
useInterfaceProxies
Toggles automatic creation of interface proxies for bean interfaces.- Parameters:
value- The new value.- Returns:
- This object.
-
useJavaBeanIntrospector
Toggles use ofIntrospectorfor property discovery.- Parameters:
value- The new value.- Returns:
- This object.
-
propertyNamer
Sets thePropertyNamerused to derive property names.- Parameters:
value- The property namer. Must not benull .- Returns:
- This object.
-
beanTypePropertyName
Sets the property name used to embed the bean dictionary type (default:"_type" ).- Parameters:
value- The property name. Must not benull .- Returns:
- This object.
-
notBeanPackageNames
Adds package names whose classes should be excluded from bean detection.- Parameters:
values- The package names. Must not benull .- Returns:
- This object.
-
notBeanPackagePrefixes
Adds package prefixes whose classes should be excluded from bean detection.- Parameters:
values- The package prefixes. Must not benull .- Returns:
- This object.
-
notBeanClasses
Adds classes (and supertypes) that should be excluded from bean detection.- Parameters:
values- The classes. Must not benull .- Returns:
- This object.
-
notBeanPackageNames
Replaces the not-a-bean package name set.- Parameters:
values- The package names. May benull for an empty set.- Returns:
- This object.
-
notBeanPackagePrefixes
Replaces the not-a-bean package prefix set.- Parameters:
values- The package prefixes. May benull for an empty set.- Returns:
- This object.
-
notBeanClasses
Replaces the not-a-bean class set.- Parameters:
values- The classes. May benull for an empty set.- Returns:
- This object.
-
beanStore
Sets the activeBeanStoreused for factory-based bean instantiation.- Parameters:
value- The bean store. May benull .- Returns:
- This object.
-
annotationProvider
Sets the activeAnnotationProvider.- Parameters:
value- The annotation provider. Must not benull .- Returns:
- This object.
-
notABeanPredicate
Installs a custom predicate that fully overridesBeanConfigContext.isNotABean(ClassInfo).When set, the default not-bean computation (package/class exclusions, array/primitive/enum/annotation checks) is bypassed entirely. Pass
null to revert to the built-in behavior.- Parameters:
value- The predicate. May benull .- Returns:
- This object.
-
beanMetaInitializer
Sets theBeanMetaInitializerSPI hook for marshalling-sideBeanMetaconstruction.Pass
null to reset toBeanMetaInitializer.NOOP(commons-side default).- Parameters:
value- The initializer. May benull .- Returns:
- This object.
-
beanPropertyPostProcessor
Sets theBeanPropertyPostProcessorSPI hook for marshalling-side bean-property post-processing.Pass
null to reset toBeanPropertyPostProcessor.NOOP(commons-side default).- Parameters:
value- The post-processor. May benull .- Returns:
- This object.
-