Jackson Data Binding Source Code

Jackson is "the Java JSON library" or "the best JSON parser for Java". Or simply as "JSON for Java".

  • Jackson Data Binding module allows you to converts JSON to and from POJO (Plain Old Java Object) using property accessor or using annotations.
  • Jackson Databind Source Code files are provided in the source packge (jackson-databind-2.12.4-sources.jar). You can download it at Jackson Maven Website.

    You can also browse Jackson Databind Source Code below:

    ✍: FYIcenter.com

    com/fasterxml/jackson/databind/exc/InvalidFormatException.java

    package com.fasterxml.jackson.databind.exc;
    
    import com.fasterxml.jackson.core.JsonLocation;
    import com.fasterxml.jackson.core.JsonParser;
    
    /**
     * Specialized sub-class of {@link MismatchedInputException}
     * that is used when the underlying problem appears to be that
     * of bad formatting of a value to deserialize.
     * 
     * @since 2.1
     */
    public class InvalidFormatException
        extends MismatchedInputException // since 2.9
    {
        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;
    
        /*
        /**********************************************************
        /* Life-cycle
        /**********************************************************
         */
    
        /**
         * @deprecated Since 2.7 Use variant that takes {@link JsonParser}
         */
        @Deprecated // since 2.7
        public InvalidFormatException(String msg,
                Object value, Class<?> targetType)
        {
            super(null, msg);
            _value = value;
            _targetType = targetType;
        }
    
        /**
         * @deprecated Since 2.7 Use variant that takes {@link JsonParser}
         */
        @Deprecated // since 2.7
        public InvalidFormatException(String msg, JsonLocation loc,
                Object value, Class<?> targetType)
        {
            super(null, msg, loc);
            _value = value;
            _targetType = targetType;
        }
    
        /**
         * @since 2.7
         */
        public InvalidFormatException(JsonParser p,
                String msg, Object value, Class<?> targetType)
        {
            super(p, msg, targetType);
            _value = value;
        }
    
        public static InvalidFormatException from(JsonParser p, String msg,
                Object value, Class<?> targetType)
        {
            return new InvalidFormatException(p, msg, value, targetType);
        }
    
        /*
        /**********************************************************
        /* Additional accessors
        /**********************************************************
         */
    
        /**
         * Accessor for checking source value (String, Number usually) that could not
         * be deserialized into target type ({@link #getTargetType}).
         * Note that value may not be available, depending on who throws the exception
         * and when.
         */
        public Object getValue() {
            return _value;
        }
    }
    

    com/fasterxml/jackson/databind/exc/InvalidFormatException.java

     

    ⇒ Jackson Annotations Source Code

    ⇐ Download and Install Jackson Binary Package

    ⇑ Downloading and Reviewing jackson-*.jar

    ⇑⇑ Jackson - Java JSON library

    2022-03-29, 31899👍, 0💬