Interface IntrospectionConfigurer
- All Known Implementing Classes:
IntrospectionService
public interface IntrospectionConfigurer
Allows to replace the default bean introspector with a custom implementation. The default introspector internally
uses the `java.beans.Introspector` which has some limitations. The most important one being that it only operates on
getters and setters. In case field introspection is needed a custom introspector must be used. An introspector can
be
set as global default or on a per-property basis. It is also possible to turn off introspection for specific
properties in which case they will simply be compared via `equals` method.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionand()handlePropertyAccessExceptionsUsing(PropertyAccessExceptionHandler exceptionHandler) setDefaultIntrospector(Introspector introspector) setInstanceFactory(InstanceFactory instanceFactory) When assigning new values viaDiffNode(e.g.
-
Method Details
-
setInstanceFactory
When assigning new values viaDiffNode(e.g. during merging) it will implicitly create missing instances of its parent objects along the path to the root object. By default those instances will be created via public non-arg constructor. If that fails aTypeInstantiationExceptionwill be thrown. To add support for types that need to be instantiated differently you can overide the default behavior via customInstanceFactory. When doing so, don't worry about types actually that are suitable for the default behavior, as it will automatically kick in, whenever the custom factroy returnsnull.- Parameters:
instanceFactory- A custom instance factory- Throws:
IllegalArgumentException- when the instanceFactory is null
-
setDefaultIntrospector
-
handlePropertyAccessExceptionsUsing
IntrospectionConfigurer handlePropertyAccessExceptionsUsing(PropertyAccessExceptionHandler exceptionHandler) -
ofType
-
ofNode
-
and
ObjectDifferBuilder and()
-