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/util/JSONWrappedObject.java
package com.fasterxml.jackson.databind.util; import java.io.IOException; import com.fasterxml.jackson.core.*; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.jsontype.TypeSerializer; /** * General-purpose wrapper class that can be used to decorate serialized * value with arbitrary literal prefix and suffix. This can be used for * example to construct arbitrary Javascript values (similar to how basic * function name and parenthesis are used with JSONP). * * @see com.fasterxml.jackson.databind.util.JSONPObject */ public class JSONWrappedObject implements JsonSerializable { /** * Literal String to output before serialized value. * Will not be quoted when serializing value. */ protected final String _prefix; /** * Literal String to output after serialized value. * Will not be quoted when serializing value. */ protected final String _suffix; /** * Value to be serialized as JSONP padded; can be null. */ protected final Object _value; /** * Optional static type to use for serialization; if null, runtime * type is used. Can be used to specify declared type which defines * serializer to use, as well as aspects of extra type information * to include (if any). */ protected final JavaType _serializationType; public JSONWrappedObject(String prefix, String suffix, Object value) { this(prefix, suffix, value, (JavaType) null); } /** * Constructor that should be used when specific serialization type to use * is important, and needs to be passed instead of just using runtime * (type-erased) type of the value. */ public JSONWrappedObject(String prefix, String suffix, Object value, JavaType asType) { _prefix = prefix; _suffix = suffix; _value = value; _serializationType = asType; } /* /************************************************************** /* JsonSerializable(WithType) implementation /************************************************************** */ @Override public void serializeWithType(JsonGenerator jgen, SerializerProvider provider, TypeSerializer typeSer) throws IOException { // No type for JSONP wrapping: value serializer will handle typing for value: serialize(jgen, provider); } @Override public void serialize(JsonGenerator jgen, SerializerProvider provider) throws IOException { // First, wrapping: if (_prefix != null) jgen.writeRaw(_prefix); if (_value == null) { provider.defaultSerializeNull(jgen); } else if (_serializationType != null) { provider.findTypedValueSerializer(_serializationType, true, null).serialize(_value, jgen, provider); } else { Class<?> cls = _value.getClass(); provider.findTypedValueSerializer(cls, true, null).serialize(_value, jgen, provider); } if (_suffix != null) jgen.writeRaw(_suffix); } /* /************************************************************** /* Accessors /************************************************************** */ public String getPrefix() { return _prefix; } public String getSuffix() { return _suffix; } public Object getValue() { return _value; } public JavaType getSerializationType() { return _serializationType; } }
⏎ com/fasterxml/jackson/databind/util/JSONWrappedObject.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, 47074👍, 0💬
Popular Posts:
How to run "jarsigner" command from JDK tools.jar file? "jarsigner" command allows you to digitally ...
Apache Log4j Core Implementation provides the functional components of the logging system. Users are...
How to download and install ojdbc5.jar for Oracle 11g R1? ojdbc5.jar for Oracle 11g R1 is a Java 5 J...
How to download and install Apache XMLBeans-2.6.0.zip? If you want to try the XMLBeans Java library,...
What is the sax\Writer.java provided in the Apache Xerces package? I have Apache Xerces 2.11.0 insta...