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 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.14.0-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
Or download all of them as a single archive file:
File name: jackson-databind-2.14.0-sources.jar File size: 1187952 bytes Release date: 2022-11-05 Download
⇒ Jackson Annotations Source Code
⇐ Download and Install Jackson Binary Package
2022-03-29, ≈297🔥, 0💬
Popular Posts:
ANTLR is a powerful parser generator for multiple programming languages including Java. ANTLR contai...
JDK 17 jdk.hotspot.agent.jmod is the JMOD file for JDK 17 Hotspot Agent module. JDK 17 Hotspot Agent...
The Web Services Description Language for Java Toolkit (WSDL4J), Release 1.6.2, allows the creation,...
A stream buffer is a stream-based representation of an XML infoset in Java. Stream buffers are desig...
The Java Naming and Directory Interface (JNDI) is part of the Java platform, providing applications ...