Package com.fasterxml.jackson.annotation
Class ObjectIdGenerators.Base<T>
- java.lang.Object
-
- com.fasterxml.jackson.annotation.ObjectIdGenerator<T>
-
- com.fasterxml.jackson.annotation.ObjectIdGenerators.Base<T>
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
ObjectIdGenerators.IntSequenceGenerator
,ObjectIdGenerators.PropertyGenerator
,ObjectIdGenerators.StringIdGenerator
,ObjectIdGenerators.UUIDGenerator
- Enclosing class:
- ObjectIdGenerators
private abstract static class ObjectIdGenerators.Base<T> extends ObjectIdGenerator<T>
Shared base class for concrete implementations.
-
-
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 java.lang.Class<?>
_scope
-
Constructor Summary
Constructors Modifier Constructor Description protected
Base(java.lang.Class<?> scope)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods 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 (usingObjectIdGenerator.newForSerialization(java.lang.Object)
).abstract T
generateId(java.lang.Object forPojo)
Method used for generating a new Object Identifier to serialize for given POJO.java.lang.Class<?>
getScope()
-
Methods inherited from class com.fasterxml.jackson.annotation.ObjectIdGenerator
forScope, isValidReferencePropertyName, key, maySerializeAsObject, newForSerialization
-
-
-
-
Method Detail
-
getScope
public final java.lang.Class<?> getScope()
- Specified by:
getScope
in classObjectIdGenerator<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 (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
public abstract T generateId(java.lang.Object forPojo)
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.
-
-