本文整理匯總了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;
}