Render the node model as JSON

@param rootNode
@param renderRoot
@return
492945
public static String renderModelAsJson(Node rootNode, boolean renderRoot) {
        if (renderRoot) {
            return renderSubnodes(rootNode == null ? new ArrayList<Node>() : new ArrayList<Node>(Arrays.asList(rootNode)));
        } else if (rootNode != null && rootNode.hasChild()) {
            return renderSubnodes(rootNode.getChilds());
        }

        return "";
    }
300597
@SuppressFBWarnings("RV_RETURN_VALUE_IGNORED_INFERRED")
    private void renderLeaf(final TreeNode root, final String name,
                            final Class<?> item, final List<String> markers) {
        root.child(String.format("%-10s ", name) + RenderUtils.renderClassLine(item, markers));
    }
635583
function renderDOM($, dom, options) {
    if (!dom && $._root && $._root.children) {
        dom = $._root.children;
    }
    options = options|| dom.options || $._options;
    return domSerializer(dom, options);
}
1182113
@Post("/node/obj")
    @ProducesJson
    public Response json2(@RequestObject JsonNode input) {
        final JsonNode name = input.get("name");
        return new Response(Response.SUCCESS, name.textValue());
    }
625149
public String stringify(JsonNode json) {
        try {
            return mapper().writerWithDefaultPrettyPrinter().writeValueAsString(json);
        } catch (JsonProcessingException e) {
            throw new RuntimeException("Cannot stringify the input json node", e);
        }
    }
1199848
public StaticRouting.NodesMap nodesMapFromJSON(Model mo, JSONObject o) throws JSONConverterException {
        return new StaticRouting.NodesMap(requiredNode(mo, o, "src"), requiredNode(mo, o, "dst"));
    }
181286
public RequestContext renderJSON() {
        final JsonRenderer jsonRenderer = new JsonRenderer();
        final JSONObject ret = new JSONObject().put(Keys.STATUS_CODE, false);
        jsonRenderer.setJSONObject(ret);

        this.renderer = jsonRenderer;

        return this;
    }
903478
private static void processJsonToTree(final TreeItemIdNode parentNode, final JsonObject json) {

		String id = json.getAsJsonPrimitive("id").getAsString();
		JsonPrimitive expandableJson = json.getAsJsonPrimitive("expandable");

		TreeItemIdNode node = new TreeItemIdNode(id);
		if (expandableJson != null && expandableJson.getAsBoolean()) {
			node.setHasChildren(true);
		}
		parentNode.addChild(node);

		JsonArray children = json.getAsJsonArray("items");
		if (children != null) {
			for (int i = 0; i < children.size(); i++) {
				JsonObject child = children.get(i).getAsJsonObject();
				processJsonToTree(node, child);
			}
		}
	}
154877
function renderNode(node, children = []) {
    [...children].forEach(child => {
        if (child && child.tag) {
            node.ele(child.tag, child.props);
            renderNode(node, child.children);
            node.end();
        } else {
            node.text(child);
        }
    });
}
604813
def render(self, parsed):
        
        self.renderer.root_node = parsed
        with self.renderer as r:
            return r.render(parsed)
125254
public static function buildJsonFromArray($data, $rootElement = '')
    {
        if (!is_array($data)) {
            return null;
        }

        if (!empty($rootElement)) {
            $data = array($rootElement => $data);
        }

        $data = self::setSenderProperty($data);

        return json_encode($data);
    }
345794
public RequestContext renderJSON(final int code) {
        final JsonRenderer jsonRenderer = new JsonRenderer();
        final JSONObject ret = new JSONObject().put(Keys.CODE, code);
        jsonRenderer.setJSONObject(ret);

        this.renderer = jsonRenderer;

        return this;
    }
103340
function renderChildNodes(props, from, to) {
  const {
    nodeType,
    data,
    collectionLimit,
    circularCache,
    keyPath,
    postprocessValue,
    sortObjectKeys
  } = props;
  const childNodes = [];

  getCollectionEntries(
    nodeType,
    data,
    sortObjectKeys,
    collectionLimit,
    from,
    to
  ).forEach(entry => {
    if (entry.to) {
      childNodes.push(
        <ItemRange
          {...props}
          key={`ItemRange--${entry.from}-${entry.to}`}
          from={entry.from}
          to={entry.to}
          renderChildNodes={renderChildNodes}
        />
      );
    } else {
      const { key, value } = entry;
      const isCircular = circularCache.indexOf(value) !== -1;

      const node = (
        <JSONNode
          {...props}
          {...{ postprocessValue, collectionLimit }}
          key={`Node--${key}`}
          keyPath={[key, ...keyPath]}
          value={postprocessValue(value)}
          circularCache={[...circularCache, value]}
          isCircular={isCircular}
          hideRoot={false}
        />
      );

      if (node !== false) {
        childNodes.push(node);
      }
    }
  });

  return childNodes;
}
765722
def render_tree(self, **kwargs):
        """"""
        self.setup(**kwargs)
        svg = self.svg.root
        for f in self.xml_filters:
            svg = f(svg)
        self.teardown()
        return svg
403517
private void renderBundle(final ContextTreeConfig config, final TreeNode root,
                              final Class<?> scope, final Class<Object> bundle) {
        final BundleItemInfo info = service.getData().getInfo(bundle);
        if (isHidden(config, info, scope)) {
            return;
        }
        final List<String> markers = Lists.newArrayList();
        fillCommonMarkers(info, markers, scope);
        final TreeNode node = new TreeNode(RenderUtils.renderClassLine(bundle, markers));
        // avoid duplicate bundle content render
        if (!isDuplicateRegistration(info, scope)) {
            renderScopeContent(config, node, bundle);
        }
        // avoid showing empty bundle line if configured to hide (but show if bundle is ignored as duplicate)
        if (node.hasChildren() || !config.isHideEmptyBundles()
                || (!config.isHideDisables() && markers.contains(IGNORED))) {
            root.child(node);
        }
    }
584042
@Override
	public ObjectJS executeJson(ActionContext context, StringifierFactory jsonStringifierFactory, Simon simon) {
		ObjectJS callTreeJS;
		if (isCallTreeCallbackRegistered(context)) {
			CallTree callTree = getData(simon);
			if (callTree == null) {
				callTreeJS = jsonMessage(NO_DATA_MESSAGE, jsonStringifierFactory);
			} else {
				callTreeJS = ObjectJS.create(callTree, jsonStringifierFactory);
				callTreeJS.setAttribute("rootNode", jsonTreeNode(callTree.getRootNode(), jsonStringifierFactory));
			}
		} else {
			callTreeJS = jsonMessage(NO_CALLBACK_MESSAGE, jsonStringifierFactory);
		}
		return callTreeJS;
	}
611215
function renderDom($, dom, options) {
    if (!dom && $._root && $._root.children) {
        dom = $._root.children;
    }

    options = options|| dom.options || $._options;
    return domSerializer(dom, options);
}