Package com.fasterxml.jackson.annotation
Class ObjectIdGenerators.PropertyGenerator
java.lang.Object
com.fasterxml.jackson.annotation.ObjectIdGenerator<T>
com.fasterxml.jackson.annotation.ObjectIdGenerators.PropertyGenerator
- All Implemented Interfaces:
Serializable
- Enclosing class:
- ObjectIdGenerators
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.fasterxml.jackson.annotation.ObjectIdGenerator
ObjectIdGenerator.IdKey
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
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 (usingObjectIdGenerator.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
-
Field Details
-
_scope
-
-
Constructor Details
-
PropertyGenerator
-
-
Method Details
-
getScope
- Specified by:
getScope
in classObjectIdGenerator<T>
-
canUseFor
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 (usingObjectIdGenerator.newForSerialization(java.lang.Object)
).- Specified by:
canUseFor
in classObjectIdGenerator<T>
- Returns:
- True if this instance can be used as-is; false if not
-
generateId
Description copied from class:ObjectIdGenerator
Method used for generating a new Object Identifier to serialize for given POJO.- Specified by:
generateId
in classObjectIdGenerator<T>
- Parameters:
forPojo
- POJO for which identifier is needed- Returns:
- Object Identifier to use.
-