Categories:
Audio (13)
Biotech (29)
Bytecode (35)
Database (77)
Framework (7)
Game (7)
General (512)
Graphics (53)
I/O (32)
IDE (2)
JAR Tools (86)
JavaBeans (16)
JDBC (89)
JDK (337)
JSP (20)
Logging (103)
Mail (54)
Messaging (8)
Network (71)
PDF (94)
Report (7)
Scripting (83)
Security (32)
Server (119)
Servlet (17)
SOAP (24)
Testing (50)
Web (19)
XML (301)
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.12.4-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/node/BooleanNode.java
package com.fasterxml.jackson.databind.node; import java.io.IOException; import com.fasterxml.jackson.core.*; import com.fasterxml.jackson.databind.SerializerProvider; /** * This concrete value class is used to contain boolean (true / false) * values. Only two instances are ever created, to minimize memory * usage. */ public class BooleanNode extends ValueNode { private static final long serialVersionUID = 2L; // // Just need two instances... public final static BooleanNode TRUE = new BooleanNode(true); public final static BooleanNode FALSE = new BooleanNode(false); private final boolean _value; /** *<p> * NOTE: visibility raised to `protected` in 2.9.3 to allow custom subtypes. */ protected BooleanNode(boolean v) { _value = v; } // To support JDK serialization, recovery of Singleton instance protected Object readResolve() { return _value ? TRUE : FALSE; } public static BooleanNode getTrue() { return TRUE; } public static BooleanNode getFalse() { return FALSE; } public static BooleanNode valueOf(boolean b) { return b ? TRUE : FALSE; } @Override public JsonNodeType getNodeType() { return JsonNodeType.BOOLEAN; } @Override public JsonToken asToken() { return _value ? JsonToken.VALUE_TRUE : JsonToken.VALUE_FALSE; } @Override public boolean booleanValue() { return _value; } @Override public String asText() { return _value ? "true" : "false"; } @Override public boolean asBoolean() { return _value; } @Override public boolean asBoolean(boolean defaultValue) { return _value; } @Override public int asInt(int defaultValue) { return _value ? 1 : 0; } @Override public long asLong(long defaultValue) { return _value ? 1L : 0L; } @Override public double asDouble(double defaultValue) { return _value ? 1.0 : 0.0; } @Override public final void serialize(JsonGenerator g, SerializerProvider provider) throws IOException { g.writeBoolean(_value); } @Override public int hashCode() { return _value ? 3 : 1; } @Override public boolean equals(Object o) { /* 11-Mar-2013, tatu: Apparently ClassLoaders can manage to load * different instances, rendering identity comparisons broken. * So let's use value instead. */ if (o == this) return true; if (o == null) return false; if (!(o instanceof BooleanNode)) { return false; } return (_value == ((BooleanNode) o)._value); } }
⏎ com/fasterxml/jackson/databind/node/BooleanNode.java
Â
⇒ Jackson Annotations Source Code
⇠Download and Install Jackson Binary Package
⇑ Downloading and Reviewing jackson-*.jar
⇑⇑ Jackson - Java JSON library
2022-03-29, 31879👍, 0💬
Popular Posts:
JDK 8 jconsole.jar is the JAR file for JDK 8 JConsole, which is a graphical monitoring tool to monit...
Where to find answers to frequently asked questions on Downloading and Using JDK (Java Development K...
The Apache FontBox library is an open source Java tool to obtain low level information from font fil...
What Is activation.jar? I heard it's related to JAF (JavaBeans Activation Framework) 1.1? The if you...
MXP1 is a stable XmlPull parsing engine that is based on ideas from XPP and in particular XPP2 but c...