Package org.codehaus.jackson.node

Examples of org.codehaus.jackson.node.ArrayNode.addObject()


      }
      else {
        if (!twig.has(DescendantPropertyParser.DESCENDANT_PROPERTY)) { // avoid to create an empty array in the JSON
          descendantArray = twig.putArray(DescendantPropertyParser.DESCENDANT_PROPERTY);
        }
        final ObjectNode e = descendantArray.addObject();
        e.put(OccurPropertyParser.OCCUR_PROPERTY, clause.getOccur().toString());
        e.put(LevelPropertyParser.LEVEL_PROPERTY, ((DescendantQueryClause) clause).getLevel());
        e.putAll(clause.getQuery().toJson());
      }
    }
View Full Code Here


  ObjectNode toJson() {
    final ObjectNode obj = mapper.createObjectNode();
    final ArrayNode bool = obj.putArray(BooleanPropertyParser.BOOLEAN_PROPERTY);

    for (final QueryClause clause : clauses) {
      final ObjectNode e = bool.addObject();
      e.put(OccurPropertyParser.OCCUR_PROPERTY, clause.getOccur().toString());
      e.putAll(clause.getQuery().toJson());
    }

    return obj;
View Full Code Here

            rtNode.put("name", QNameConverter.toJson(recordType.getName(), namespaces));
        }

        ArrayNode fieldsNode = rtNode.putArray("fields");
        for (FieldTypeEntry entry : recordType.getFieldTypeEntries()) {
            ObjectNode entryNode = fieldsNode.addObject();
            entryNode.put("id", entry.getFieldTypeId().toString());
            entryNode.put("mandatory", entry.isMandatory());
        }

        rtNode.put("version", recordType.getVersion());
View Full Code Here

        rtNode.put("version", recordType.getVersion());


        ArrayNode supertypesNode = rtNode.putArray("supertypes");
        for (Map.Entry<SchemaId, Long> supertype : recordType.getSupertypes().entrySet()) {
            ObjectNode entryNode = supertypesNode.addObject();
            entryNode.put("id", supertype.getKey().toString());
            entryNode.put("version", supertype.getValue());
        }

        return rtNode;
View Full Code Here

        ObjectNode node = JsonNodeFactory.instance.objectNode();
        node.put("default", defaultAccess);

        ArrayNode limitsNode = node.putArray("limits");
        for (Entry<String, Long> limit : limits.entrySet()) {
            ObjectNode limitNode = limitsNode.addObject();
            limitNode.put("store", limit.getKey());
            limitNode.put("limit", limit.getValue());
        }

        return JsonFormat.serializeAsBytesSoft(node, "BlobStoreAccessConfig");
View Full Code Here

    private static ArrayNode causesToJson(Throwable throwable) {
        ArrayNode causesNode = JsonNodeFactory.instance.arrayNode();

        while (throwable != null) {
            ObjectNode causeNode = causesNode.addObject();
            causeNode.put("message", throwable.getMessage());
            causeNode.put("type", throwable.getClass().getName());

            throwable = throwable.getCause();
        }
View Full Code Here

        {
            List<String> childrenNames = context.getExhibitor().getLocalConnection().getChildren().forPath(key);
            SmartSort.sortChildren(childrenNames);
            for ( String name : childrenNames )
            {
                ObjectNode  node = children.addObject();
                node.put("title", name);
                node.put("key", ZKPaths.makePath(key, name));
                node.put("isLazy", true);
                node.put("expand", false);
            }
View Full Code Here

        catch ( Throwable e )
        {
            context.getExhibitor().resetLocalConnection();
            context.getExhibitor().getLog().add(ActivityLog.Type.ERROR, "getNode: " + key, e);

            ObjectNode  node = children.addObject();
            node.put("title", "* Exception *");
            node.put("key", ERROR_KEY);
            node.put("isLazy", false);
            node.put("expand", false);
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.