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 Annotations Source Code
Jackson is "the Java JSON library" or "the best JSON parser for Java". Or simply as "JSON for Java".
Jackson Annotations Source Code files are provided in the source packge (jackson-annotations-2.12.4-sources.jar). You can download it at Jackson Maven Website.
You can also browse Jackson Annotations Source Code below:
✍: FYIcenter.com
⏎ com/fasterxml/jackson/databind/node/DoubleNode.java
package com.fasterxml.jackson.databind.node; import java.io.IOException; import java.math.BigDecimal; import java.math.BigInteger; import com.fasterxml.jackson.core.*; import com.fasterxml.jackson.core.io.NumberOutput; import com.fasterxml.jackson.databind.SerializerProvider; /** * Numeric node that contains 64-bit ("double precision") * floating point values simple 32-bit integer values. */ @SuppressWarnings("serial") public class DoubleNode extends NumericNode { protected final double _value; /* /********************************************************** /* Construction /********************************************************** */ public DoubleNode(double v) { _value = v; } public static DoubleNode valueOf(double v) { return new DoubleNode(v); } /* /********************************************************** /* BaseJsonNode extended API /********************************************************** */ @Override public JsonToken asToken() { return JsonToken.VALUE_NUMBER_FLOAT; } @Override public JsonParser.NumberType numberType() { return JsonParser.NumberType.DOUBLE; } /* /********************************************************** /* Overrridden JsonNode methods /********************************************************** */ @Override public boolean isFloatingPointNumber() { return true; } @Override public boolean isDouble() { return true; } @Override public boolean canConvertToInt() { return (_value >= Integer.MIN_VALUE && _value <= Integer.MAX_VALUE); } @Override public boolean canConvertToLong() { return (_value >= Long.MIN_VALUE && _value <= Long.MAX_VALUE); } @Override // since 2.12 public boolean canConvertToExactIntegral() { return !Double.isNaN(_value) && !Double.isInfinite(_value) && (_value == Math.rint(_value)); } @Override public Number numberValue() { return Double.valueOf(_value); } @Override public short shortValue() { return (short) _value; } @Override public int intValue() { return (int) _value; } @Override public long longValue() { return (long) _value; } @Override public float floatValue() { return (float) _value; } @Override public double doubleValue() { return _value; } @Override public BigDecimal decimalValue() { return BigDecimal.valueOf(_value); } @Override public BigInteger bigIntegerValue() { return decimalValue().toBigInteger(); } @Override public String asText() { return NumberOutput.toString(_value); } // @since 2.9 @Override public boolean isNaN() { return Double.isNaN(_value) || Double.isInfinite(_value); } @Override public final void serialize(JsonGenerator g, SerializerProvider provider) throws IOException { g.writeNumber(_value); } @Override public boolean equals(Object o) { if (o == this) return true; if (o == null) return false; if (o instanceof DoubleNode) { // We must account for NaNs: NaN does not equal NaN, therefore we have // to use Double.compare(). final double otherValue = ((DoubleNode) o)._value; return Double.compare(_value, otherValue) == 0; } return false; } @Override public int hashCode() { // same as hashCode Double.class uses long l = Double.doubleToLongBits(_value); return ((int) l) ^ (int) (l >> 32); } }
⏎ com/fasterxml/jackson/databind/node/DoubleNode.java
Â
⇒ Jackson Dataformat Extensions
⇠Jackson Data Binding Source Code
⇑ Downloading and Reviewing jackson-*.jar
⇑⇑ Jackson - Java JSON library
2022-02-19, 36276👍, 0💬
Popular Posts:
What Is commons-lang3-3.1.jar? commons-lang3-3.1.jar is the JAR file for Apache Commons Lang 3.1, wh...
How to show the XML parsing flow with sax\DocumentTracer.java provided in the Apache Xerces package?...
JDK 11 jdk.jdi.jmod is the JMOD file for JDK 11 JDI (Java Debug Interface) tool. JDK 11 JDI tool com...
What Is commons-lang3-3.1.jar? commons-lang3-3.1.jar is the JAR file for Apache Commons Lang 3.1, wh...
GJT (Giant Java Tree) implementation of XML Pull Parser. JAR File Size and Download Location: File n...