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/util/LRUMap.java
package com.fasterxml.jackson.databind.util; import java.util.Map; import java.util.function.BiConsumer; import com.fasterxml.jackson.databind.util.internal.PrivateMaxEntriesMap; /** * Helper for simple bounded maps used for reusing lookup values. *<p> * Note that serialization behavior is such that contents are NOT serialized, * on assumption that all use cases are for caching where persistence * does not make sense. The only thing serialized is the cache size of Map. *<p> * NOTE: since Jackson 2.14, the implementation evicts the least recently used * entry when max size is reached. *<p> * Since Jackson 2.12, there has been pluggable {@link LookupCache} interface which * allows users, frameworks, provide their own cache implementations. */ public class LRUMap<K,V> implements LookupCache<K,V>, // since 2.12 java.io.Serializable { private static final long serialVersionUID = 2L; protected final int _initialEntries; protected final int _maxEntries; protected final transient PrivateMaxEntriesMap<K,V> _map; public LRUMap(int initialEntries, int maxEntries) { _initialEntries = initialEntries; _maxEntries = maxEntries; // We'll use concurrency level of 4, seems reasonable _map = new PrivateMaxEntriesMap.Builder<K, V>() .initialCapacity(initialEntries) .maximumCapacity(maxEntries) .concurrencyLevel(4) .build(); } @Override public V put(K key, V value) { return _map.put(key, value); } /** * @since 2.5 */ @Override public V putIfAbsent(K key, V value) { return _map.putIfAbsent(key, value); } // NOTE: key is of type Object only to retain binary backwards-compatibility @Override public V get(Object key) { return _map.get(key); } @Override public void clear() { _map.clear(); } @Override public int size() { return _map.size(); } /* /********************************************************************** /* Extended API (2.14) /********************************************************************** */ public void contents(BiConsumer<K,V> consumer) { for (Map.Entry<K,V> entry : _map.entrySet()) { consumer.accept(entry.getKey(), entry.getValue()); } } /* /********************************************************************** /* Serializable overrides /********************************************************************** */ protected Object readResolve() { return new LRUMap<K,V>(_initialEntries, _maxEntries); } }
⏎ com/fasterxml/jackson/databind/util/LRUMap.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, 46932👍, 0💬
Popular Posts:
What Is HttpComponents httpclient-4.2.2.jar? HttpComponents httpclient-4.2.2.jar is the JAR file for...
Apache Commons Codec library provides implementations of common encoders and decoders such as Base64...
Xalan-Java, Version 2.7.1, is an XSLT processor for transforming XML documents into HTML, text, or o...
JDK 11 jdk.jfr.jmod is the JMOD file for JDK 11 JFR module. JDK 11 JFR module compiled class files a...
Where Can I see Java Source Code files for Xerces Java 2.11.2? Here are Java Source Code files for X...