org.codehaus.jackson.node.ArrayNode.objectNode()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(4.8k)|赞(0)|评价(0)|浏览(154)

本文整理了Java中org.codehaus.jackson.node.ArrayNode.objectNode()方法的一些代码示例,展示了ArrayNode.objectNode()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ArrayNode.objectNode()方法的具体详情如下:
包路径:org.codehaus.jackson.node.ArrayNode
类名称:ArrayNode
方法名:objectNode

ArrayNode.objectNode介绍

暂无

代码示例

代码示例来源:origin: org.codehaus.jackson/jackson-mapper-asl

/**
 * Method that will construct an ObjectNode and add it at the end
 * of this array node.
 *
 * @return Newly constructed ObjectNode
 */
public ObjectNode addObject()
{
  ObjectNode n  = objectNode();
  _add(n);
  return n;
}

代码示例来源:origin: org.codehaus.jackson/jackson-mapper-asl

/**
 * Method that will construct an ObjectNode and add it at the end
 * of this array node.
 *
 * @return Newly constructed ObjectNode
 */
public ObjectNode insertObject(int index)
{
  ObjectNode n  = objectNode();
  _insert(index, n);
  return n;
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * Method that will construct an ObjectNode and add it at the end
 * of this array node.
 *
 * @return Newly constructed ObjectNode
 */
public ObjectNode addObject()
{
  ObjectNode n  = objectNode();
  _add(n);
  return n;
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * Method that will construct an ObjectNode and add it at the end
 * of this array node.
 *
 * @return Newly constructed ObjectNode
 */
public ObjectNode insertObject(int index)
{
  ObjectNode n  = objectNode();
  _insert(index, n);
  return n;
}

代码示例来源:origin: org.codehaus.jackson/jackson-mapper-lgpl

/**
 * Method that will construct an ObjectNode and add it at the end
 * of this array node.
 *
 * @return Newly constructed ObjectNode
 */
public ObjectNode insertObject(int index)
{
  ObjectNode n  = objectNode();
  _insert(index, n);
  return n;
}

代码示例来源:origin: com.barchart.wrap/barchart-wrap-jackson

/**
 * Method that will construct an ObjectNode and add it at the end
 * of this array node.
 *
 * @return Newly constructed ObjectNode
 */
public ObjectNode addObject()
{
  ObjectNode n  = objectNode();
  _add(n);
  return n;
}

代码示例来源:origin: ovea-deprecated/jetty-session-redis

/**
 * Method that will construct an ObjectNode and add it at the end
 * of this array node.
 *
 * @return Newly constructed ObjectNode
 */
public ObjectNode addObject()
{
  ObjectNode n  = objectNode();
  _add(n);
  return n;
}

代码示例来源:origin: org.codehaus.jackson/jackson-mapper-lgpl

/**
 * Method that will construct an ObjectNode and add it at the end
 * of this array node.
 *
 * @return Newly constructed ObjectNode
 */
public ObjectNode addObject()
{
  ObjectNode n  = objectNode();
  _add(n);
  return n;
}

代码示例来源:origin: de.mhus.lib/mhu-lib-core

public JsonConfig(String json) throws Exception {
  ObjectMapper mapper = new ObjectMapper();
  JsonNode nodex = mapper.readValue(json, JsonNode.class);
  if (nodex instanceof ObjectNode)
    node = (ObjectNode) nodex;
  else {
    node = ((ArrayNode)nodex).objectNode();
    node.put("default", nodex);
  }
}

代码示例来源:origin: com.barchart.wrap/barchart-wrap-jackson

/**
 * Method that will construct an ObjectNode and add it at the end
 * of this array node.
 *
 * @return Newly constructed ObjectNode
 */
public ObjectNode insertObject(int index)
{
  ObjectNode n  = objectNode();
  _insert(index, n);
  return n;
}

代码示例来源:origin: ovea-deprecated/jetty-session-redis

/**
 * Method that will construct an ObjectNode and add it at the end
 * of this array node.
 *
 * @return Newly constructed ObjectNode
 */
public ObjectNode insertObject(int index)
{
  ObjectNode n  = objectNode();
  _insert(index, n);
  return n;
}

代码示例来源:origin: org.neo4j/neo4j-cypher-dsl

public ArrayNode toJSON(Iterable<Map<String, Object>> result)
{
  ArrayNode root = mapper.createArrayNode();
  for (Map<String, Object> stringObjectMap : result)
  {
    ObjectNode entry = root.objectNode();
    for (Map.Entry<String, Object> stringObjectEntry : stringObjectMap.entrySet())
    {
      if (stringObjectEntry.getValue() instanceof Path)
      {
        entry.put(stringObjectEntry.getKey(), stringObjectEntry.getValue().toString());
      } else if (stringObjectEntry.getValue() instanceof Node)
      {
        Node node = (Node) stringObjectEntry.getValue();
        ObjectNode nodeNode = entry.objectNode();
        nodeNode.put("_id", node.getId());
        for (String propertyName : node.getPropertyKeys())
        {
          addProperty(nodeNode, propertyName, node.getProperty(propertyName));
        }
        entry.put(stringObjectEntry.getKey(), nodeNode);
      } else
      {
        addProperty(entry, stringObjectEntry.getKey(), stringObjectEntry.getValue());
      }
    }
    root.add(entry);
  }
  return root;
}

代码示例来源:origin: neo4j-contrib/cypher-dsl

ObjectNode entry = root.objectNode();

代码示例来源:origin: de.mhus.lib/mhu-lib-core

ObjectNode obj = to.objectNode();
to.add(obj);
for (Map.Entry<Object, Object> entry : ((Map<Object,Object>)value).entrySet()) {
  ObjectNode too = to.objectNode();
  to.add(too);
  pojoToJson(value, too, factory, usePublic, level+1);

代码示例来源:origin: de.mhus.lib/mhu-lib-core

@Override
public WritableResourceNode<IConfig> createConfig(String key) throws MException {
  
  // find array node, to append new config
  if (node.get(key) != null && !node.get(key).isArray()) {
    node.remove(key);
  }
  ArrayNode array = (ArrayNode) node.get(key);
  if (array == null) { 					// if not, create one
    array = node.arrayNode();
    node.put(key, array);
    
  }
  
  if (! (array instanceof ArrayNode) ) {
    throw new MException(key + " is not an array");
  }
  
  // create new object node in array
  ObjectNode out = array.objectNode();
  array.add(out);
  
  return new JsonConfig(key, this, out);
}

相关文章