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/util/MinimalPrettyPrinter.java
package com.fasterxml.jackson.core.util; import java.io.IOException; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.PrettyPrinter; /** * {@link PrettyPrinter} implementation that adds no indentation, * just implements everything necessary for value output to work * as expected, and provide simpler extension points to allow * for creating simple custom implementations that add specific * decoration or overrides. Since behavior then is very similar * to using no pretty printer at all, usually sub-classes are used. *<p> * Beyond purely minimal implementation, there is limited amount of * configurability which may be useful for actual use: for example, * it is possible to redefine separator used between root-level * values (default is single space; can be changed to line-feed). *<p> * Note: does NOT implement {@link Instantiatable} since this is * a stateless implementation; that is, a single instance can be * shared between threads. */ public class MinimalPrettyPrinter implements PrettyPrinter, java.io.Serializable { private static final long serialVersionUID = 1L; protected String _rootValueSeparator; /** * @since 2.9 */ protected Separators _separators; /* /********************************************************** /* Life-cycle, construction, configuration /********************************************************** */ public MinimalPrettyPrinter() { this(DEFAULT_ROOT_VALUE_SEPARATOR.toString()); } public MinimalPrettyPrinter(String rootValueSeparator) { _rootValueSeparator = rootValueSeparator; _separators = DEFAULT_SEPARATORS; } public void setRootValueSeparator(String sep) { _rootValueSeparator = sep; } /** * @param separators Separator definitions * * @return This pretty-printer instance to allow call chaining * * @since 2.9 */ public MinimalPrettyPrinter setSeparators(Separators separators) { _separators = separators; return this; } /* /********************************************************** /* PrettyPrinter impl /********************************************************** */ @Override public void writeRootValueSeparator(JsonGenerator g) throws IOException { if (_rootValueSeparator != null) { g.writeRaw(_rootValueSeparator); } } @Override public void writeStartObject(JsonGenerator g) throws IOException { g.writeRaw('{'); } @Override public void beforeObjectEntries(JsonGenerator g) throws IOException { // nothing special, since no indentation is added } /** * Method called after an object field has been output, but * before the value is output. *<p> * Default handling will just output a single * colon to separate the two, without additional spaces. */ @Override public void writeObjectFieldValueSeparator(JsonGenerator g) throws IOException { g.writeRaw(_separators.getObjectFieldValueSeparator()); } /** * Method called after an object entry (field:value) has been completely * output, and before another value is to be output. *<p> * Default handling (without pretty-printing) will output a single * comma to separate the two. */ @Override public void writeObjectEntrySeparator(JsonGenerator g) throws IOException { g.writeRaw(_separators.getObjectEntrySeparator()); } @Override public void writeEndObject(JsonGenerator g, int nrOfEntries) throws IOException { g.writeRaw('}'); } @Override public void writeStartArray(JsonGenerator g) throws IOException { g.writeRaw('['); } @Override public void beforeArrayValues(JsonGenerator g) throws IOException { // nothing special, since no indentation is added } /** * Method called after an array value has been completely * output, and before another value is to be output. *<p> * Default handling (without pretty-printing) will output a single * comma to separate values. */ @Override public void writeArrayValueSeparator(JsonGenerator g) throws IOException { g.writeRaw(_separators.getArrayValueSeparator()); } @Override public void writeEndArray(JsonGenerator g, int nrOfValues) throws IOException { g.writeRaw(']'); } }
⏎ com/fasterxml/jackson/core/util/MinimalPrettyPrinter.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, 47744👍, 1💬
Popular Posts:
JDK 11 jdk.aot.jmod is the JMOD file for JDK 11 Ahead-of-Time (AOT) Compiler module. JDK 11 AOT Comp...
Provides a simple high-level Http server API, which can be used to build embedded HTTP servers. Both...
The JSR 105 XML Digital Signature 1.0.1 FCS implementation provides an API and implementation that a...
How to download and install Apache ZooKeeper Source Package? Apache ZooKeeper is an open-source serv...
Where to find answers to frequently asked questions on Downloading and Installing ojdbc.jar - JDBC D...