Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.fasterxml.jackson.databind.exc;
 
Specialized sub-class of com.fasterxml.jackson.databind.JsonMappingException that is used when the underlying problem appears to be that of bad formatting of a value to deserialize.

Since:
2.1
    private static final long serialVersionUID = 1L; // silly Eclipse, warnings

    
Underlying value that could not be deserialized into target type, if available.
    protected final Object _value;

    
Intended target type (type-erased class) that value could not be deserialized into, if known.
    protected final Class<?> _targetType;
    
    /*
    /**********************************************************
    /* Life-cycle
    /**********************************************************
     */
    
    public InvalidFormatException(String msg,
            Object valueClass<?> targetType)
    {
        super(msg);
         = value;
         = targetType;
    }
    public InvalidFormatException(String msgJsonLocation loc,
            Object valueClass<?> targetType)
    {
        super(msgloc);
         = value;
         = targetType;
    }
    
    public static InvalidFormatException from(JsonParser jpString msg,
            Object valueClass<?> targetType)
    {
        return new InvalidFormatException(msgjp.getTokenLocation(),
                valuetargetType);
    }
    /*
    /**********************************************************
    /* Additional accessors
    /**********************************************************
     */

    
Accessor for checking source value (String, Number usually) that could not be deserialized into target type (getTargetType()). Note that value may not be available, depending on who throws the exception and when.
    public Object getValue() {
        return ;
    }

    
Accessor for checking target type of value (getValue() that failed to deserialize. Note that type may not be available, depending on who throws the exception and when.
    public Class<?> getTargetType() {
        return ;
    }
New to GrepCode? Check out our FAQ X