Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.fasterxml.jackson.databind.ser.impl;
Object that knows how to serialize Object Ids.
public final class ObjectIdWriter
    public final JavaType idType;

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 SerializedString propertyName;

Blueprint generator instance: actual instance will be fetched from com.fasterxml.jackson.databind.SerializerProvider using this as the key.
    public final ObjectIdGenerator<?> generator;
Serializer used for serializing id values.
    public final JsonSerializer<Objectserializer;

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 boolean alwaysAsId;
    /* Life-cycle
    protected ObjectIdWriter(JavaType tSerializedString propName,
            ObjectIdGenerator<?> genJsonSerializer<?> serboolean alwaysAsId)
         = t;
         = propName;
         = gen;
         = (JsonSerializer<Object>) ser;
        this. = 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 static ObjectIdWriter construct(JavaType idTypePropertyName propName,
            ObjectIdGenerator<?> generatorboolean alwaysAsId)
        String simpleName = (propName == null) ? null : propName.getSimpleName();
        return construct(idTypesimpleNamegeneratoralwaysAsId);
    @Deprecated // since 2.3
    public static ObjectIdWriter construct(JavaType idTypeString propName,
            ObjectIdGenerator<?> generatorboolean alwaysAsId)
        SerializedString serName = (propName == null) ? null : new SerializedString(propName);
        return new ObjectIdWriter(idTypeserNamegeneratornullalwaysAsId);
    public ObjectIdWriter withSerializer(JsonSerializer<?> ser) {
        return new ObjectIdWriter(ser);


    public ObjectIdWriter withAlwaysAsId(boolean newState) {
        if (newState == ) {
            return this;
        return new ObjectIdWriter(newState);
New to GrepCode? Check out our FAQ X