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/ser/std/TokenBufferSerializer.java
package com.fasterxml.jackson.databind.ser.std;
import java.io.IOException;
import java.lang.reflect.Type;
import com.fasterxml.jackson.core.*;
import com.fasterxml.jackson.core.type.WritableTypeId;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JacksonStdImpl;
import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper;
import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
import com.fasterxml.jackson.databind.util.TokenBuffer;
/**
* We also want to directly support serialization of {@link TokenBuffer};
* and since it is part of core package, it cannot implement
* {@link com.fasterxml.jackson.databind.JsonSerializable}
* (which is only included in the mapper package)
*/
@JacksonStdImpl
@SuppressWarnings("serial")
public class TokenBufferSerializer
extends StdSerializer<TokenBuffer>
{
public TokenBufferSerializer() { super(TokenBuffer.class); }
@Override
public void serialize(TokenBuffer value, JsonGenerator jgen, SerializerProvider provider)
throws IOException
{
value.serialize(jgen);
}
/**
* Implementing typed output for contents of a TokenBuffer is very tricky,
* since we do not know for sure what its contents might look like (or, rather,
* we do know when serializing, but not necessarily when deserializing!)
* One possibility would be to check the current token, and use that to
* determine if we would output JSON Array, Object or scalar value.
*<p>
* Note that we just claim it is scalar; this should work ok and is simpler
* than doing introspection on both serialization and deserialization.
*/
@Override
public final void serializeWithType(TokenBuffer value, JsonGenerator g,
SerializerProvider provider, TypeSerializer typeSer) throws IOException
{
// 28-Jun-2017, tatu: As per javadoc, not sure what to report as likely shape. Could
// even look into first actual token inside... but, for now let's keep it simple
WritableTypeId typeIdDef = typeSer.writeTypePrefix(g,
typeSer.typeId(value, JsonToken.VALUE_EMBEDDED_OBJECT));
serialize(value, g, provider);
typeSer.writeTypeSuffix(g, typeIdDef);
}
@Override
public JsonNode getSchema(SerializerProvider provider, Type typeHint)
{
// Not 100% sure what we should say here: type is basically not known.
// This seems like closest approximation
return createSchemaNode("any", true);
}
@Override
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)
throws JsonMappingException
{
// Not 100% sure what we should say here: type is basically not known.
// This seems like closest approximation
visitor.expectAnyFormat(typeHint);
}
}
⏎ com/fasterxml/jackson/databind/ser/std/TokenBufferSerializer.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, ≈190🔥, 0💬
Popular Posts:
JDK 11 jrt-fs.jar is the JAR file for JDK 11 JRT-FS (Java RunTime - File System) defined in the "jdk...
Apache Log4j IOStreams is a Log4j API extension that provides numerous classes from java.io that can...
JDK 6 tools.jar is the JAR file for JDK 6 tools. It contains Java classes to support different JDK t...
What Is commons-collections4-4.4 .jar?commons-collections4-4.4 .jaris the JAR file for Apache Common...
Java Cryptography Extension 1.6 JAR File Size and Download Location: File name: jce.jar, jce-1.6.jar...