Class IntrospectionService
java.lang.Object
de.danielbechler.diff.introspection.IntrospectionService
- All Implemented Interfaces:
IntrospectionConfigurer,IsIntrospectableResolver,PropertyAccessExceptionHandlerResolver,TypeInfoResolver
public class IntrospectionService
extends Object
implements IntrospectionConfigurer, IsIntrospectableResolver, TypeInfoResolver, PropertyAccessExceptionHandlerResolver
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface de.danielbechler.diff.introspection.IntrospectionConfigurer
IntrospectionConfigurer.Of -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionand()handlePropertyAccessExceptionsUsing(PropertyAccessExceptionHandler exceptionHandler) introspectorForNode(DiffNode node) booleanisIntrospectable(DiffNode node) resolvePropertyAccessExceptionHandler(Class<?> parentType, String propertyName) setDefaultIntrospector(Introspector introspector) setInstanceFactory(InstanceFactory instanceFactory) When assigning new values viaDiffNode(e.g.typeInfoForNode(DiffNode node)
-
Constructor Details
-
IntrospectionService
-
-
Method Details
-
isIntrospectable
- Specified by:
isIntrospectablein interfaceIsIntrospectableResolver- Returns:
- Returns
trueif the object represented by the given node should be compared via introspection.
-
resolvePropertyAccessExceptionHandler
public PropertyAccessExceptionHandler resolvePropertyAccessExceptionHandler(Class<?> parentType, String propertyName) - Specified by:
resolvePropertyAccessExceptionHandlerin interfacePropertyAccessExceptionHandlerResolver- Parameters:
parentType- The type of the object to which the property belongs.propertyName- The name of the property.
-
typeInfoForNode
- Specified by:
typeInfoForNodein interfaceTypeInfoResolver
-
introspectorForNode
-
setInstanceFactory
Description copied from interface:IntrospectionConfigurerWhen 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.- Specified by:
setInstanceFactoryin interfaceIntrospectionConfigurer- Parameters:
instanceFactory- A custom instance factory
-
setDefaultIntrospector
- Specified by:
setDefaultIntrospectorin interfaceIntrospectionConfigurer
-
handlePropertyAccessExceptionsUsing
public IntrospectionConfigurer handlePropertyAccessExceptionsUsing(PropertyAccessExceptionHandler exceptionHandler) - Specified by:
handlePropertyAccessExceptionsUsingin interfaceIntrospectionConfigurer
-
ofType
- Specified by:
ofTypein interfaceIntrospectionConfigurer
-
ofNode
- Specified by:
ofNodein interfaceIntrospectionConfigurer
-
and
- Specified by:
andin interfaceIntrospectionConfigurer
-