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 Core Source Code
Jackson is "the Java JSON library" or "the best JSON parser for Java". Or simply as "JSON for Java".
Jackson Core Source Code files are provided in the source packge (jackson-core-2.14.0-sources.jar). You can download it at Jackson Maven Website.
You can also browse Jackson Core Source Code below:
✍: FYIcenter.com
⏎ com/fasterxml/jackson/core/json/DupDetector.java
package com.fasterxml.jackson.core.json; import java.util.*; import com.fasterxml.jackson.core.*; /** * Helper class used if * {@link com.fasterxml.jackson.core.JsonParser.Feature#STRICT_DUPLICATE_DETECTION} * is enabled. * Optimized to try to limit memory usage and processing overhead for smallest * entries, but without adding trashing (immutable objects would achieve optimal * memory usage but lead to significant number of discarded temp objects for * scopes with large number of entries). Another consideration is trying to limit * actual number of compiled classes as it contributes significantly to overall * jar size (due to linkage etc). * * @since 2.3 */ public class DupDetector { /** * We need to store a back-reference here to parser/generator. */ protected final Object _source; protected String _firstName; protected String _secondName; /** * Lazily constructed set of names already seen within this context. */ protected HashSet<String> _seen; private DupDetector(Object src) { _source = src; } public static DupDetector rootDetector(JsonParser p) { return new DupDetector(p); } public static DupDetector rootDetector(JsonGenerator g) { return new DupDetector(g); } public DupDetector child() { return new DupDetector(_source); } public void reset() { _firstName = null; _secondName = null; _seen = null; } public JsonLocation findLocation() { // ugly but: if (_source instanceof JsonParser) { return ((JsonParser)_source).getCurrentLocation(); } // do generators have a way to provide Location? Apparently not... return null; } /** * @return Source object (parser / generator) used to construct this detector * * @since 2.7 */ public Object getSource() { return _source; } /** * Method called to check whether a newly encountered property name would * be a duplicate within this context, and if not, update the state to remember * having seen the property name for checking more property names * * @param name Property seen * * @return {@code True} if the property had already been seen before in this context * * @throws JsonParseException to report possible operation problem (default implementation * never throws it) */ public boolean isDup(String name) throws JsonParseException { if (_firstName == null) { _firstName = name; return false; } if (name.equals(_firstName)) { return true; } if (_secondName == null) { _secondName = name; return false; } if (name.equals(_secondName)) { return true; } if (_seen == null) { _seen = new HashSet<String>(16); // 16 is default, seems reasonable _seen.add(_firstName); _seen.add(_secondName); } return !_seen.add(name); } }
⏎ com/fasterxml/jackson/core/json/DupDetector.java
Or download all of them as a single archive file:
File name: jackson-core-2.14.0-sources.jar File size: 497693 bytes Release date: 2022-11-05 Download
⇒ Download and Install Jackson Binary Package
2016-02-03, 56889👍, 1💬
Popular Posts:
JDK 11 java.xml.jmod is the JMOD file for JDK 11 XML (eXtensible Markup Language) module. JDK 11 XML...
What Is poi-ooxml-5.2.3.jar? poi-ooxml-5.2.3.jar is one of the JAR files for Apache POI 5.2.3, which...
kernel.jar is a component in iText Java library to provide low-level functionalities. iText Java lib...
JDK 11 jdk.internal.vm.compiler .jmodis the JMOD file for JDK 11 Internal VM Compiler module. JDK 11...
How to display types defined in an XML Schema file with the xs\QueryXS.java provided in the Apache X...