Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.fasterxml.jackson.databind.ser.impl;
 
 
 
Simple value container used to keep track of Object Ids during serialization.
public final class WritableObjectId
    public final ObjectIdGenerator<?> generator;
    public Object id;
    protected boolean idWritten = false;
    
    public WritableObjectId(ObjectIdGenerator<?> generator) {
        this. = generator;
    }
    
    public boolean writeAsId(JsonGenerator jgenSerializerProvider providerObjectIdWriter w)
        throws IOExceptionJsonGenerationException
    {
        if ( != null && ( || w.alwaysAsId)) {
            w.serializer.serialize(jgenprovider);
            return true;
        }
        return false;
    }
    
    public Object generateId(Object forPojo) {
        return ( = .generateId(forPojo));
    }
    public void writeAsField(JsonGenerator jgenSerializerProvider provider,
            ObjectIdWriter w)
        throws IOExceptionJsonGenerationException
    {
        SerializedString name = w.propertyName;
         = true;
        if (name != null) {
            jgen.writeFieldName(name);
            w.serializer.serialize(jgenprovider);
        }
    }
New to GrepCode? Check out our FAQ X