org.json.JSONWriter#key ( )源码实例Demo

下面列出了org.json.JSONWriter#key ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: RipplePower   文件: LedgerHeader.java
public void toJSONWriter(JSONWriter writer) {
    writer.key("ledger_index");
    writer.value(sequence.toJSON());
    writer.key("total_coins");
    writer.value(totalXRP.toString(10));
    writer.key("parent_hash");
    writer.value(previousLedger.toJSON());
    writer.key("transaction_hash");
    writer.value(transactionHash.toJSON());
    writer.key("account_hash");
    writer.value(stateHash.toJSON());
    writer.key("close_time");
    writer.value(closeTime.toJSON());
    writer.key("parent_close_time");
    writer.value(parentCloseTime.toJSON());
    writer.key("close_time_resolution");
    writer.value(closeResolution.toJSON());
    writer.key("close_flags");
    writer.value(closeFlags.toJSON());
}
 
源代码2 项目: ripple-lib-java   文件: LedgerHeader.java
public void toJSONWriter(JSONWriter writer) {
    writer.key("ledger_index");
    writer.value(sequence.toJSON());
    writer.key("total_coins");
    writer.value(totalXRP.toString(10));
    writer.key("parent_hash");
    writer.value(previousLedger.toJSON());
    writer.key("transaction_hash");
    writer.value(transactionHash.toJSON());
    writer.key("account_hash");
    writer.value(stateHash.toJSON());
    writer.key("close_time");
    writer.value(closeTime.toJSON());
    writer.key("parent_close_time");
    writer.value(parentCloseTime.toJSON());
    writer.key("close_time_resolution");
    writer.value(closeResolution.toJSON());
    writer.key("close_flags");
    writer.value(closeFlags.toJSON());
}
 
源代码3 项目: jingtum-lib-java   文件: LedgerHeader.java
public void toJSONWriter(JSONWriter writer) {
    writer.key("ledger_index");
    writer.value(sequence.toJSON());
    writer.key("total_coins");
    writer.value(totalXRP.toString(10));
    writer.key("parent_hash");
    writer.value(previousLedger.toJSON());
    writer.key("transaction_hash");
    writer.value(transactionHash.toJSON());
    writer.key("account_hash");
    writer.value(stateHash.toJSON());
    writer.key("close_time");
    writer.value(closeTime.toJSON());
    writer.key("parent_close_time");
    writer.value(parentCloseTime.toJSON());
    writer.key("close_time_resolution");
    writer.value(closeResolution.toJSON());
    writer.key("close_flags");
    writer.value(closeFlags.toJSON());
}
 
源代码4 项目: sndml3   文件: Record.java
public String toJSON() {
	StringWriter writer = new StringWriter();
	JSONWriter json = new JSONWriter(writer);
	json.object();
	for (String name : this.getFieldNames()) {
		String value = this.getValue(name);
		if (value != null && value.length() > 0) {
			json.key(name);
			json.value(value);				
		}
	}
	json.endObject();
	return writer.toString();
}
 
源代码5 项目: onedev   文件: AbstractProjectChoiceProvider.java
@Override
public void toJson(Project choice, JSONWriter writer) throws JSONException {
	writer.key("id").value(choice.getId());
	writer.key("name");
	writer.value(HtmlEscape.escapeHtml5(choice.getName()));
}
 
源代码6 项目: onedev   文件: Json.java
/**
    * Writes a key/value pair into the {@code writer} if the value is not {@code null}
    * 
    * @param writer
    *            json writer
    * @param key
    *            key
    * @param value
    *            value
    * @throws JSONException
    */
   public static void writeObject(JSONWriter writer, String key, Object value) throws JSONException {
if (value != null) {
    writer.key(key);
    writer.value(value);
}
   }
 
 方法所在类
 同类方法