Sha256: 55f30201e802f9279db6ad18fc1ec48d38534b6c709f3b236ca1e1b6f268f721

Contents?: true

Size: 1.96 KB

Versions: 164

Compression:

Stored size: 1.96 KB

Contents

package sh.calaba.org.codehaus.jackson;

/**
 * Intermediate base class for all problems encountered when
 * processing (parsing, generating) JSON content
 * that are not pure I/O problems.
 * Regular {@link java.io.IOException}s will be passed through as is.
 * Sub-class of {@link java.io.IOException} for convenience.
 */
public class JsonProcessingException
    extends java.io.IOException
{
    final static long serialVersionUID = 123; // Stupid eclipse...
	
    protected JsonLocation mLocation;

    protected JsonProcessingException(String msg, JsonLocation loc, Throwable rootCause)
    {
        /* Argh. IOException(Throwable,String) is only available starting
         * with JDK 1.6...
         */
        super(msg);
        if (rootCause != null) {
            initCause(rootCause);
        }
        mLocation = loc;
    }

    protected JsonProcessingException(String msg)
    {
        super(msg);
    }

    protected JsonProcessingException(String msg, JsonLocation loc)
    {
        this(msg, loc, null);
    }

    protected JsonProcessingException(String msg, Throwable rootCause)
    {
        this(msg, null, rootCause);
    }

    protected JsonProcessingException(Throwable rootCause)
    {
        this(null, null, rootCause);
    }

    public JsonLocation getLocation()
    {
        return mLocation;
    }

    /**
     * Default method overridden so that we can add location information
     */
    @Override
    public String getMessage()
    {
        String msg = super.getMessage();
        if (msg == null) {
            msg = "N/A";
        }
        JsonLocation loc = getLocation();
        if (loc != null) {
            StringBuilder sb = new StringBuilder();
            sb.append(msg);
            sb.append('\n');
            sb.append(" at ");
            sb.append(loc.toString());
            return sb.toString();
        }
        return msg;
    }

    @Override
    public String toString() {
        return getClass().getName()+": "+getMessage();
    }
}

Version data entries

164 entries across 164 versions & 2 rubygems

Version Path
calabash-android-0.4.20.1 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonProcessingException.java
calabash-android-0.5.2 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonProcessingException.java
calabash-android-0.5.2.pre1 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonProcessingException.java
calabash-android-0.5.1 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonProcessingException.java
calabash-android-0.5.0 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonProcessingException.java
calabash-android-0.5.0.pre2 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonProcessingException.java
calabash-android-0.5.0.pre1 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonProcessingException.java
calabash-android-0.4.22.pre4 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonProcessingException.java
calabash-android-0.4.22.pre3 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonProcessingException.java
calabash-android-0.4.22.pre1 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonProcessingException.java
calabash-android-0.4.21 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonProcessingException.java
calabash-android-0.4.20 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonProcessingException.java
calabash-android-0.4.19 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonProcessingException.java
calabash-android-0.4.19.pre4 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonProcessingException.java
calabash-android-0.4.19.pre3 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonProcessingException.java
calabash-android-0.4.19.pre2 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonProcessingException.java
calabash-android-0.4.19.pre1 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonProcessingException.java
calabash-android-0.4.18 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonProcessingException.java
calabash-android-0.4.16 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonProcessingException.java
calabash-android-0.4.15.pre2 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/JsonProcessingException.java