com.googlecode.fascinator.common.JsonObject.<init>()方法的使用及代码示例

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

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

JsonObject.<init>介绍

暂无

代码示例

代码示例来源:origin: com.googlecode.the-fascinator/fascinator-common

/**
 * Create a new empty node
 *
 */
public ManifestNode() {
  super(new JsonObject());
}

代码示例来源:origin: com.googlecode.the-fascinator/fascinator-common

/**
 * Wrap a JsonObject in this class
 *
 * @param newJsonObject : The JsonObject to wrap
 */
public JsonSimple(JsonObject newJsonObject) {
  substitueProperties = true;
  if (newJsonObject == null) {
    newJsonObject = new JsonObject();
  }
  jsonObject = newJsonObject;
}

代码示例来源:origin: com.googlecode.the-fascinator/fascinator-common

/**
 * Creates an empty JSON object
 *
 * @throws IOException if there was an error during creation
 */
public JsonSimple() {
  substitueProperties = true;
  jsonObject = new JsonObject();
}

代码示例来源:origin: com.googlecode.the-fascinator/fascinator-common

@Override
  public Map<?, ?> createObjectContainer() {
    return new JsonObject();
  }
};

代码示例来源:origin: com.googlecode.the-fascinator/fascinator-common

/**
 * Creates a JSON object from the specified string
 *
 * @param jsonIn a JSON string
 * @throws IOException if there was an error parsing the string
 */
public JsonSimple(String jsonString) throws IOException {
  substitueProperties = true;
  if (jsonString == null) {
    jsonObject = new JsonObject();
  } else {
    parse(jsonString);
  }
}

代码示例来源:origin: com.googlecode.the-fascinator/fascinator-common

/**
 * Creates a JSON object from the specified input stream
 *
 * @param jsonIn a JSON stream
 * @throws IOException if there was an error parsing or reading the stream
 */
public JsonSimple(InputStream jsonIn) throws IOException {
  substitueProperties = true;
  if (jsonIn == null) {
    jsonObject = new JsonObject();
  } else {
    // Stream the data into a string
    parse(IOUtils.toString(jsonIn, "UTF-8"));
    jsonIn.close();
  }
}

代码示例来源:origin: com.googlecode.the-fascinator/fascinator-common

/**
 * Creates a JSON object from the specified file
 *
 * @param jsonFile a JSON file
 * @throws IOException if there was an error parsing or reading the file
 */
public JsonSimple(File jsonFile) throws IOException {
  substitueProperties = true;
  if (jsonFile == null) {
    jsonObject = new JsonObject();
  } else {
    InputStream is = new FileInputStream(jsonFile);
    String json = IOUtils.toString(is, "UTF-8");
    is.close();
    parse(json);
  }
}

代码示例来源:origin: com.googlecode.redbox-mint/redbox-web-service

protected JsonObject getSuccessResponse(String oid) {
  JsonObject jsonObject = new JsonObject();
  jsonObject.put("code", 200);
  if (oid != null) {
    jsonObject.put("oid", oid);
  }
  return jsonObject;
}

代码示例来源:origin: com.googlecode.redbox-mint/redbox-web-service

@SuppressWarnings("unchecked")
public void updateAndSaveKeys(@SuppressWarnings("rawtypes") JSONArray keys) throws IOException {
  JsonObject jsonObject = new JsonObject();
  JsonObject apiJsonObject = new JsonObject();
  apiJsonObject.put("clients", keys);
  jsonObject.put("api", apiJsonObject);
  FileUtils.writeStringToFile(this.apiKeysFile, new JsonSimple(jsonObject).toString(true));
  this.clients = keys;
  initialiseKeyMap();
}

代码示例来源:origin: com.googlecode.redbox-mint/plugin-transaction-curation-redbox

private JsonObject newMessage(JsonSimple response, String target) {
  JsonObject order = createNewOrder(response,
      TransactionManagerQueueConsumer.OrderType.MESSAGE.toString());
  order.put("target", target);
  order.put("message", new JsonObject());
  return order;
}

代码示例来源:origin: com.googlecode.redbox-mint/plugin-transaction-curation-mint

private JsonObject newMessage(JsonSimple response, String target) {
  JsonObject order = createNewOrder(response,
      TransactionManagerQueueConsumer.OrderType.MESSAGE.toString());
  order.put("target", target);
  order.put("message", new JsonObject());
  return order;
}
private JsonObject newSubscription(JsonSimple response, String oid) {

代码示例来源:origin: com.googlecode.the-fascinator/fascinator-core

/**
 * Send the notification out on the broadcast topic
 * 
 * @param oid Object id
 * @param status Status of the object
 * @param message Message to be sent
 */
private void sendNotification(String oid, String status, String message)
    throws JMSException {
  JsonObject jsonMessage = new JsonObject();
  jsonMessage.put("id", oid);
  jsonMessage.put("idType", "object");
  jsonMessage.put("status", status);
  jsonMessage.put("message", message);
  TextMessage msg = session.createTextMessage(jsonMessage.toString());
  // producer.send(broadcast, msg);
}

代码示例来源:origin: com.googlecode.the-fascinator/fascinator-core

/**
 * Send the notification out on the broadcast topic
 * 
 * @param oid Object Id
 * @param status Status of the object
 * @param message Message to be sent
 */
private void sendNotification(String oid, String status, String message)
    throws JMSException {
  JsonObject jsonMessage = new JsonObject();
  jsonMessage.put("id", oid);
  jsonMessage.put("idType", "object");
  jsonMessage.put("status", status);
  jsonMessage.put("message", message);
  TextMessage msg = session.createTextMessage(jsonMessage.toString());
  // producer.send(broadcast, msg);
}

代码示例来源:origin: com.googlecode.the-fascinator/fascinator-core

/**
 * Send the notification out on the broadcast topic
 *
 * @param oid Object id
 * @param status Status of the object
 * @param message Message to be sent
 */
private void sendNotification(String oid, String status, String message)
    throws JMSException {
  JsonObject jsonMessage = new JsonObject();
  jsonMessage.put("id", oid);
  jsonMessage.put("idType", "object");
  jsonMessage.put("status", status);
  jsonMessage.put("message", message);
  TextMessage msg = session.createTextMessage(jsonMessage.toString());
  // producer.send(broadcast, msg);
}

代码示例来源:origin: com.googlecode.redbox-mint/plugin-transaction-curation-mint

private JsonObject newTransform(
    JsonSimple response, String target, String oid) {
  JsonObject order = createNewOrder(response,
      TransactionManagerQueueConsumer.OrderType.
      TRANSFORMER.toString());
  order.put("target", target);
  order.put("oid", oid);
  order.put("config", new JsonObject());
  return order;
}
private JsonObject createNewOrder(JsonSimple response, String type) {

代码示例来源:origin: com.googlecode.the-fascinator.plugins/plugin-indexer-solr

/**
 * Add a new document into the buffer, and check if submission is required
 * 
 * @param document : The Solr document to add to the buffer.
 */
private void addToBuffer(String index, String document) {
  JsonObject message = new JsonObject();
  message.put("event", "index");
  message.put("index", index);
  message.put("document", document);
  sendToIndex(message.toString());
}

代码示例来源:origin: com.googlecode.redbox-mint/redbox-web-service

@ApiOperation(value = "gets the record's Object Metadata", tags="objectmeta")
@ApiResponses({
  @ApiResponse(code = 200, message = "The object metadata is returned"),
  @ApiResponse(code = 500, message = "General Error", response = Exception.class)
})
@Get("json")
public String getMetadataResource() throws StorageException, IOException {
  Storage storage = (Storage) ApplicationContextProvider.getApplicationContext().getBean("fascinatorStorage");
  String oid = getAttribute("oid");
  DigitalObject digitalObject = StorageUtils.getDigitalObject(storage, oid);
  Properties metadata = digitalObject.getMetadata();
  JsonObject jsonObject = new JsonObject();
  for (Object keyObject : metadata.keySet()) {
    jsonObject.put((String) keyObject, metadata.getProperty((String) keyObject));
  }
  return new JsonSimple(jsonObject).toString(true);
}

代码示例来源:origin: com.googlecode.redbox-mint/plugin-transaction-curation-redbox

private JsonObject newTransform(JsonSimple response, String target,
    String oid) {
  JsonObject order = createNewOrder(response,
      TransactionManagerQueueConsumer.OrderType.TRANSFORMER
          .toString());
  order.put("target", target);
  order.put("oid", oid);
  JsonObject config = systemConfig.getObject("transformerDefaults",
      target);
  if (config == null) {
    order.put("config", new JsonObject());
  } else {
    order.put("config", config);
  }
  return order;
}

代码示例来源:origin: com.googlecode.redbox-mint/plugin-transaction-curation-redbox

private JsonObject newSubscription(JsonSimple response, String oid) {
  JsonObject order = createNewOrder(response,
      TransactionManagerQueueConsumer.OrderType.SUBSCRIBER.toString());
  order.put("oid", oid);
  JsonObject message = new JsonObject();
  message.put("oid", oid);
  message.put("context", "Curation");
  message.put("eventType", "Sending test message");
  message.put("user", "system");
  order.put("message", message);
  return order;
}

代码示例来源:origin: com.googlecode.redbox-mint/plugin-transaction-curation-mint

private JsonObject newSubscription(JsonSimple response, String oid) {
  JsonObject order = createNewOrder(response,
      TransactionManagerQueueConsumer.OrderType.
      SUBSCRIBER.toString());
  order.put("oid", oid);
  JsonObject message = new JsonObject();
  message.put("oid", oid);
  message.put("context", "Curation");
  message.put("eventType", "Sending test message");
  message.put("user", "system");
  order.put("message", message);
  return order;
}
private JsonObject newTransform(

相关文章