Categories:
Audio (13)
Biotech (29)
Bytecode (35)
Database (77)
Framework (7)
Game (7)
General (512)
Graphics (53)
I/O (32)
IDE (2)
JAR Tools (86)
JavaBeans (16)
JDBC (89)
JDK (337)
JSP (20)
Logging (103)
Mail (54)
Messaging (8)
Network (71)
PDF (94)
Report (7)
Scripting (83)
Security (32)
Server (119)
Servlet (17)
SOAP (24)
Testing (50)
Web (19)
XML (301)
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.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/node/BaseJsonNode.java
package com.fasterxml.jackson.databind.node; import java.io.IOException; import com.fasterxml.jackson.core.*; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonSerializable; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.jsontype.TypeSerializer; /** * Abstract base class common to all standard {@link JsonNode} * implementations. * The main addition here is that we declare that sub-classes must * implement {@link JsonSerializable}. * This simplifies object mapping aspects a bit, as no external serializers are needed. *<p> * Since 2.10, all implements have been {@link java.io.Serializable}. */ public abstract class BaseJsonNode extends JsonNode implements java.io.Serializable { private static final long serialVersionUID = 1L; // Simplest way is by using a helper Object writeReplace() { return NodeSerialization.from(this); } protected BaseJsonNode() { } /* /********************************************************** /* Basic definitions for non-container types /********************************************************** */ @Override public final JsonNode findPath(String fieldName) { JsonNode value = findValue(fieldName); if (value == null) { return MissingNode.getInstance(); } return value; } // Also, force (re)definition (2.7) @Override public abstract int hashCode(); /* /********************************************************************** /* Improved required-ness checks for standard JsonNode implementations /********************************************************************** */ @Override public JsonNode required(String fieldName) { return _reportRequiredViolation("Node of type `%s` has no fields", getClass().getSimpleName()); } @Override public JsonNode required(int index) { return _reportRequiredViolation("Node of type `%s` has no indexed values", getClass().getSimpleName()); } /* /********************************************************** /* Support for traversal-as-stream /********************************************************** */ @Override public JsonParser traverse() { return new TreeTraversingParser(this); } @Override public JsonParser traverse(ObjectCodec codec) { return new TreeTraversingParser(this, codec); } /** * Method that can be used for efficient type detection * when using stream abstraction for traversing nodes. * Will return the first {@link JsonToken} that equivalent * stream event would produce (for most nodes there is just * one token but for structured/container types multiple) */ @Override public abstract JsonToken asToken(); /** * Returns code that identifies type of underlying numeric * value, if (and only if) node is a number node. */ @Override public JsonParser.NumberType numberType() { // most types non-numeric, so: return null; } /* /********************************************************** /* JsonSerializable /********************************************************** */ /** * Method called to serialize node instances using given generator. */ @Override public abstract void serialize(JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException; /** * Type information is needed, even if JsonNode instances are "plain" JSON, * since they may be mixed with other types. */ @Override public abstract void serializeWithType(JsonGenerator jgen, SerializerProvider provider, TypeSerializer typeSer) throws IOException, JsonProcessingException; /* /********************************************************** /* Standard method overrides /********************************************************** */ @Override public String toString() { return InternalNodeMapper.nodeToString(this); } @Override public String toPrettyString() { return InternalNodeMapper.nodeToPrettyString(this); } }
⏎ com/fasterxml/jackson/databind/node/BaseJsonNode.java
Â
⇒ Jackson Annotations Source Code
⇠Download and Install Jackson Binary Package
⇑ Downloading and Reviewing jackson-*.jar
⇑⇑ Jackson - Java JSON library
2022-03-29, 31934👍, 0💬
Popular Posts:
JSP(tm) Standard Tag Library 1.1 implementation - Jakarta Taglibs hosts the Standard Taglib 1.1, an ...
What Is mail.jar of JavaMail 1.3? I got the JAR file from javamail-1_3.zip. mail.jar in javamail-1_3...
MP3SPI is a Java Service Provider Interface that adds MP3 (MPEG 1/2/2.5 Layer 1/2/3) audio format su...
How to run "jar" command from JDK tools.jar file? "jar" is the JAR (Java Archive) file management co...
pache Derby is an open source relational database implemented entirely in Java and available under t...