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/EnumSetSerializer.java
package com.fasterxml.jackson.databind.ser.std;
import java.io.IOException;
import java.util.*;
import com.fasterxml.jackson.core.*;
import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
@SuppressWarnings("serial")
public class EnumSetSerializer
extends AsArraySerializerBase<EnumSet<? extends Enum<?>>>
{
/**
* @since 2.6
*/
public EnumSetSerializer(JavaType elemType) {
super(EnumSet.class, elemType, true, null, null);
}
public EnumSetSerializer(EnumSetSerializer src,
BeanProperty property, TypeSerializer vts, JsonSerializer<?> valueSerializer,
Boolean unwrapSingle) {
super(src, property, vts, valueSerializer, unwrapSingle);
}
@Override
public EnumSetSerializer _withValueTypeSerializer(TypeSerializer vts) {
// no typing for enums (always "hard" type)
return this;
}
@Override
public EnumSetSerializer withResolved(BeanProperty property,
TypeSerializer vts, JsonSerializer<?> elementSerializer,
Boolean unwrapSingle) {
return new EnumSetSerializer(this, property, vts, elementSerializer, unwrapSingle);
}
@Override
public boolean isEmpty(SerializerProvider prov, EnumSet<? extends Enum<?>> value) {
return value.isEmpty();
}
@Override
public boolean hasSingleElement(EnumSet<? extends Enum<?>> value) {
return value.size() == 1;
}
@Override
public final void serialize(EnumSet<? extends Enum<?>> value, JsonGenerator gen,
SerializerProvider provider) throws IOException
{
final int len = value.size();
if (len == 1) {
if (((_unwrapSingle == null)
&& provider.isEnabled(SerializationFeature.WRITE_SINGLE_ELEM_ARRAYS_UNWRAPPED))
|| (_unwrapSingle == Boolean.TRUE)) {
serializeContents(value, gen, provider);
return;
}
}
gen.writeStartArray(value, len);
serializeContents(value, gen, provider);
gen.writeEndArray();
}
@Override
public void serializeContents(EnumSet<? extends Enum<?>> value, JsonGenerator gen,
SerializerProvider provider)
throws IOException
{
JsonSerializer<Object> enumSer = _elementSerializer;
/* Need to dynamically find instance serializer; unfortunately
* that seems to be the only way to figure out type (no accessors
* to the enum class that set knows)
*/
for (Enum<?> en : value) {
if (enumSer == null) {
// 12-Jan-2010, tatu: Since enums cannot be polymorphic, let's
// not bother with typed serializer variant here
enumSer = provider.findContentValueSerializer(en.getDeclaringClass(), _property);
}
enumSer.serialize(en, gen, provider);
}
}
}
⏎ com/fasterxml/jackson/databind/ser/std/EnumSetSerializer.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, ≈196🔥, 0💬
Popular Posts:
Where to get the Java source code for Connector/J 8.0 Core API module? Java source code files for Co...
Old version of xml-apis.jar. JAR File Size and Download Location: File name: xmlParserAPIs.jar File ...
How to perform XML Schema validation with sax\Writer.java provided in the Apache Xerces package? You...
commons-collections4-4.2 -sources.jaris the source JAR file for Apache Commons Collections 4.2, whic...
pache Derby is an open source relational database implemented entirely in Java and available under t...