本文整理汇总了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));
}
示例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();
}
示例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;
}
示例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;
}