Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.fasterxml.jackson.databind.deser.std;
 
 
Bogus deserializer that will simply skip all content there is to map and returns Java null reference.

Since:
2.2
    extends StdDeserializer<Object>
    private static final long serialVersionUID = 1L;
    public final static NullifyingDeserializer instance = new NullifyingDeserializer();
    
    public NullifyingDeserializer() { super(Object.class); }
    /*
    /**********************************************************
    /* Deserializer API
    /**********************************************************
     */
    
    @Override
        throws IOExceptionJsonProcessingException
    {
        jp.skipChildren();
        return null;
    }
    @Override
            TypeDeserializer typeDeserializer)
        throws IOExceptionJsonProcessingException
    {
        // Not sure if we need to bother but:
        JsonToken t = jp.getCurrentToken();
        switch (t) {
        case :
        case :
        case :
            return typeDeserializer.deserializeTypedFromAny(jpctxt);
        default:
            return null;
        }
    }
New to GrepCode? Check out our FAQ X