com.fasterxml.jackson.databind.ser.impl

## Class PropertyBasedObjectIdGenerator

- java.lang.Object
- - com.fasterxml.jackson.annotation.ObjectIdGenerator<T>
  - - com.fasterxml.jackson.annotation.ObjectIdGenerators.PropertyGenerator
    - - com.fasterxml.jackson.databind.ser.impl.PropertyBasedObjectIdGenerator

All Implemented Interfaces:
  Serializable

    public class PropertyBasedObjectIdGenerator
    extends ObjectIdGenerators.PropertyGenerator

See Also:
  Serialized Form

### Nested Class Summary

### Nested classes/interfaces inherited from class com.fasterxml.jackson.annotation.ObjectIdGenerator

`ObjectIdGenerator.IdKey`

### Field Summary

Fields
`protected BeanPropertyWriter` `_property`

### Constructor Summary

Constructors
`protected` `PropertyBasedObjectIdGenerator(Class<?> scope, BeanPropertyWriter prop)`
`` `PropertyBasedObjectIdGenerator(ObjectIdInfo oid, BeanPropertyWriter prop)`

### Method Summary

Methods
`boolean` `canUseFor(ObjectIdGenerator<?> gen)` We must override this method, to prevent errors when scopes are the same, but underlying class (on which to access property) is different.
`ObjectIdGenerator<Object>` `forScope(Class<?> scope)`
`Object` `generateId(Object forPojo)`
`ObjectIdGenerator.IdKey` `key(Object key)`
`ObjectIdGenerator<Object>` `newForSerialization(Object context)`

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

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

### Field Detail

#### _property

    protected final BeanPropertyWriter _property

### Constructor Detail

#### PropertyBasedObjectIdGenerator

    public PropertyBasedObjectIdGenerator(ObjectIdInfo oid,
                                  BeanPropertyWriter prop)

#### PropertyBasedObjectIdGenerator

    protected PropertyBasedObjectIdGenerator(Class<?> scope,
                                  BeanPropertyWriter prop)

### Method Detail

#### canUseFor

    public boolean canUseFor(ObjectIdGenerator<?> gen)

We must override this method, to prevent errors when scopes are the same, but underlying class (on which to access property) is different.

#### generateId

    public Object generateId(Object forPojo)

#### forScope

    public ObjectIdGenerator<Object> forScope(Class<?> scope)

Specified by:
  `forScope` in class `ObjectIdGenerator<Object>`

#### newForSerialization

    public ObjectIdGenerator<Object> newForSerialization(Object context)

Specified by:
  `newForSerialization` in class `ObjectIdGenerator<Object>`

#### key

    public ObjectIdGenerator.IdKey key(Object key)

Specified by:
  `key` in class `ObjectIdGenerator<Object>`