Package com.fasterxml.jackson.annotation

# Class ObjectIdGenerators.PropertyGenerator

java.lang.Object
com.fasterxml.jackson.annotation.ObjectIdGenerator<Object>
com.fasterxml.jackson.annotation.ObjectIdGenerators.PropertyGenerator

All Implemented Interfaces:
  `Serializable`

Enclosing class:
  `ObjectIdGenerators`

public abstract static class ObjectIdGenerators.PropertyGenerator extends ObjectIdGenerator<Object>
Abstract place-holder class which is used to denote case where Object Identifier to use comes from a POJO property (getter method or field). If so, value is written directly during serialization, and used as-is during deserialization.

Actual implementation class is part of `databind` package.

See Also:
  - Serialized Form

## Nested Class Summary

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

`ObjectIdGenerator.IdKey`

## Field Summary

Fields
Modifier and Type
Field
Description
`protected final Class<?>`
`_scope`

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`PropertyGenerator(Class<?> scope)`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`canUseFor(ObjectIdGenerator<?> gen)`
Method called to check whether this generator instance can be used for Object Ids of specific generator type and scope; determination is based by passing a configured "blueprint" (prototype) instance; from which the actual instances are created (using `ObjectIdGenerator.newForSerialization(java.lang.Object)`).
`abstract Object`
`generateId(Object forPojo)`
Method used for generating a new Object Identifier to serialize for given POJO.
`final Class<?>`
`getScope()`

### Methods inherited from class com.fasterxml.jackson.annotation.ObjectIdGenerator

`forScope, isValidReferencePropertyName, key, maySerializeAsObject, newForSerialization`

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

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

## Field Details

### _scope

protected final Class<?> _scope

## Constructor Details

### PropertyGenerator

protected PropertyGenerator(Class<?> scope)

## Method Details

### getScope

public final Class<?> getScope()

Specified by:
  `getScope` in class `ObjectIdGenerator<T>`

### canUseFor

public boolean canUseFor(ObjectIdGenerator<?> gen)
Description copied from class: `ObjectIdGenerator`
Method called to check whether this generator instance can be used for Object Ids of specific generator type and scope; determination is based by passing a configured "blueprint" (prototype) instance; from which the actual instances are created (using `ObjectIdGenerator.newForSerialization(java.lang.Object)`).

Specified by:
  `canUseFor` in class `ObjectIdGenerator<T>`
Returns:
  True if this instance can be used as-is; false if not

### generateId

public abstract Object generateId(Object forPojo)
Description copied from class: `ObjectIdGenerator`
Method used for generating a new Object Identifier to serialize for given POJO.

Specified by:
  `generateId` in class `ObjectIdGenerator<T>`
Parameters:
  `forPojo` - POJO for which identifier is needed
Returns:
  Object Identifier to use.