org.vertx.java.core.json.JsonArray.add()方法的使用及代码示例

x33g5p2x  于2022-01-22 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(108)

本文整理了Java中org.vertx.java.core.json.JsonArray.add()方法的一些代码示例,展示了JsonArray.add()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JsonArray.add()方法的具体详情如下:
包路径:org.vertx.java.core.json.JsonArray
类名称:JsonArray
方法名:add

JsonArray.add介绍

暂无

代码示例

代码示例来源:origin: vert-x/mod-lang-php

json.add(value.toJavaObject());

代码示例来源:origin: org.vert-x/vertx-core

public void handle(HttpServerRequest req) {
  if (log.isTraceEnabled()) log.trace("In Info handler");
  req.response.headers().put("Content-Type", "application/json; charset=UTF-8");
  req.response.headers().put("Cache-Control", "no-store, no-cache, must-revalidate, max-age=0");
  JsonObject json = new JsonObject();
  json.putBoolean("websocket", websocket);
  json.putBoolean("cookie_needed", config.getBoolean("insert_JSESSIONID"));
  json.putArray("origins", new JsonArray().add("*:*"));
  // Java ints are signed, so we need to use a long and add the offset so
  // the result is not negative
  json.putNumber("entropy", RAND_OFFSET + new Random().nextInt());
  setCORS(req);
  req.response.end(json.encode());
 }
};

代码示例来源:origin: com.englishtown/vertx-mod-hk2

bootstrapNames = (JsonArray) field;
} else {
  bootstrapNames = new JsonArray().add((field == null ? BOOTSTRAP_BINDER_NAME : field));

代码示例来源:origin: OlivierCroisier/LP4J

/**
 * Constructor.
 *
 * @param httpPort The HTTP port on which the emulator should run.
 */
public EmulatorLaunchpad(int httpPort) {
  vertx = VertxFactory.newVertx();
  // Static files
  HttpServer httpServer = vertx.createHttpServer();
  httpServer.requestHandler(new WebResourceHandler());
  // Eventbus bridge
  JsonObject bridgeConfig = new JsonObject().putString("prefix", EVENTBUS_ADDRESS);
  JsonArray credentialsPermitAll = new JsonArray().add(new JsonObject());
  vertx.createSockJSServer(httpServer).bridge(bridgeConfig, credentialsPermitAll, credentialsPermitAll);
  vertx.eventBus().registerLocalHandler(EVENTBUS_SERVER_HANDLER_ID, eventBusHandler);
  System.out.println("Launchpad emulator is ready on http://localhost:" + httpPort + "/");
  httpServer.listen(httpPort);
}

代码示例来源:origin: org.vert-x/vertx-core

disabled.add(Transport.WEBSOCKET.toString());
installApp(new JsonObject().putString("prefix", "/disabled_websocket_echo")
              .putNumber("max_bytes_streaming", 4096)

相关文章