com.fasterxml.jackson.databind.node.TextNode.java Source code

Java tutorial

Introduction

Here is the source code for com.fasterxml.jackson.databind.node.TextNode.java

Source

package com.fasterxml.jackson.databind.node;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.io.CharTypes;
import com.fasterxml.jackson.core.io.NumberInput;
import com.fasterxml.jackson.databind.SerializerProvider;

public final class TextNode extends ValueNode {
    static final TextNode EMPTY_STRING_NODE = new TextNode("");
    final String _value;

    public TextNode(String paramString) {
        this._value = paramString;
    }

    protected static void appendQuoted(StringBuilder paramStringBuilder, String paramString) {
        paramStringBuilder.append('"');
        CharTypes.appendQuoted(paramStringBuilder, paramString);
        paramStringBuilder.append('"');
    }

    public static TextNode valueOf(String paramString) {
        if (paramString == null)
            return null;
        if (paramString.length() == 0)
            return EMPTY_STRING_NODE;
        return new TextNode(paramString);
    }

    public long asLong(long paramLong) {
        return NumberInput.parseAsLong(this._value, paramLong);
    }

    public String asText() {
        return this._value;
    }

    public boolean equals(Object paramObject) {
        boolean bool;
        if (paramObject == this)
            bool = true;
        Class localClass1;
        Class localClass2;
        do {
            do {
                return bool;
                bool = false;
            } while (paramObject == null);
            localClass1 = paramObject.getClass();
            localClass2 = getClass();
            bool = false;
        } while (localClass1 != localClass2);
        return ((TextNode) paramObject)._value.equals(this._value);
    }

    public int hashCode() {
        return this._value.hashCode();
    }

    public final void serialize(JsonGenerator paramJsonGenerator, SerializerProvider paramSerializerProvider) {
        if (this._value == null) {
            paramJsonGenerator.writeNull();
            return;
        }
        paramJsonGenerator.writeString(this._value);
    }

    public String textValue() {
        return this._value;
    }

    public String toString() {
        int i = this._value.length();
        StringBuilder localStringBuilder = new StringBuilder(i + 2 + (i >> 4));
        appendQuoted(localStringBuilder, this._value);
        return localStringBuilder.toString();
    }
}

/* Location:           /Users/dantheman/src/fffffffffattttt/basis/classes_dex2jar.jar
 * Qualified Name:     com.fasterxml.jackson.databind.node.TextNode
 * JD-Core Version:    0.6.2
 */