Top Description Fields Constructors Methods
tools.jackson.databind.ser

public final Class WritableObjectId

extends Object
Class Inheritance
Imports
com.fasterxml.jackson.annotation.ObjectIdGenerator, tools.jackson.core.JacksonException, .JsonGenerator, .SerializableString, tools.jackson.databind.SerializationContext, tools.jackson.databind.ser.impl.ObjectIdWriter

Simple value container used to keep track of Object Ids during serialization.

Field Summary

Modifier and TypeField and Description
public final ObjectIdGenerator<?>
public Object
protected boolean
idWritten

Marker to denote whether Object Id value has been written as part of an Object, to be referencible.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Object
generateId(Object forPojo)

public void
writeAsDeclaration(JsonGenerator g, SerializationContext ctxt, ObjectIdWriter w)

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.

public boolean
writeAsReference(JsonGenerator g, SerializationContext ctxt, ObjectIdWriter w)

Method to call to write a reference to object that this id refers.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

generatorback to summary
public final ObjectIdGenerator<?> generator
idback to summary
public Object id
idWrittenback to summary
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 Detail

WritableObjectIdback to summary
public WritableObjectId(ObjectIdGenerator<?> g)

Method Detail

generateIdback to summary
public Object generateId(Object forPojo)
writeAsDeclarationback to summary
public void writeAsDeclaration(JsonGenerator g, SerializationContext ctxt, ObjectIdWriter w) throws 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.

writeAsReferenceback to summary
public boolean writeAsReference(JsonGenerator g, SerializationContext ctxt, ObjectIdWriter w) throws JacksonException

Method to call to write a reference to object that this id refers. Usually this is done after an earlier call to writeAsDeclaration.