Class ClassGeneratingPropertyAccessorFactory
java.lang.Object
org.springframework.data.mapping.model.ClassGeneratingPropertyAccessorFactory
- All Implemented Interfaces:
PersistentPropertyAccessorFactory
public class ClassGeneratingPropertyAccessorFactory
extends Object
implements PersistentPropertyAccessorFactory
A factory that can generate byte code to speed-up dynamic property access. Uses the
PersistentEntity's
PersistentProperty to discover the access to properties. Properties are accessed either using method handles
to overcome Java visibility issues or directly using field access/getter/setter calls.- Since:
- 1.13
- Author:
- Mark Paluch, Oliver Gierke, Christoph Strobl, Jens Schauder, Johannes Englmeier
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> PersistentPropertyAccessor<T>getPropertyAccessor(PersistentEntity<?, ?> entity, T bean) booleanisSupported(PersistentEntity<?, ?> entity) Checks whether an accessor class can be generated.
-
Constructor Details
-
ClassGeneratingPropertyAccessorFactory
public ClassGeneratingPropertyAccessorFactory()
-
-
Method Details
-
getPropertyAccessor
Description copied from interface:PersistentPropertyAccessorFactory- Specified by:
getPropertyAccessorin interfacePersistentPropertyAccessorFactory- Parameters:
entity- must not be null.bean- must not be null.- Returns:
- will never be null.
-
isSupported
Checks whether an accessor class can be generated.- Specified by:
isSupportedin interfacePersistentPropertyAccessorFactory- Parameters:
entity- must not be null.- Returns:
- true if the runtime is equal or greater to Java 1.7, we can access the ClassLoader, the property name hash codes are unique and the type has a class loader we can use to re-inject types.
- See Also:
-