private ObjectJS jsonTreeNode ( CallTreeNode node , StringifierFactory jsonStringifierFactory ) { final ObjectJS nodeJS = ObjectJS . create ( node , jsonStringifierFactory ) ; if ( ! node . getChildren ( ) . isEmpty ( ) ) { final ArrayJS childNodesJS = new ArrayJS ( node . getChildren ( ) . size ( ) ) ; for ( CallTreeNode childNode : node . getChildren ( ) ) { childNodesJS . addElement ( jsonTreeNode ( childNode , jsonStringifierFactory ) ) ; } nodeJS . setAttribute ( "children" , childNodesJS ) ; } return nodeJS ; }
Generate a JSON call tree node object