Class WritableObjectId

java.lang.Object
tools.jackson.databind.ser.WritableObjectId

public final class WritableObjectId extends Object
Simple value container used to keep track of Object Ids during serialization.
  • Field Details

    • generator

      public final com.fasterxml.jackson.annotation.ObjectIdGenerator<?> generator
    • id

      public Object id
    • idWritten

      protected boolean idWritten
      Marker to denote whether Object Id value has been written as part of an Object, to be referencible. Remains false when forward-reference is written.
  • Constructor Details

    • WritableObjectId

      public WritableObjectId(com.fasterxml.jackson.annotation.ObjectIdGenerator<?> g)
  • Method Details

    • writeAsReference

      public boolean writeAsReference(tools.jackson.core.JsonGenerator g, SerializationContext ctxt, ObjectIdWriter w) throws tools.jackson.core.JacksonException
      Method to call to write a reference to object that this id refers. Usually this is done after an earlier call to writeAsDeclaration(JsonGenerator, SerializationContext, ObjectIdWriter).
      Throws:
      tools.jackson.core.JacksonException
    • generateId

      public Object generateId(Object forPojo)
    • writeAsDeclaration

      public void writeAsDeclaration(tools.jackson.core.JsonGenerator g, SerializationContext ctxt, ObjectIdWriter w) throws tools.jackson.core.JacksonException
      Method called to output Object Id declaration, either using native Object Id write method JsonGenerator.writeObjectId(Object) (if allowed), or, if not, just writing it as an Object property with specified property name and id value.
      Throws:
      tools.jackson.core.JacksonException