Package com.google.collide.json.client

Examples of com.google.collide.json.client.Jso


      RoutableDtoClientImpl messageImpl = (RoutableDtoClientImpl) msg;
      addCustomFields(messageImpl);
      pushChannel.send(address, messageImpl.serialize(), new ReplyHandler() {
          @Override
        public void onReply(String message) {
          Jso jso = Jso.deserialize(message);

          Log.info(getClass(), message);
         
          if (RoutingTypes.SERVERERROR == jso.getIntField(RoutableDto.TYPE_FIELD)) {
            ServerErrorImpl serverError = (ServerErrorImpl) jso;
            callback.onFail(serverError.getFailureReason());
            return;
          }
View Full Code Here


    return EXTENSION_URL;
  }

  @Override
  public void runDebugger(String sessionId, String url) {
    Jso params = Jso.create();
    params.addField("url", url);
    sendCustomEvent(sessionId, METHOD_WINDOW_OPEN, params);
    sendCustomEvent(sessionId, METHOD_DEBUGGER_ENABLE, null);
    sendCustomEvent(sessionId, METHOD_CONSOLE_ENABLE, null);
  }
View Full Code Here

  }

  @Override
  public void setBreakpointByUrl(String sessionId, BreakpointInfo breakpointInfo) {
    String condition = breakpointInfo.getCondition();
    Jso params = Jso.create();
    if (breakpointInfo.getUrl() != null) {
      params.addField("url", breakpointInfo.getUrl());
    } else {
      params.addField("urlRegex", breakpointInfo.getUrlRegex());
    }
    params.addField("lineNumber", breakpointInfo.getLineNumber());
    params.addField("columnNumber", breakpointInfo.getColumnNumber());
    params.addField("condition", condition == null ? "" : condition);
    sendCustomEvent(sessionId, METHOD_DEBUGGER_SET_BREAKPOINT_BY_URL, params);
  }
View Full Code Here

    sendCustomEvent(sessionId, METHOD_DEBUGGER_SET_BREAKPOINT_BY_URL, params);
  }

  @Override
  public void removeBreakpoint(String sessionId, String breakpointId) {
    Jso params = Jso.create();
    params.addField("breakpointId", breakpointId);
    sendCustomEvent(sessionId, METHOD_DEBUGGER_REMOVE_BREAKPOINT, params);
  }
View Full Code Here

    sendCustomEvent(sessionId, METHOD_DEBUGGER_REMOVE_BREAKPOINT, params);
  }

  @Override
  public void setBreakpointsActive(String sessionId, boolean active) {
    Jso params = Jso.create();
    params.addField("active", active);
    sendCustomEvent(sessionId, METHOD_DEBUGGER_SET_BREAKPOINTS_ACTIVE, params);
  }
View Full Code Here

    sendCustomEvent(sessionId, METHOD_DEBUGGER_SET_BREAKPOINTS_ACTIVE, params);
  }

  @Override
  public void setPauseOnExceptions(String sessionId, PauseOnExceptionsState state) {
    Jso params = Jso.create();
    params.addField("state", state.toString().toLowerCase());
    sendCustomEvent(sessionId, METHOD_DEBUGGER_SET_PAUSE_ON_EXCEPTIONS, params);
  }
View Full Code Here

    sendCustomEvent(sessionId, METHOD_DEBUGGER_STEP_OVER, null);
  }

  @Override
  public void requestRemoteObjectProperties(String sessionId, RemoteObjectId remoteObjectId) {
    Jso params = Jso.create();
    params.addField("objectId", remoteObjectId.toString());
    params.addField("ownProperties", true);
    sendCustomEvent(sessionId, METHOD_RUNTIME_GET_PROPERTIES, params);
  }
View Full Code Here

            || evaluationParsedResponse.wasThrown()
            || evaluationParsedResponse.getResult() == null;

        final RemoteObject evaluationResult = isError ? null : evaluationParsedResponse.getResult();

        Jso params = Jso.create();
        if (!isError && DebuggerApiUtils.isNonFiniteNumber(evaluationResult)) {
          params.addField("functionDeclaration", "function(a) {"
              + "  this[a] = " + evaluationResult.getDescription() + ";"
              + "  return this[a];"
              + "}");
          params.addField("objectId", remoteObjectId.toString());

          JsonArray<Jso> arguments = JsonCollections.createArray();
          arguments.add(Jso.create());
          arguments.get(0).addField("value", propertyName);

          params.addField("arguments", arguments);
        } else if (!isError) {
          params.addField("functionDeclaration", "function(a, b) { this[a] = b; return this[a]; }");
          params.addField("objectId", remoteObjectId.toString());

          JsonArray<Jso> arguments = JsonCollections.createArray();
          arguments.add(Jso.create());
          arguments.add(Jso.create());
          arguments.get(0).addField("value", propertyName);

          if (evaluationResult.getObjectId() == null) {
            if (!DebuggerApiUtils.addPrimitiveJsoField(
                arguments.get(1), "value", evaluationResult)) {
              isError = true;
            }
          } else {
            arguments.get(1).addField("objectId", evaluationResult.getObjectId().toString());
          }

          params.addField("arguments", arguments);
        }

        if (isError) {
          // We do not know the property value. Just dispatch the error event.
          OnRemoteObjectPropertyChanged parsedResponse =
View Full Code Here

  }

  @Override
  public void removeRemoteObjectProperty(final String sessionId,
      final RemoteObjectId remoteObjectId, final String propertyName) {
    Jso params = Jso.create();
    params.addField("functionDeclaration", "function(a) { delete this[a]; return !(a in this); }");
    params.addField("objectId", remoteObjectId.toString());

    JsonArray<Jso> arguments = JsonCollections.createArray();
    arguments.add(Jso.create());
    arguments.get(0).addField("value", propertyName);
    params.addField("arguments", arguments);

    sendCustomEvent(sessionId, METHOD_RUNTIME_CALL_FUNCTION_ON, params, new Callback() {
      @Override
      public void run(ExtensionResponse response) {
        boolean isError = response.isError() || !DebuggerApiUtils.castToBoolean(
View Full Code Here

  }

  @Override
  public void renameRemoteObjectProperty(final String sessionId,
      final RemoteObjectId remoteObjectId, final String oldName, final String newName) {
    Jso params = Jso.create();
    params.addField("functionDeclaration", "function(a, b) {"
        + "  if (a === b) return true;"
        + "  this[b] = this[a];"
        + "  if (this[b] !== this[a]) return false;"
        + "  delete this[a];"
        + "  return !(a in this);"
        + "}");
    params.addField("objectId", remoteObjectId.toString());

    JsonArray<Jso> arguments = JsonCollections.createArray();
    arguments.add(Jso.create());
    arguments.add(Jso.create());
    arguments.get(0).addField("value", oldName);
    arguments.get(1).addField("value", newName);
    params.addField("arguments", arguments);

    sendCustomEvent(sessionId, METHOD_RUNTIME_CALL_FUNCTION_ON, params, new Callback() {
      @Override
      public void run(ExtensionResponse response) {
        boolean isError = response.isError() || !DebuggerApiUtils.castToBoolean(
View Full Code Here

TOP

Related Classes of com.google.collide.json.client.Jso

Copyright © 2018 www.massapicom. 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.