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/JsonFactoryBuilder.java
package com.fasterxml.jackson.core; import com.fasterxml.jackson.core.io.CharacterEscapes; import com.fasterxml.jackson.core.io.SerializedString; import com.fasterxml.jackson.core.json.JsonReadFeature; import com.fasterxml.jackson.core.json.JsonWriteFeature; /** * {@link com.fasterxml.jackson.core.TSFBuilder} * implementation for constructing vanilla {@link JsonFactory} * instances for reading/writing JSON encoded content. *<p> * NOTE: as of Jackson 2.x, use of JSON-specific builder is bit cumbersome * since {@link JsonFactory} serves dual duty of base class AND actual * implementation for JSON backend. This will be fixed in Jackson 3.0. * * @since 2.10 */ public class JsonFactoryBuilder extends TSFBuilder<JsonFactory, JsonFactoryBuilder> { protected CharacterEscapes _characterEscapes; protected SerializableString _rootValueSeparator; protected int _maximumNonEscapedChar; /** * Character used for quoting field names (if field name quoting has not * been disabled with {@link JsonWriteFeature#QUOTE_FIELD_NAMES}) * and JSON String values. */ protected char _quoteChar = JsonFactory.DEFAULT_QUOTE_CHAR; public JsonFactoryBuilder() { super(); _rootValueSeparator = JsonFactory.DEFAULT_ROOT_VALUE_SEPARATOR; _maximumNonEscapedChar = 0; } public JsonFactoryBuilder(JsonFactory base) { super(base); _characterEscapes = base.getCharacterEscapes(); _rootValueSeparator = base._rootValueSeparator; _maximumNonEscapedChar = base._maximumNonEscapedChar; } /* /********************************************************** /* Mutators /********************************************************** */ // // // JSON-parsing features @Override public JsonFactoryBuilder enable(JsonReadFeature f) { _legacyEnable(f.mappedFeature()); return this; } @Override public JsonFactoryBuilder enable(JsonReadFeature first, JsonReadFeature... other) { _legacyEnable(first.mappedFeature()); enable(first); for (JsonReadFeature f : other) { _legacyEnable(f.mappedFeature()); } return this; } @Override public JsonFactoryBuilder disable(JsonReadFeature f) { _legacyDisable(f.mappedFeature()); return this; } @Override public JsonFactoryBuilder disable(JsonReadFeature first, JsonReadFeature... other) { _legacyDisable(first.mappedFeature()); for (JsonReadFeature f : other) { _legacyEnable(f.mappedFeature()); } return this; } @Override public JsonFactoryBuilder configure(JsonReadFeature f, boolean state) { return state ? enable(f) : disable(f); } // // // JSON-generating features @Override public JsonFactoryBuilder enable(JsonWriteFeature f) { JsonGenerator.Feature old = f.mappedFeature(); if (old != null) { _legacyEnable(old); } return this; } @Override public JsonFactoryBuilder enable(JsonWriteFeature first, JsonWriteFeature... other) { _legacyEnable(first.mappedFeature()); for (JsonWriteFeature f : other) { _legacyEnable(f.mappedFeature()); } return this; } @Override public JsonFactoryBuilder disable(JsonWriteFeature f) { _legacyDisable(f.mappedFeature()); return this; } @Override public JsonFactoryBuilder disable(JsonWriteFeature first, JsonWriteFeature... other) { _legacyDisable(first.mappedFeature()); for (JsonWriteFeature f : other) { _legacyDisable(f.mappedFeature()); } return this; } @Override public JsonFactoryBuilder configure(JsonWriteFeature f, boolean state) { return state ? enable(f) : disable(f); } // // // JSON-specific helper objects, settings /** * Method for defining custom escapes factory uses for {@link JsonGenerator}s * it creates. * * @param esc CharacterEscapes to configure, if any; {@code null} if none * * @return This builder instance (to allow call chaining) */ public JsonFactoryBuilder characterEscapes(CharacterEscapes esc) { _characterEscapes = esc; return this; } /** * Method that allows overriding String used for separating root-level * JSON values (default is single space character) * * @param sep Separator to use, if any; null means that no separator is * automatically added * * @return This builder instance (to allow call chaining) */ public JsonFactoryBuilder rootValueSeparator(String sep) { _rootValueSeparator = (sep == null) ? null : new SerializedString(sep); return this; } /** * Method that allows overriding String used for separating root-level * JSON values (default is single space character) * * @param sep Separator to use, if any; null means that no separator is * automatically added * * @return This builder instance (to allow call chaining) */ public JsonFactoryBuilder rootValueSeparator(SerializableString sep) { _rootValueSeparator = sep; return this; } /** * Method that allows specifying threshold beyond which all characters are * automatically escaped (without checking possible custom escaping settings * a la {@link #characterEscapes}: for example, to force escaping of all non-ASCII * characters (set to 127), or all non-Latin-1 character (set to 255). * Default setting is "disabled", specified by passing value of {@code 0} (or * negative numbers). *<p> * NOTE! Lowest legal value (aside from marker 0) is 127: for ASCII range, other checks apply * and this threshold is ignored. If value between [1, 126] is specified, 127 will be * used instead. * * @param maxNonEscaped Highest character code that is NOT automatically escaped; if * positive value above 0, or 0 to indicate that no automatic escaping is applied * beside from what JSON specification requires (and possible custom escape settings). * Values between 1 and 127 are all taken to behave as if 127 is specified: that is, * no automatic escaping is applied in ASCII range. * * @return This builder instance (to allow call chaining) */ public JsonFactoryBuilder highestNonEscapedChar(int maxNonEscaped) { _maximumNonEscapedChar = (maxNonEscaped <= 0) ? 0 : Math.max(127, maxNonEscaped); return this; } /** * Method that allows specifying an alternate * character used for quoting field names (if field name quoting has not * been disabled with {@link JsonWriteFeature#QUOTE_FIELD_NAMES}) * and JSON String values. *<p> * Default value is double-quote ({@code "}); typical alternative is * single-quote/apostrophe ({@code '}). * * @param ch Character to use for quoting field names and JSON String values. * * @return This builder instance (to allow call chaining) */ public JsonFactoryBuilder quoteChar(char ch) { // 12-Aug-2019, tatu: Due to implementation details, escaping characters beyond // 7-bit ASCII set has deep overhead so let's limit set. If we absolutely // must it is possible of course, but leads to problems combining with // custom escaping aspects. if (ch > 0x7F) { throw new IllegalArgumentException("Can only use Unicode characters up to 0x7F as quote characters"); } _quoteChar = ch; return this; } // // // Accessors for JSON-specific settings public CharacterEscapes characterEscapes() { return _characterEscapes; } public SerializableString rootValueSeparator() { return _rootValueSeparator; } public int highestNonEscapedChar() { return _maximumNonEscapedChar; } public char quoteChar() { return _quoteChar; } @Override public JsonFactory build() { // 28-Dec-2017, tatu: No special settings beyond base class ones, so: return new JsonFactory(this); } }
⏎ com/fasterxml/jackson/core/JsonFactoryBuilder.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, 38561👍, 1💬
Popular Posts:
What Is jaxb-api-2.1.6.jar? Java Architecture for XML Binding (JAXB) is a Java API that allows Java ...
What is jxl.jar 2.6.12? jxl.jar 2.6.12 is the JAR file for Java Excel API 2.6.12, which is a Java li...
kernel.jar is a component in iText Java library to provide low-level functionalities. iText Java lib...
iText is an ideal library for developers looking to enhance web- and other applications with dynamic...
JDK 11 jdk.localedata.jmod is the JMOD file for JDK 11 Localedata module. JDK 11 Locale Data module ...