当前位置: 首页>>代码示例>>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;未经允许,请勿转载。