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/ManagedReferenceProperty.java
package com.fasterxml.jackson.databind.deser.impl; import java.io.IOException; import java.util.Collection; import java.util.Map; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.deser.SettableBeanProperty; /** * Wrapper property that is used to handle managed (forward) properties * Basically just needs to delegate first to actual forward property, and * then to back property. */ public final class ManagedReferenceProperty // Changed to extends delegating base class in 2.9 extends SettableBeanProperty.Delegating { private static final long serialVersionUID = 1L; protected final String _referenceName; /** * Flag that indicates whether property to handle is a container type * (array, Collection, Map) or not. */ protected final boolean _isContainer; protected final SettableBeanProperty _backProperty; public ManagedReferenceProperty(SettableBeanProperty forward, String refName, SettableBeanProperty backward, boolean isContainer) { super(forward); _referenceName = refName; _backProperty = backward; _isContainer = isContainer; } @Override protected SettableBeanProperty withDelegate(SettableBeanProperty d) { throw new IllegalStateException("Should never try to reset delegate"); } // need to override to ensure both get fixed @Override public void fixAccess(DeserializationConfig config) { delegate.fixAccess(config); _backProperty.fixAccess(config); } /* /********************************************************** /* Overridden methods /********************************************************** */ @Override public void deserializeAndSet(JsonParser p, DeserializationContext ctxt, Object instance) throws IOException { set(instance, delegate.deserialize(p, ctxt)); } @Override public Object deserializeSetAndReturn(JsonParser p, DeserializationContext ctxt, Object instance) throws IOException { return setAndReturn(instance, deserialize(p, ctxt)); } @Override public final void set(Object instance, Object value) throws IOException { setAndReturn(instance, value); } @Override public Object setAndReturn(Object instance, Object value) throws IOException { /* 04-Feb-2014, tatu: As per [#390], it may be necessary to switch the * ordering of forward/backward references, and start with back ref. */ if (value != null) { if (_isContainer) { // ok, this gets ugly... but has to do for now if (value instanceof Object[]) { for (Object ob : (Object[]) value) { if (ob != null) { _backProperty.set(ob, instance); } } } else if (value instanceof Collection<?>) { for (Object ob : (Collection<?>) value) { if (ob != null) { _backProperty.set(ob, instance); } } } else if (value instanceof Map<?,?>) { for (Object ob : ((Map<?,?>) value).values()) { if (ob != null) { _backProperty.set(ob, instance); } } } else { throw new IllegalStateException("Unsupported container type ("+value.getClass().getName() +") when resolving reference '"+_referenceName+"'"); } } else { _backProperty.set(value, instance); } } // and then the forward reference itself return delegate.setAndReturn(instance, value); } }
⏎ com/fasterxml/jackson/databind/deser/impl/ManagedReferenceProperty.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, 46853👍, 0💬
Popular Posts:
jlGui is a music player for the Java platform. It is based on Java Sound 1.0 (i.e. JDK 1.3+). It sup...
Where to find answers to frequently asked questions on Downloading and Installing Connector/J - JDBC...
The Digester package lets you configure an XML -> Java object mapping module, which triggers certain...
JDK 11 jdk.javadoc.jmod is the JMOD file for JDK 11 Java Document tool, which can be invoked by the ...
JSP(tm) Standard Tag Library 1.1 implementation - Jakarta Taglibs hosts the Standard Taglib 1.1, an ...