Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
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 (309)
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/ext/SqlBlobSerializer.java
package com.fasterxml.jackson.databind.ext; import java.io.IOException; import java.io.InputStream; import java.sql.Blob; import java.sql.SQLException; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.core.type.WritableTypeId; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.annotation.JacksonStdImpl; import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonArrayFormatVisitor; import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatTypes; import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper; import com.fasterxml.jackson.databind.jsontype.TypeSerializer; import com.fasterxml.jackson.databind.ser.std.StdScalarSerializer; /** * Serializer implementation for {@link java.sql.Blob} to write as binary * (for JSON and other formats Base64-encoded String, for binary formats as * true binary). * * @see com.fasterxml.jackson.databind.ser.std.ByteArraySerializer * * @since 2.12 */ @JacksonStdImpl @SuppressWarnings("serial") public class SqlBlobSerializer extends StdScalarSerializer<Blob> { public SqlBlobSerializer() { super(Blob.class); } @Override public boolean isEmpty(SerializerProvider provider, Blob value) { // Could see if "length == 0" but that might be expensive operation return (value == null); } @Override public void serialize(Blob value, JsonGenerator gen, SerializerProvider ctxt) throws IOException { _writeValue(value, gen, ctxt); } // Copied from `com.fasterxml.jackson.databind.ser.std.ByteArraySerializer` @Override public void serializeWithType(Blob value, JsonGenerator gen, SerializerProvider ctxt, TypeSerializer typeSer) throws IOException { // most likely scalar WritableTypeId typeIdDef = typeSer.writeTypePrefix(gen, typeSer.typeId(value, JsonToken.VALUE_EMBEDDED_OBJECT)); _writeValue(value, gen, ctxt); typeSer.writeTypeSuffix(gen, typeIdDef); } protected void _writeValue(Blob value, JsonGenerator gen, SerializerProvider ctxt) throws IOException { InputStream in = null; try { in = value.getBinaryStream(); } catch(SQLException e) { ctxt.reportMappingProblem(e, "Failed to access `java.sql.Blob` value to write as binary value"); } gen.writeBinary(ctxt.getConfig().getBase64Variant(), in, -1); } // Copied from `com.fasterxml.jackson.databind.ser.std.ByteArraySerializer` @Override public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException { // 08-Nov-2020, tatu: Same problem as for `byte[]`... should // make work either as String/base64, or array of numbers, // with a qualifier that can be used to determine it's byte[] JsonArrayFormatVisitor v2 = visitor.expectArrayFormat(typeHint); if (v2 != null) { v2.itemsFormat(JsonFormatTypes.INTEGER); } } }
⏎ com/fasterxml/jackson/databind/ext/SqlBlobSerializer.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, 109410👍, 0💬
Popular Posts:
What Is poi-5.2.3.jar? poi-5.2.3.jar is one of the JAR files for Apache POI 5.2.3, which provides an...
JDK 1.1 source code directory contains Java source code for JDK 1.1 core classes: "C:\fyicenter\jdk-...
JUnit Source Code Files are provided in the source package file, junit-4.13.2-sources.jar .You can b...
JDK 11 jdk.charsets.jmod is the JMOD file for JDK 11 Charsets module. JDK 11 Charsets module compile...
JLayer is a library that decodes/plays/converts MPEG 1/2/2.5 Layer 1/2/3 (i.e. MP3) in real time for...