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:
  • 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(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.