Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
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 (322)
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/util/JacksonFeatureSet.java
package com.fasterxml.jackson.core.util; /** * Container similar to {@link java.util.EnumSet} meant for storing sets of * {@link JacksonFeature}s (usually {@link java.lang.Enum}s): main * difference being that these sets are immutable. Also only supports relatively * small sets of features: specifically, up to 31 features. * * @since 2.12 */ public final class JacksonFeatureSet<F extends JacksonFeature> { protected int _enabled; /** * Constructor for creating instance with specific bitmask, wherein * {@code 1} bit means matching {@link JacksonFeature} is enabled and * {@code 0} disabled. * * @param bitmask Bitmask for features that are enabled */ protected JacksonFeatureSet(int bitmask) { _enabled = bitmask; } /** * "Default" factory which will calculate settings based on default-enabled * status of all features. * * @param <F> Self-reference type for convenience * * @param allFeatures Set of all features (enabled or disabled): usually from * {@code Enum.values()} * * @return Feature set instance constructed */ public static <F extends JacksonFeature> JacksonFeatureSet<F> fromDefaults(F[] allFeatures) { // first sanity check if (allFeatures.length > 31) { final String desc = allFeatures[0].getClass().getName(); throw new IllegalArgumentException(String.format( "Can not use type `%s` with JacksonFeatureSet: too many entries (%d > 31)", desc, allFeatures.length)); } int flags = 0; for (F f : allFeatures) { if (f.enabledByDefault()) { flags |= f.getMask(); } } return new JacksonFeatureSet<F>(flags); } public static <F extends JacksonFeature> JacksonFeatureSet<F> fromBitmask(int bitmask) { return new JacksonFeatureSet<F>(bitmask); } /** * Mutant factory for getting a set in which specified feature is enabled: * will either return this instance (if no change), or newly created set (if there * is change). * * @param feature Feature to enable in set returned * * @return Newly created set of state of feature changed; {@code this} if not */ public JacksonFeatureSet<F> with(F feature) { int newMask = _enabled | feature.getMask(); return (newMask == _enabled) ? this : new JacksonFeatureSet<F>(newMask); } /** * Mutant factory for getting a set in which specified feature is disabled: * will either return this instance (if no change), or newly created set (if there * is change). * * @param feature Feature to disable in set returned * * @return Newly created set of state of feature changed; {@code this} if not */ public JacksonFeatureSet<F> without(F feature) { int newMask = _enabled & ~feature.getMask(); return (newMask == _enabled) ? this : new JacksonFeatureSet<F>(newMask); } /** * Main accessor for checking whether given feature is enabled in this feature set. * * @param feature Feature to check * * @return True if feature is enabled in this set; false otherwise */ public boolean isEnabled(F feature) { return (feature.getMask() & _enabled) != 0; } /** * Accessor for underlying bitmask * * @return Bitmask of enabled features */ public int asBitmask() { return _enabled; } }
⏎ com/fasterxml/jackson/core/util/JacksonFeatureSet.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, ≈67🔥, 1💬
Popular Posts:
commons-lang-1.0.1.jar is the JAR file for Apache Commons Lang 1.0.1, which provides a host of helpe...
Woodstox 6.4.0 Source Code Files are provided at the Woodstox GitHub Website . You can download them...
How to download and install ojdbc6.jar for Oracle 11g R2? ojdbc6.jar for Oracle 11g R2 is a Java 6, ...
The JSR 105 XML Digital Signature 1.0.1 FCS implementation provides an API and implementation that a...
Jettison is a collection of Java APIs (like STaX and DOM) which read and write JSON. This allows nea...