Class PropertyBasedObjectIdGenerator
java.lang.Object
com.fasterxml.jackson.annotation.ObjectIdGenerator<Object>
com.fasterxml.jackson.annotation.ObjectIdGenerators.PropertyGenerator
com.fasterxml.jackson.databind.deser.impl.PropertyBasedObjectIdGenerator
- All Implemented Interfaces:
Serializable
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.fasterxml.jackson.annotation.ObjectIdGenerator
ObjectIdGenerator.IdKey -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanUseFor(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 (usingObjectIdGenerator.newForSerialization(java.lang.Object)).Factory method to create a blueprint instance for specified scope.generateId(Object forPojo) Method used for generating a new Object Identifier to serialize for given POJO.final Class<?> getScope()Method for constructing key to use for ObjectId-to-POJO maps.newForSerialization(Object context) Factory method called to create a new instance to use for serialization: needed since generators may have state (next id to produce).Methods inherited from class com.fasterxml.jackson.annotation.ObjectIdGenerator
isValidReferencePropertyName, maySerializeAsObject
-
Constructor Details
-
PropertyBasedObjectIdGenerator
-
-
Method Details
-
generateId
Description copied from class:ObjectIdGeneratorMethod used for generating a new Object Identifier to serialize for given POJO.- Parameters:
forPojo- POJO for which identifier is needed- Returns:
- Object Identifier to use.
-
forScope
Description copied from class:ObjectIdGeneratorFactory method to create a blueprint instance for specified scope. Generators that do not use scope may return 'this'.- Specified by:
forScopein classObjectIdGenerator<Object>
-
newForSerialization
Description copied from class:ObjectIdGeneratorFactory method called to create a new instance to use for serialization: needed since generators may have state (next id to produce).Note that actual type of 'context' is
com.fasterxml.jackson.databind.SerializerProvider, but can not be declared here as type itself (as well as call to this object) comes from databind package.- Specified by:
newForSerializationin classObjectIdGenerator<Object>- Parameters:
context- Serialization context object used (of typecom.fasterxml.jackson.databind.SerializerProvider); may be needed by more complex generators to access contextual information such as configuration.
-
key
Description copied from class:ObjectIdGeneratorMethod for constructing key to use for ObjectId-to-POJO maps.- Specified by:
keyin classObjectIdGenerator<Object>
-
getScope
- Specified by:
getScopein classObjectIdGenerator<T>
-
canUseFor
Description copied from class:ObjectIdGeneratorMethod 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 (usingObjectIdGenerator.newForSerialization(java.lang.Object)).- Specified by:
canUseForin classObjectIdGenerator<T>- Returns:
- True if this instance can be used as-is; false if not
-