當前位置: 首頁>>代碼示例>>Java>>正文


Java ObjectNode.with方法代碼示例

本文整理匯總了Java中com.fasterxml.jackson.databind.node.ObjectNode.with方法的典型用法代碼示例。如果您正苦於以下問題:Java ObjectNode.with方法的具體用法?Java ObjectNode.with怎麽用?Java ObjectNode.with使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.fasterxml.jackson.databind.node.ObjectNode的用法示例。


在下文中一共展示了ObjectNode.with方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createCollection

import com.fasterxml.jackson.databind.node.ObjectNode; //導入方法依賴的package包/類
@Test
public void createCollection()
{
	ObjectNode schema = Schemas.json(context.getFullName("schema"), "/item/name", "/item/description");
	ObjectNode item = schema.with("definition").with("xml").with("item");
	item.with("name").put("_indexed", true);
	item.with("description").put("_indexed", true);
	item.with("userToRevoke");
	item.with("userToRevoke2");
	item.with("groupToRevoke");
	item.with("roleToGrant");
	schemaId = schemas.getId(schemas.create(schema));
	ObjectNode collection = CollectionJson.json(context.getFullName("collection"), schemaId, null);
	ArrayNode dynamicRules = collection.with("security").putArray("dynamicRules");
	dynamicRules.add(dynamicRule("U", "/item/userToRevoke", "DISCOVER_ITEM", false));
	dynamicRules.add(dynamicRule("G", "/item/groupToRevoke", "EDIT_ITEM", false));
	dynamicRules.add(dynamicRule("R", "/item/roleToGrant", "ARCHIVE_ITEM", true));
	collectionUuid = collections.getId(collections.create(collection));
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:20,代碼來源:DynamicAclTest.java

示例2: createSimpleWorkflow

import com.fasterxml.jackson.databind.node.ObjectNode; //導入方法依賴的package包/類
private void createSimpleWorkflow() throws IOException
{
	token = requestToken(OAUTH_CLIENT_ID);
	ObjectNode workflow = mapper.createObjectNode();
	workflow.put("name", "A workflow");
	ObjectNode root = workflow.with("root");
	root.put("name", "start");
	root.put("type", "s");

	HttpResponse response = postEntity(workflow.toString(), context.getBaseUrl() + "api/workflow", token, true);
	assertResponse(response, 201, "Expected workflow to be created");

	workflowUri = response.getFirstHeader("Location").getValue();
	ObjectNode newWorkflow = (ObjectNode) getEntity(workflowUri, token);
	workflowUuid = newWorkflow.get("uuid").asText();
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:17,代碼來源:WorkflowApiLockTest.java

示例3: basicJson

import com.fasterxml.jackson.databind.node.ObjectNode; //導入方法依賴的package包/類
public static ObjectNode basicJson(String name)
{
	ObjectNode schema = json(name, "/item/name", "/item/description");
	ObjectNode item = schema.with("definition").with("xml").with("item");
	ObjectNode nameNode = item.with("name");
	nameNode.put("_indexed", true);
	nameNode.put("_type", "text");
	ObjectNode descNode = item.with("description");
	descNode.put("_indexed", true);
	descNode.put("_type", "text");
	return schema;
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:13,代碼來源:Schemas.java

示例4: createWorkflowJson

import com.fasterxml.jackson.databind.node.ObjectNode; //導入方法依賴的package包/類
protected ObjectNode createWorkflowJson(String name)
{
	ObjectNode workflow = mapper.createObjectNode();
	workflow.put("name", name);
	ObjectNode root = workflow.with("root");
	root.put("name", "start");
	root.put("type", "s");
	return workflow;
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:10,代碼來源:AbstractEntityApiTest.java


注:本文中的com.fasterxml.jackson.databind.node.ObjectNode.with方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。