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/IgnorePropertiesUtil.java
package com.fasterxml.jackson.databind.util; import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.Set; /** * @since 2.12 */ public class IgnorePropertiesUtil { /** * Decide if we need to ignore a property or not, given a set of field to ignore and a set of field to include. */ public static boolean shouldIgnore(Object value, Collection<String> toIgnore, Collection<String> toInclude) { if (toIgnore == null && toInclude ==null) { return false; } if (toInclude == null) { return toIgnore.contains(value); } if (toIgnore == null) { return !toInclude.contains(value); } // NOTE: conflict between both, JsonIncludeProperties will take priority. return !toInclude.contains(value) || toIgnore.contains(value); } /** * Factory method for creating and return a {@link Checker} instance if (and only if) * one needed. * * @param toIgnore Set of property names to ignore (may be null) * @param toInclude Set of only property names to include (if null, undefined) * * @return Checker, if validity checks are needed; {@code null} otherwise */ public static Checker buildCheckerIfNeeded(Set<String> toIgnore, Set<String> toInclude) { // First: no-op case if ((toInclude == null) && ((toIgnore == null) || toIgnore.isEmpty())) { return null; } return Checker.construct(toIgnore, toInclude); } /** * Helper that encapsulates logic for combining two sets of "included names": * default logic is to do intersection (name must be in both to be included * in result) * * @param prevToInclude Existing set of names to include, if defined; null means "not defined" * @param newToInclude New set of names to included, if defined; null means "not defined" * * @return Resulting set of names, using intersection if neither {@code null}; or the * non-null one (if only one is {@code null}); or {@code null} if both arguments {@code null}. */ public static Set<String> combineNamesToInclude(Set<String> prevToInclude, Set<String> newToInclude) { if (prevToInclude == null) { return newToInclude; } if (newToInclude == null) { return prevToInclude; } final Set<String> result = new HashSet<>(); // Make the intersection with the previously included properties for (String prop : newToInclude) { if (prevToInclude.contains(prop)) { result.add(prop); } } return result; } /** * Helper class to encapsulate logic from static {@code shouldIgnore} method * of util class. */ public final static class Checker implements java.io.Serializable { private static final long serialVersionUID = 1L; private final Set<String> _toIgnore; private final Set<String> _toInclude; private Checker(Set<String> toIgnore, Set<String> toInclude) { if (toIgnore == null) { toIgnore = Collections.emptySet(); } _toIgnore = toIgnore; _toInclude = toInclude; } public static Checker construct(Set<String> toIgnore, Set<String> toInclude) { return new Checker(toIgnore, toInclude); } // May seem odd but during serialization key is not cast up to String: public boolean shouldIgnore(Object propertyName) { return ((_toInclude != null) && !_toInclude.contains(propertyName)) || _toIgnore.contains(propertyName); } } }
⏎ com/fasterxml/jackson/databind/util/IgnorePropertiesUtil.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, 110711👍, 0💬
Popular Posts:
XML Serializer, Release 2.7.1, allows you to write out XML, HTML etc. as a stream of characters from...
JasperReports, the world's most popular open source business intelligence and reporting engine and J...
JDK 6 tools.jar is the JAR file for JDK 6 tools. It contains Java classes to support different JDK t...
JasperReports, the world's most popular open source business intelligence and reporting engine and J...
JRE 8 deploy.jar is the JAR file for JRE 8 Java Control Panel and other deploy tools. JRE (Java Runt...