Top Description Fields Constructors Methods
com.fasterxml.jackson.databind.ser.impl

public final Class ObjectIdWriter

extends Object
Class Inheritance
Imports
com.fasterxml.jackson.annotation.ObjectIdGenerator, com.fasterxml.jackson.core.SerializableString, com.fasterxml.jackson.core.io.SerializedString, com.fasterxml.jackson.databind.*

Object that knows how to serialize Object Ids.

Field Summary

Modifier and TypeField and Description
public final boolean
alwaysAsId

Marker that indicates what the first reference is to be serialized as full POJO, or as Object Id (other references will always be serialized as Object Id)

public final ObjectIdGenerator<?>
generator

Blueprint generator instance: actual instance will be fetched from SerializerProvider using this as the key.

public final JavaType
public final SerializableString
propertyName

Name of id property to write, if not null: if null, should only write references, but id property is handled by some other entity.

public final JsonSerializer<Object>
serializer

Serializer used for serializing id values.

Constructor Summary

AccessConstructor and Description
protected
ObjectIdWriter(JavaType t, SerializableString propName, ObjectIdGenerator<?> gen, JsonSerializer<?> ser, boolean alwaysAsId)

Method Summary

Modifier and TypeMethod and Description
public static ObjectIdWriter
construct(JavaType idType, PropertyName propName, ObjectIdGenerator<?> generator, boolean alwaysAsId)

Factory method called by com.fasterxml.jackson.databind.ser.std.BeanSerializerBase with the initial information based on standard settings for the type for which serializer is being built.

public ObjectIdWriter
withAlwaysAsId(boolean newState)

public ObjectIdWriter
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

alwaysAsIdback to summary
public final boolean alwaysAsId

Marker that indicates what the first reference is to be serialized as full POJO, or as Object Id (other references will always be serialized as Object Id)

Since
2.1
generatorback to summary
public final ObjectIdGenerator<?> generator

Blueprint generator instance: actual instance will be fetched from SerializerProvider using this as the key.

idTypeback to summary
public final JavaType idType
propertyNameback to summary
public final SerializableString propertyName

Name of id property to write, if not null: if null, should only write references, but id property is handled by some other entity.

serializerback to summary
public final JsonSerializer<Object> serializer

Serializer used for serializing id values.

Constructor Detail

ObjectIdWriterback to summary
protected ObjectIdWriter(JavaType t, SerializableString propName, ObjectIdGenerator<?> gen, JsonSerializer<?> ser, boolean alwaysAsId)
Annotations
@SuppressWarnings:unchecked

Method Detail

constructback to summary
public static ObjectIdWriter construct(JavaType idType, PropertyName propName, ObjectIdGenerator<?> generator, boolean alwaysAsId)

Factory method called by com.fasterxml.jackson.databind.ser.std.BeanSerializerBase with the initial information based on standard settings for the type for which serializer is being built.

Since
2.3
withAlwaysAsIdback to summary
public ObjectIdWriter withAlwaysAsId(boolean newState)
Since
2.1
withSerializerback to summary
public ObjectIdWriter withSerializer(JsonSerializer<?> ser)