Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
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 Databind Source Code files are provided in the source packge (jackson-databind-2.14.0-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/deser/std/JsonLocationInstantiator.java
package com.fasterxml.jackson.databind.deser.std;
import com.fasterxml.jackson.core.JsonLocation;
import com.fasterxml.jackson.core.io.ContentReference;
import com.fasterxml.jackson.databind.DeserializationConfig;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.PropertyMetadata;
import com.fasterxml.jackson.databind.PropertyName;
import com.fasterxml.jackson.databind.deser.CreatorProperty;
import com.fasterxml.jackson.databind.deser.SettableBeanProperty;
import com.fasterxml.jackson.databind.deser.ValueInstantiator;
/**
* For {@link JsonLocation}, we should be able to just implement
* {@link ValueInstantiator} (not that explicit one would be very
* hard but...)
*/
public class JsonLocationInstantiator
extends ValueInstantiator.Base
{
private static final long serialVersionUID = 1L;
public JsonLocationInstantiator() {
super(JsonLocation.class);
}
@Override
public boolean canCreateFromObjectWith() { return true; }
@Override
public SettableBeanProperty[] getFromObjectArguments(DeserializationConfig config) {
JavaType intType = config.constructType(Integer.TYPE);
JavaType longType = config.constructType(Long.TYPE);
return new SettableBeanProperty[] {
// 14-Mar-2021, tatu: with 2.13 and later, not really used,
// but may be produced by older versions so leave as is.
creatorProp("sourceRef", config.constructType(Object.class), 0),
creatorProp("byteOffset", longType, 1),
creatorProp("charOffset", longType, 2),
creatorProp("lineNr", intType, 3),
creatorProp("columnNr", intType, 4)
};
}
private static CreatorProperty creatorProp(String name, JavaType type, int index) {
return CreatorProperty.construct(PropertyName.construct(name), type, null,
null, null, null, index, null, PropertyMetadata.STD_REQUIRED);
}
@Override
public Object createFromObjectWith(DeserializationContext ctxt, Object[] args) {
// 14-Mar-2021, tatu: Before 2.13 constructor directly took "raw" source ref;
// with 2.13 changed to use `InputSourceReference`... left almost as is,
// for compatibility.
final ContentReference srcRef = ContentReference.rawReference(args[0]);
return new JsonLocation(srcRef, _long(args[1]), _long(args[2]),
_int(args[3]), _int(args[4]));
}
private final static long _long(Object o) {
return (o == null) ? 0L : ((Number) o).longValue();
}
private final static int _int(Object o) {
return (o == null) ? 0 : ((Number) o).intValue();
}
}
⏎ com/fasterxml/jackson/databind/deser/std/JsonLocationInstantiator.java
Or download all of them as a single archive file:
File name: jackson-databind-2.14.0-sources.jar File size: 1187952 bytes Release date: 2022-11-05 Download
⇒ Jackson Annotations Source Code
⇐ Download and Install Jackson Binary Package
2022-03-29, ≈156🔥, 0💬
Popular Posts:
Snappy-Java is a Java port of the "snappy", a fast C++ compresser/decompresser developed by Google. ...
JDK 11 jdk.internal.vm.compiler .jmodis the JMOD file for JDK 11 Internal VM Compiler module. JDK 11...
What is the jaxp\TypeInfoWriter.java provided in the Apache Xerces package? I have Apache Xerces 2.1...
HttpComponents Client Source Code Files are provided in the source package file, httpcomponents-clie...
Java Advanced Imaging (JAI) is a Java platform extension API that provides a set of object-oriented ...