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 Annotations Source Code
Jackson is "the Java JSON library" or "the best JSON parser for Java". Or simply as "JSON for Java".
Jackson Annotations Source Code files are provided in the source packge (jackson-annotations-2.12.4-sources.jar). You can download it at Jackson Maven Website.
You can also browse Jackson Annotations Source Code below:
✍: FYIcenter.com
⏎ com/fasterxml/jackson/databind/ser/impl/WritableObjectId.java
package com.fasterxml.jackson.databind.ser.impl; import java.io.IOException; import com.fasterxml.jackson.annotation.ObjectIdGenerator; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.SerializableString; import com.fasterxml.jackson.databind.SerializerProvider; /** * Simple value container used to keep track of Object Ids during * serialization. */ public final class WritableObjectId { public final ObjectIdGenerator<?> generator; public Object id; /** * Marker to denote whether Object Id value has been written as part of an Object, * to be referencible. Remains false when forward-reference is written. */ protected boolean idWritten = false; public WritableObjectId(ObjectIdGenerator<?> generator) { this.generator = generator; } public boolean writeAsId(JsonGenerator gen, SerializerProvider provider, ObjectIdWriter w) throws IOException { if ((id != null) && (idWritten || w.alwaysAsId)) { // 03-Aug-2013, tatu: Prefer Native Object Ids if available if (gen.canWriteObjectId()) { gen.writeObjectRef(String.valueOf(id)); } else { w.serializer.serialize(id, gen, provider); } return true; } return false; } public Object generateId(Object forPojo) { // 04-Jun-2016, tatu: As per [databind#1255], need to consider possibility of // id being generated for "alwaysAsId", but not being written as POJO; regardless, // need to use existing id if there is one: if (id == null) { id = generator.generateId(forPojo); } return id; } /** * Method called to output Object Id as specified. */ public void writeAsField(JsonGenerator gen, SerializerProvider provider, ObjectIdWriter w) throws IOException { idWritten = true; // 03-Aug-2013, tatu: Prefer Native Object Ids if available if (gen.canWriteObjectId()) { // Need to assume String(ified) ids, for now... could add 'long' variant? // 05-Feb-2019, tatu: But in special case of `null` we should not coerce -- whether // we should even call is an open question, but for now do pass to let generator // decide what to do, if anything. String idStr = (id == null) ? null : String.valueOf(id); gen.writeObjectId(idStr); return; } SerializableString name = w.propertyName; if (name != null) { // 05-Feb-2019, tatu: How about `null` id? For now, write gen.writeFieldName(name); w.serializer.serialize(id, gen, provider); } } }
⏎ com/fasterxml/jackson/databind/ser/impl/WritableObjectId.java
Â
⇒ Jackson Dataformat Extensions
⇠Jackson Data Binding Source Code
⇑ Downloading and Reviewing jackson-*.jar
⇑⇑ Jackson - Java JSON library
2022-02-19, 36369👍, 0💬
Popular Posts:
io.jar is a component in iText Java library to provide input/output functionalities. iText Java libr...
JDK 11 jdk.javadoc.jmod is the JMOD file for JDK 11 Java Document tool, which can be invoked by the ...
Where to find answers to frequently asked questions on Downloading and Using JDK (Java Development K...
The Apache FontBox library is an open source Java tool to obtain low level information from font fil...
JLayer is a library that decodes/plays/converts MPEG 1/2/2.5 Layer 1/2/3 (i.e. MP3) in real time for...