org.springframework.data.mapping.model

## 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

### Constructor Summary

Constructors
Constructor and Description
`ClassGeneratingPropertyAccessorFactory()`

### Method Summary

All Methods Instance Methods Concrete Methods
`<T> PersistentPropertyAccessor<T>` `getPropertyAccessor(PersistentEntity<?,?> entity, T bean)` Returns a `PersistentPropertyAccessor` for a given `PersistentEntity` and `bean`.
`boolean` `isSupported(PersistentEntity<?,?> entity)` Checks whether an accessor class can be generated.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ClassGeneratingPropertyAccessorFactory

    public ClassGeneratingPropertyAccessorFactory()

### Method Detail

#### getPropertyAccessor

    public <T> PersistentPropertyAccessor<T> getPropertyAccessor(PersistentEntity<?,?> entity,
                                                                 T bean)

Description copied from interface: `PersistentPropertyAccessorFactory`
Returns a `PersistentPropertyAccessor` for a given `PersistentEntity` and `bean`.

Specified by:
  `getPropertyAccessor` in interface `PersistentPropertyAccessorFactory`
Parameters:
  `entity` - must not be null.
  `bean` - must not be null.
Returns:
  will never be null.

#### isSupported

    public boolean isSupported(PersistentEntity<?,?> entity)

Checks whether an accessor class can be generated.

Specified by:
  `isSupported` in interface `PersistentPropertyAccessorFactory`
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:
  `PersistentPropertyAccessorFactory.isSupported(PersistentEntity)`