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/ser/std/NullSerializer.java
package com.fasterxml.jackson.databind.ser.std; import java.lang.reflect.Type; import java.io.IOException; import com.fasterxml.jackson.core.*; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.annotation.JacksonStdImpl; import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper; import com.fasterxml.jackson.databind.jsontype.TypeSerializer; /** * This is a simple dummy serializer that will just output literal * JSON null value whenever serialization is requested. * Used as the default "null serializer" (which is used for serializing * null object references unless overridden), as well as for some * more exotic types (java.lang.Void). */ @JacksonStdImpl @SuppressWarnings("serial") public class NullSerializer extends StdSerializer<Object> { public final static NullSerializer instance = new NullSerializer(); private NullSerializer() { super(Object.class); } @Override public void serialize(Object value, JsonGenerator gen, SerializerProvider provider) throws IOException { gen.writeNull(); } /** * Although this method should rarely get called, for convenience we should override * it, and handle it same way as "natural" types: by serializing exactly as is, * without type decorations. The most common possible use case is that of delegation * by JSON filter; caller cannot know what kind of serializer it gets handed. */ @Override public void serializeWithType(Object value, JsonGenerator gen, SerializerProvider serializers, TypeSerializer typeSer) throws IOException { gen.writeNull(); } @Override public JsonNode getSchema(SerializerProvider provider, Type typeHint) throws JsonMappingException { return createSchemaNode("null"); } @Override public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException { visitor.expectNullFormat(typeHint); } }
⏎ com/fasterxml/jackson/databind/ser/std/NullSerializer.java
Â
⇒ Jackson Annotations Source Code
⇠Download and Install Jackson Binary Package
⇑ Downloading and Reviewing jackson-*.jar
⇑⇑ Jackson - Java JSON library
2022-03-29, 31978👍, 0💬
Popular Posts:
How to perform XML Schema validation with dom\Writer.java provided in the Apache Xerces package? You...
Apache Log4j provides the interface that applications should code to and provides the adapter compon...
JDK 11 jdk.hotspot.agent.jmod is the JMOD file for JDK 11 Hotspot Agent module. JDK 11 Hotspot Agent...
Smack is an Open Source XMPP (Jabber) client library for instant messaging and presence. A pure Java...
kernel.jar is a component in iText Java library to provide low-level functionalities. iText Java lib...