public class IntrospectionService extends Object implements IntrospectionConfigurer, IsIntrospectableResolver, TypeInfoResolver, PropertyAccessExceptionHandlerResolver
Modifier and Type | Class and Description |
---|---|
static class |
IntrospectionService.IntrospectionMode |
IntrospectionConfigurer.Of
Constructor and Description |
---|
IntrospectionService(ObjectDifferBuilder objectDifferBuilder) |
Modifier and Type | Method and Description |
---|---|
ObjectDifferBuilder |
and() |
IntrospectionConfigurer |
handlePropertyAccessExceptionsUsing(PropertyAccessExceptionHandler exceptionHandler) |
Introspector |
introspectorForNode(DiffNode node) |
boolean |
isIntrospectable(DiffNode node) |
IntrospectionConfigurer.Of |
ofNode(NodePath path) |
IntrospectionConfigurer.Of |
ofType(Class<?> type) |
PropertyAccessExceptionHandler |
resolvePropertyAccessExceptionHandler(Class<?> parentType,
String propertyName) |
IntrospectionConfigurer |
setDefaultIntrospector(Introspector introspector) |
IntrospectionConfigurer |
setInstanceFactory(InstanceFactory instanceFactory)
When assigning new values via
DiffNode (e.g. |
TypeInfo |
typeInfoForNode(DiffNode node) |
public IntrospectionService(ObjectDifferBuilder objectDifferBuilder)
public boolean isIntrospectable(DiffNode node)
isIntrospectable
in interface IsIntrospectableResolver
true
if the object represented by the given node should be compared via
introspection.public PropertyAccessExceptionHandler resolvePropertyAccessExceptionHandler(Class<?> parentType, String propertyName)
resolvePropertyAccessExceptionHandler
in interface PropertyAccessExceptionHandlerResolver
parentType
- The type of the object to which the property belongs.propertyName
- The name of the property.public TypeInfo typeInfoForNode(DiffNode node)
typeInfoForNode
in interface TypeInfoResolver
public Introspector introspectorForNode(DiffNode node)
public IntrospectionConfigurer setInstanceFactory(InstanceFactory instanceFactory)
IntrospectionConfigurer
DiffNode
(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 a TypeInstantiationException
will be thrown.
To add support for types that need to be instantiated differently you can overide the default behavior via
custom InstanceFactory
. 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 returns null
.setInstanceFactory
in interface IntrospectionConfigurer
instanceFactory
- A custom instance factorypublic IntrospectionConfigurer setDefaultIntrospector(Introspector introspector)
setDefaultIntrospector
in interface IntrospectionConfigurer
public IntrospectionConfigurer handlePropertyAccessExceptionsUsing(PropertyAccessExceptionHandler exceptionHandler)
handlePropertyAccessExceptionsUsing
in interface IntrospectionConfigurer
public IntrospectionConfigurer.Of ofType(Class<?> type)
ofType
in interface IntrospectionConfigurer
public IntrospectionConfigurer.Of ofNode(NodePath path)
ofNode
in interface IntrospectionConfigurer
public ObjectDifferBuilder and()
and
in interface IntrospectionConfigurer
Copyright © 2015. All rights reserved.