Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.fasterxml.jackson.databind.deser.std;
 
 
Deserializer for com.fasterxml.jackson.databind.JavaType values.
public class JavaTypeDeserializer
    private static final long serialVersionUID = 1;
    public final static JavaTypeDeserializer instance = new JavaTypeDeserializer();
    
    public JavaTypeDeserializer() { super(JavaType.class); }
    
    @Override
        throws IOExceptionJsonProcessingException
    {
        JsonToken curr = jp.getCurrentToken();
        // Usually should just get string value:
        if (curr == .) {
            String str = jp.getText().trim();
            if (str.length() == 0) {
                return getEmptyValue();
            }
            return ctxt.getTypeFactory().constructFromCanonical(str);
        }
        // or occasionally just embedded object maybe
        if (curr == .) {
            return (JavaTypejp.getEmbeddedObject();
        }
        throw ctxt.mappingException();
    }
New to GrepCode? Check out our FAQ X