本文整理匯總了Java中com.fasterxml.jackson.databind.node.ArrayNode.get方法的典型用法代碼示例。如果您正苦於以下問題:Java ArrayNode.get方法的具體用法?Java ArrayNode.get怎麽用?Java ArrayNode.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.fasterxml.jackson.databind.node.ArrayNode
的用法示例。
在下文中一共展示了ArrayNode.get方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: f_jackson
import com.fasterxml.jackson.databind.node.ArrayNode; //導入方法依賴的package包/類
private void f_jackson() throws Exception {
long startNano = System.nanoTime();
for (int i = 0; i < COUNT; ++i) {
ObjectMapper mapper = new ObjectMapper();
ArrayNode node = (ArrayNode) mapper.readTree(text);
JsonNode head = node.get(0);
JsonNode body = node.get(1);
}
long nano = System.nanoTime() - startNano;
System.out.println(NumberFormat.getInstance().format(nano));
}
示例2: readList
import com.fasterxml.jackson.databind.node.ArrayNode; //導入方法依賴的package包/類
protected Object readList(ListSchema schema, JsonNode node) {
List list = Lists.newArrayList();
ArrayNode arrayNode = (ArrayNode) node;
for (int i = 0; i < arrayNode.size(); i++) {
JsonNode val = arrayNode.get(i);
list.add(getNodeData(schema.getValueSchema(), val));
}
return list;
}
示例3: findFile
import com.fasterxml.jackson.databind.node.ArrayNode; //導入方法依賴的package包/類
private ObjectNode findFile(ObjectNode folderNode, String filename)
{
ArrayNode filesArray = getArray(folderNode, "files");
for( int i = 0; i < filesArray.size(); i++ )
{
ObjectNode file = (ObjectNode) filesArray.get(i);
if( file.get("filename").asText().equals(filename) )
{
return file;
}
}
throw new AssertionError("File " + filename + " not found");
}
示例4: findFolder
import com.fasterxml.jackson.databind.node.ArrayNode; //導入方法依賴的package包/類
private ObjectNode findFolder(ObjectNode folderNode, String filename)
{
ArrayNode filesArray = getArray(folderNode, "folders");
for( int i = 0; i < filesArray.size(); i++ )
{
ObjectNode file = (ObjectNode) filesArray.get(i);
if( file.get("filename").asText().equals(filename) )
{
return file;
}
}
throw new AssertionError("Folder " + filename + " not found");
}
示例5: findFileIndex
import com.fasterxml.jackson.databind.node.ArrayNode; //導入方法依賴的package包/類
private int findFileIndex(ObjectNode staging, String filename)
{
ArrayNode filesArray = (ArrayNode) staging.get("files");
for( int i = 0; i < filesArray.size(); i++ )
{
ObjectNode file = (ObjectNode) filesArray.get(i);
if( file.get("name").asText().equals(filename) )
{
return i;
}
}
return -1;
}
示例6: findFile
import com.fasterxml.jackson.databind.node.ArrayNode; //導入方法依賴的package包/類
private ObjectNode findFile(ObjectNode staging, String filename)
{
ArrayNode filesArray = (ArrayNode) staging.get("files");
for( int i = 0; i < filesArray.size(); i++ )
{
ObjectNode file = (ObjectNode) filesArray.get(i);
if( file.get("name").asText().equals(filename) )
{
return file;
}
}
throw new AssertionError("File " + filename + " not found");
}
示例7: extractUserProfile
import com.fasterxml.jackson.databind.node.ArrayNode; //導入方法依賴的package包/類
@Override
protected VkProfile extractUserProfile(final String body) throws HttpAction {
final VkProfile profile = new VkProfile();
JsonNode json = JsonHelper.getFirstNode(body);
if (json != null) {
ArrayNode array = (ArrayNode) json.get("response");
JsonNode userNode = array.get(0);
profile.setId(JsonHelper.getElement(userNode, "uid"));
for (final String attribute : profile.getAttributesDefinition().getPrimaryAttributes()) {
profile.addAttribute(attribute, JsonHelper.getElement(userNode, attribute));
}
}
return profile;
}