Examples of JsonException


Examples of org.json.JSONException

   */
  public boolean pad(final int width) throws JSONException {
    try {
      return this.bitreader.pad(width);
    } catch (final Throwable e) {
      throw new JSONException(e);
    }
  }
View Full Code Here

Examples of org.json.JSONException

      if (probe) {
        log(value, width);
      }
      return value;
    } catch (final Throwable e) {
      throw new JSONException(e);
    }
  }
View Full Code Here

Examples of org.json.JSONException

        log();
      }
      final String name = read(this.namehuff, this.namehuffext,
          this.namekeep);
      if (jsonobject.opt(name) != null) {
        throw new JSONException("Duplicate key.");
      }
      jsonobject.put(
          name,
          !bit() ? read(this.stringhuff, this.stringhuffext,
              this.stringkeep) : readValue());
View Full Code Here

Examples of org.json.JSONException

      Object value;
      try {
        value = JSONObject.stringToValue(new String(bytes, 0, length,
            "US-ASCII"));
      } catch (final java.io.UnsupportedEncodingException e) {
        throw new JSONException(e);
      }
      this.valuekeep.register(value);
      return value;
    case 2:
      return getAndTick(this.valuekeep, this.bitreader);
    case 3:
      return readJSON();
    default:
      throw new JSONException("Impossible.");
    }
  }
View Full Code Here

Examples of org.json.JSONException

   */
  public void pad(final int width) throws JSONException {
    try {
      this.bitwriter.pad(width);
    } catch (final Throwable e) {
      throw new JSONException(e);
    }
  }
View Full Code Here

Examples of org.json.JSONException

      this.bitwriter.write(integer, width);
      if (probe) {
        log(integer, width);
      }
    } catch (final Throwable e) {
      throw new JSONException(e);
    }
  }
View Full Code Here

Examples of org.json.JSONException

      if (value instanceof JSONObject) {
        write((JSONObject) value);
      } else if (value instanceof JSONArray) {
        write((JSONArray) value);
      } else {
        throw new JSONException("Unrecognized object");
      }
    }
  }
View Full Code Here

Examples of org.json.JSONException

     * @param expectedAction the expected value of the 'action' key in the JSON
     */
    public ActionBase(JSONObject json, String expectedAction) {
        try {
            if (!json.getString("action").equalsIgnoreCase(expectedAction))
                throw new JSONException(expectedAction + " action expected");

            uid = json.getString("uid");

        } catch (JSONException e) {
            e.printStackTrace();
View Full Code Here

Examples of org.json_voltpatches.JSONException

        else
        {
            switch (m_valueType)
            {
            case INVALID:
                throw new JSONException("ConstantValueExpression.toJSONString(): value_type should never be VoltType.INVALID");
            case NULL:
                stringer.value("null");
                break;
            case TINYINT:
                stringer.value(Long.valueOf(m_value));
                break;
            case SMALLINT:
                stringer.value(Long.valueOf(m_value));
                break;
            case INTEGER:
                stringer.value(Long.valueOf(m_value));
                break;
            case BIGINT:
                stringer.value(Long.valueOf(m_value));
                break;
            case FLOAT:
                stringer.value(Double.valueOf(m_value));
                break;
            case STRING:
                stringer.value(m_value);
                break;
            case VARBINARY:
                stringer.value(m_value);
                break;
            case TIMESTAMP:
                stringer.value(Long.valueOf(m_value));
                break;
            case DECIMAL:
                stringer.value(m_value);
                break;
            default:
                throw new JSONException("ConstantValueExpression.toJSONString(): Unrecognized value_type " + m_valueType);
            }
        }
    }
View Full Code Here

Examples of org.jtester.exception.JSONException

  private JSONException syntaxError(String message) {
    StringBuffer error = new StringBuffer(message);
    error.append("\n syntax error at position:" + this.index);
    error.append("\n string parsed is:\n");
    error.append(new String(this.input, 0, this.index));
    return new JSONException(error.toString());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.