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/deser/impl/MergingSettableBeanProperty.java
package com.fasterxml.jackson.databind.deser.impl; import java.io.IOException; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.deser.*; import com.fasterxml.jackson.databind.introspect.AnnotatedMember; /** * {@link SettableBeanProperty} implementation that will try to access value of * the property first, and if non-null value found, pass that for update * (using {@link com.fasterxml.jackson.databind.JsonDeserializer#deserialize(com.fasterxml.jackson.core.JsonParser, com.fasterxml.jackson.databind.DeserializationContext, Object)}) * instead of constructing a new value. This is necessary to support "merging" properties. *<p> * Note that there are many similarities to {@link SetterlessProperty}, which predates * this variant; and that one is even used in cases where there is no mutator * available. * * @since 2.9 */ public class MergingSettableBeanProperty extends SettableBeanProperty.Delegating { private static final long serialVersionUID = 1L; /** * Member (field, method) used for accessing existing value. */ protected final AnnotatedMember _accessor; /* /********************************************************** /* Life-cycle /********************************************************** */ protected MergingSettableBeanProperty(SettableBeanProperty delegate, AnnotatedMember accessor) { super(delegate); _accessor = accessor; } protected MergingSettableBeanProperty(MergingSettableBeanProperty src, SettableBeanProperty delegate) { super(delegate); _accessor = src._accessor; } public static MergingSettableBeanProperty construct(SettableBeanProperty delegate, AnnotatedMember accessor) { return new MergingSettableBeanProperty(delegate, accessor); } @Override protected SettableBeanProperty withDelegate(SettableBeanProperty d) { return new MergingSettableBeanProperty(d, _accessor); } /* /********************************************************** /* Deserialization methods /********************************************************** */ @Override public void deserializeAndSet(JsonParser p, DeserializationContext ctxt, Object instance) throws IOException { Object oldValue = _accessor.getValue(instance); Object newValue; // 20-Oct-2016, tatu: Couple of possibilities of how to proceed; for // now, default to "normal" handling without merging if (oldValue == null) { newValue = delegate.deserialize(p, ctxt); } else { newValue = delegate.deserializeWith(p, ctxt, oldValue); } if (newValue != oldValue) { // 18-Apr-2017, tatu: Null handling should occur within delegate, which may // set/skip/transform it, or throw an exception. delegate.set(instance, newValue); } } @Override public Object deserializeSetAndReturn(JsonParser p, DeserializationContext ctxt, Object instance) throws IOException { Object oldValue = _accessor.getValue(instance); Object newValue; // 20-Oct-2016, tatu: Couple of possibilities of how to proceed; for // now, default to "normal" handling without merging if (oldValue == null) { newValue = delegate.deserialize(p, ctxt); } else { newValue = delegate.deserializeWith(p, ctxt, oldValue); } // 23-Oct-2016, tatu: One possible complication here; should we always // try calling setter on builder? Presumably should not be required, // but may need to revise if (newValue != oldValue) { // 31-Oct-2016, tatu: Basically should just ignore as null can't really // contribute to merging. if (newValue != null) { return delegate.setAndReturn(instance, newValue); } } return instance; } @Override public void set(Object instance, Object value) throws IOException { // 31-Oct-2016, tatu: Basically should just ignore as null can't really // contribute to merging. if (value != null) { delegate.set(instance, value); } } @Override public Object setAndReturn(Object instance, Object value) throws IOException { // 31-Oct-2016, tatu: Basically should just ignore as null can't really // contribute to merging. if (value != null) { return delegate.setAndReturn(instance, value); } return instance; } }
⏎ com/fasterxml/jackson/databind/deser/impl/MergingSettableBeanProperty.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, 46946👍, 0💬
Popular Posts:
Java Cryptography Extension 1.6 JAR File Size and Download Location: File name: jce.jar, jce-1.6.jar...
Saxon is an open source product available under the Mozilla Public License. It provides implementati...
commons-io-1.4.jar is the JAR file for Commons IO 1.4, which is a library of utilities to assist wit...
JAX-WS is an API for building web services and clients. It is the next generation Web Services API r...
JDK 11 java.xml.jmod is the JMOD file for JDK 11 XML (eXtensible Markup Language) module. JDK 11 XML...