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/TSFBuilder.java
package com.fasterxml.jackson.core; import com.fasterxml.jackson.core.io.InputDecorator; import com.fasterxml.jackson.core.io.OutputDecorator; import com.fasterxml.jackson.core.json.JsonReadFeature; import com.fasterxml.jackson.core.json.JsonWriteFeature; /** * Since 2.10, Builder class is offered for creating token stream factories * with difference configurations: with 3.x they will be fully immutable. * * @since 2.10 */ public abstract class TSFBuilder<F extends JsonFactory, B extends TSFBuilder<F,B>> { /* /********************************************************************** /* Constants /********************************************************************** */ /** * Bitfield (set of flags) of all factory features that are enabled by default. */ protected final static int DEFAULT_FACTORY_FEATURE_FLAGS = JsonFactory.Feature.collectDefaults(); /** * Bitfield (set of flags) of all parser features that are enabled * by default. */ protected final static int DEFAULT_PARSER_FEATURE_FLAGS = JsonParser.Feature.collectDefaults(); /** * Bitfield (set of flags) of all generator features that are enabled * by default. */ protected final static int DEFAULT_GENERATOR_FEATURE_FLAGS = JsonGenerator.Feature.collectDefaults(); /* /********************************************************************** /* Configured features /********************************************************************** */ /** * Set of {@link com.fasterxml.jackson.core.JsonFactory.Feature}s enabled, * as bitmask. */ protected int _factoryFeatures; /** * Set of {@link JsonParser.Feature}s enabled, as bitmask. */ protected int _streamReadFeatures; /** * Set of {@link JsonGenerator.Feature}s enabled, as bitmask. */ protected int _streamWriteFeatures; /* /********************************************************************** /* Other configuration /********************************************************************** */ /** * Optional helper object that may decorate input sources, to do * additional processing on input during parsing. */ protected InputDecorator _inputDecorator; /** * Optional helper object that may decorate output object, to do * additional processing on output during content generation. */ protected OutputDecorator _outputDecorator; /* /********************************************************************** /* Construction /********************************************************************** */ protected TSFBuilder() { _factoryFeatures = DEFAULT_FACTORY_FEATURE_FLAGS; _streamReadFeatures = DEFAULT_PARSER_FEATURE_FLAGS; _streamWriteFeatures = DEFAULT_GENERATOR_FEATURE_FLAGS; _inputDecorator = null; _outputDecorator = null; } protected TSFBuilder(JsonFactory base) { this(base._factoryFeatures, base._parserFeatures, base._generatorFeatures); } protected TSFBuilder(int factoryFeatures, int parserFeatures, int generatorFeatures) { _factoryFeatures = factoryFeatures; _streamReadFeatures = parserFeatures; _streamWriteFeatures = generatorFeatures; } // // // Accessors public int factoryFeaturesMask() { return _factoryFeatures; } public int streamReadFeatures() { return _streamReadFeatures; } public int streamWriteFeatures() { return _streamWriteFeatures; } public InputDecorator inputDecorator() { return _inputDecorator; } public OutputDecorator outputDecorator() { return _outputDecorator; } // // // Factory features public B enable(JsonFactory.Feature f) { _factoryFeatures |= f.getMask(); return _this(); } public B disable(JsonFactory.Feature f) { _factoryFeatures &= ~f.getMask(); return _this(); } public B configure(JsonFactory.Feature f, boolean state) { return state ? enable(f) : disable(f); } // // // StreamReadFeatures (replacement of non-json-specific parser features) public B enable(StreamReadFeature f) { _streamReadFeatures |= f.mappedFeature().getMask(); return _this(); } public B enable(StreamReadFeature first, StreamReadFeature... other) { _streamReadFeatures |= first.mappedFeature().getMask(); for (StreamReadFeature f : other) { _streamReadFeatures |= f.mappedFeature().getMask(); } return _this(); } public B disable(StreamReadFeature f) { _streamReadFeatures &= ~f.mappedFeature().getMask(); return _this(); } public B disable(StreamReadFeature first, StreamReadFeature... other) { _streamReadFeatures &= ~first.mappedFeature().getMask(); for (StreamReadFeature f : other) { _streamReadFeatures &= ~f.mappedFeature().getMask(); } return _this(); } public B configure(StreamReadFeature f, boolean state) { return state ? enable(f) : disable(f); } // // // StreamWriteFeatures (replacement of non-json-specific generator features) public B enable(StreamWriteFeature f) { _streamWriteFeatures |= f.mappedFeature().getMask(); return _this(); } public B enable(StreamWriteFeature first, StreamWriteFeature... other) { _streamWriteFeatures |= first.mappedFeature().getMask(); for (StreamWriteFeature f : other) { _streamWriteFeatures |= f.mappedFeature().getMask(); } return _this(); } public B disable(StreamWriteFeature f) { _streamWriteFeatures &= ~f.mappedFeature().getMask(); return _this(); } public B disable(StreamWriteFeature first, StreamWriteFeature... other) { _streamWriteFeatures &= ~first.mappedFeature().getMask(); for (StreamWriteFeature f : other) { _streamWriteFeatures &= ~f.mappedFeature().getMask(); } return _this(); } public B configure(StreamWriteFeature f, boolean state) { return state ? enable(f) : disable(f); } /* 26-Jun-2018, tatu: This should not be needed here, but due to 2.x limitations, * we do need to include it or require casting. * Specifically: since `JsonFactory` (and not `TokenStreamFactory`) is base class * for all backends, it can not expose JSON-specific builder, but this. * So let's select lesser evil(s). */ // // // JSON-specific, reads public B enable(JsonReadFeature f) { return _failNonJSON(f); } public B enable(JsonReadFeature first, JsonReadFeature... other) { return _failNonJSON(first); } public B disable(JsonReadFeature f) { return _failNonJSON(f); } public B disable(JsonReadFeature first, JsonReadFeature... other) { return _failNonJSON(first); } public B configure(JsonReadFeature f, boolean state) { return _failNonJSON(f); } private B _failNonJSON(Object feature) { throw new IllegalArgumentException("Feature "+feature.getClass().getName() +"#"+feature.toString()+" not supported for non-JSON backend"); } // // // JSON-specific, writes public B enable(JsonWriteFeature f) { return _failNonJSON(f); } public B enable(JsonWriteFeature first, JsonWriteFeature... other) { return _failNonJSON(first); } public B disable(JsonWriteFeature f) { return _failNonJSON(f); } public B disable(JsonWriteFeature first, JsonWriteFeature... other) { return _failNonJSON(first); } public B configure(JsonWriteFeature f, boolean state) { return _failNonJSON(f); } // // // Other configuration public B inputDecorator(InputDecorator dec) { _inputDecorator = dec; return _this(); } public B outputDecorator(OutputDecorator dec) { _outputDecorator = dec; return _this(); } // // // Other methods /** * Method for constructing actual {@link TokenStreamFactory} instance, given * configuration. * * @return {@link TokenStreamFactory} build based on current configuration */ public abstract F build(); // silly convenience cast method we need @SuppressWarnings("unchecked") protected final B _this() { return (B) this; } // // // Support for subtypes protected void _legacyEnable(JsonParser.Feature f) { if (f != null) { _streamReadFeatures |= f.getMask(); } } protected void _legacyDisable(JsonParser.Feature f) { if (f != null) { _streamReadFeatures &= ~f.getMask(); } } protected void _legacyEnable(JsonGenerator.Feature f) { if (f != null) { _streamWriteFeatures |= f.getMask(); } } protected void _legacyDisable(JsonGenerator.Feature f) { if (f != null) { _streamWriteFeatures &= ~f.getMask(); } } }
⏎ com/fasterxml/jackson/core/TSFBuilder.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, 48427👍, 1💬
Popular Posts:
What Is jniwrap.jar in JNIWrapper 3.7.1? winpack.jar in JNIWrapper 3.7.1 is an add-on JAR file for J...
How to download and install ojdbc14.jar for Oracle 10g R2? ojdbc14.jar for Oracle 10g R2 is a Java 1...
How to download and install ojdbc6.jar for Oracle 11g R2? ojdbc6.jar for Oracle 11g R2 is a Java 6, ...
Jaxen, Release 1.1.1, is an open source XPath library written in Java. It is adaptable to many diffe...
MXP1 is a stable XmlPull parsing engine that is based on ideas from XPP and in particular XPP2 but c...