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/std/ContainerDeserializerBase.java
package com.fasterxml.jackson.databind.deser.std; import java.io.IOException; import java.lang.reflect.InvocationTargetException; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.deser.NullValueProvider; import com.fasterxml.jackson.databind.deser.SettableBeanProperty; import com.fasterxml.jackson.databind.deser.ValueInstantiator; import com.fasterxml.jackson.databind.deser.impl.NullsConstantProvider; import com.fasterxml.jackson.databind.type.TypeFactory; import com.fasterxml.jackson.databind.util.AccessPattern; import com.fasterxml.jackson.databind.util.ClassUtil; /** * Intermediate base deserializer class that adds more shared accessor * so that other classes can access information about contained (value) types */ @SuppressWarnings("serial") public abstract class ContainerDeserializerBase<T> extends StdDeserializer<T> implements ValueInstantiator.Gettable // since 2.9 { protected final JavaType _containerType; /** * Handler we need for dealing with nulls. * * @since 2.9 */ protected final NullValueProvider _nullProvider; /** * Marker flag set if the <code>_nullProvider</code> indicates that all null * content values should be skipped (instead of being possibly converted). * * @since 2.9 */ protected final boolean _skipNullValues; /** * Specific override for this instance (from proper, or global per-type overrides) * to indicate whether single value may be taken to mean an unwrapped one-element array * or not. If null, left to global defaults. * * @since 2.9 (demoted from sub-classes where added in 2.7) */ protected final Boolean _unwrapSingle; protected ContainerDeserializerBase(JavaType selfType, NullValueProvider nuller, Boolean unwrapSingle) { super(selfType); _containerType = selfType; _unwrapSingle = unwrapSingle; _nullProvider = nuller; _skipNullValues = NullsConstantProvider.isSkipper(nuller); } protected ContainerDeserializerBase(JavaType selfType) { this(selfType, null, null); } /** * @since 2.9 */ protected ContainerDeserializerBase(ContainerDeserializerBase<?> base) { this(base, base._nullProvider, base._unwrapSingle); } /** * @since 2.9 */ protected ContainerDeserializerBase(ContainerDeserializerBase<?> base, NullValueProvider nuller, Boolean unwrapSingle) { super(base._containerType); _containerType = base._containerType; _nullProvider = nuller; _unwrapSingle = unwrapSingle; _skipNullValues = NullsConstantProvider.isSkipper(nuller); } /* /********************************************************** /* Overrides /********************************************************** */ @Override // since 2.9 public JavaType getValueType() { return _containerType; } @Override // since 2.9 public Boolean supportsUpdate(DeserializationConfig config) { return Boolean.TRUE; } @Override public SettableBeanProperty findBackReference(String refName) { JsonDeserializer<Object> valueDeser = getContentDeserializer(); if (valueDeser == null) { throw new IllegalArgumentException(String.format( "Cannot handle managed/back reference '%s': type: container deserializer of type %s returned null for 'getContentDeserializer()'", refName, getClass().getName())); } return valueDeser.findBackReference(refName); } /* /********************************************************** /* Extended API /********************************************************** */ /** * Accessor for declared type of contained value elements; either exact * type, or one of its supertypes. */ public JavaType getContentType() { if (_containerType == null) { return TypeFactory.unknownType(); // should never occur but... } return _containerType.getContentType(); } /** * Accesor for deserializer use for deserializing content values. */ public abstract JsonDeserializer<Object> getContentDeserializer(); @Override // since 2.9 public AccessPattern getEmptyAccessPattern() { // 02-Feb-2017, tatu: Empty containers are usually constructed as needed // and may not be shared; for some deserializers this may be further refined. return AccessPattern.DYNAMIC; } @Override // since 2.9 public Object getEmptyValue(DeserializationContext ctxt) throws JsonMappingException { ValueInstantiator vi = getValueInstantiator(); if (vi == null || !vi.canCreateUsingDefault()) { JavaType type = getValueType(); ctxt.reportBadDefinition(type, String.format("Cannot create empty instance of %s, no default Creator", type)); } try { return vi.createUsingDefault(ctxt); // lgtm [java/dereferenced-value-may-be-null] } catch (IOException e) { return ClassUtil.throwAsMappingException(ctxt, e); } } /* /********************************************************** /* Shared methods for sub-classes /********************************************************** */ /** * @deprecated Since 2.12.2 (since it does not get context for accessing config) */ @Deprecated protected <BOGUS> BOGUS wrapAndThrow(Throwable t, Object ref, String key) throws IOException { return wrapAndThrow(null, t, ref, key); } /** * Helper method called by various Map(-like) deserializers when encountering * a processing problem (whether from underlying parser, i/o, or something else). * * @since 2.12.2 */ protected <BOGUS> BOGUS wrapAndThrow(DeserializationContext ctxt, Throwable t, Object ref, String key) throws IOException { // to handle StackOverflow: while (t instanceof InvocationTargetException && t.getCause() != null) { t = t.getCause(); } // Errors and "plain" IOExceptions to be passed as-is ClassUtil.throwIfError(t); // 25-Feb-2021, tatu: as per [databind#3068] need to obey WRAP_EXCEPTIONS setting if ((ctxt != null) && !ctxt.isEnabled(DeserializationFeature.WRAP_EXCEPTIONS)) { ClassUtil.throwIfRTE(t); } // ... except for mapping exceptions if (t instanceof IOException && !(t instanceof JsonMappingException)) { throw (IOException) t; } // for [databind#1141] throw JsonMappingException.wrapWithPath(t, ref, ClassUtil.nonNull(key, "N/A")); } }
⏎ com/fasterxml/jackson/databind/deser/std/ContainerDeserializerBase.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, 109356👍, 0💬
Popular Posts:
Jackson is "the Java JSON library" or "the best JSON parser for Java". Or simply as "JSON for Java"....
JDK 11 jdk.dynalink.jmod is the JMOD file for JDK 11 Dynamic Linking module. JDK 11 Dynamic Linking ...
How to read XML document from socket connections with the socket\DelayedInput.java provided in the A...
JRE 8 rt.jar is the JAR file for JRE 8 RT (Runtime) libraries. JRE (Java Runtime) 8 is the runtime e...
Apache Log4j Core Implementation provides the functional components of the logging system. Users are...