public class TypeGraphJsonExtJSPrintVisitor extends TypeGraphPrintVisitor
Title: Framework Support Library
Description: A visitor class, which is used for printing of a type graph
(see TypeGraph
) in JSON format applicable for ExtJs tree.
[ { text: 'map (HashMap) children: [ { text:'key (String)', lead:true }, { text:'value (Test)', leaf:true } }, { text:'str (String)', leaf:true }, { text:'list (ArrayList)' children: [ { text:'value (Test)', leaf:true } ] } ]
Copyright: Copyright (c) 2011
Company: StreamScape Technologies
Constructor and Description |
---|
TypeGraphJsonExtJSPrintVisitor() |
Modifier and Type | Method and Description |
---|---|
void |
afterChildrenVisit(TypeGraph node,
int level)
Prints necessary symbols to mark the end of 'children' array and the current node.
|
boolean |
visit(TypeGraph node,
int level)
Prints the current node in JSON format.
|
setOutput
public boolean visit(TypeGraph node, int level) throws TypeAnalyzerException
visit
in interface TypeGraphVisitor
visit
in class TypeGraphPrintVisitor
node
- The node which is currently traversed by
TypeGraph.traverse(TypeGraphVisitor)
methodlevel
- The level of the currently traversed node in the spanning
tree of the traversed TypeGraph
.TypeAnalyzerException
- If outputting to the current stream failed for the graph nodepublic void afterChildrenVisit(TypeGraph node, int level) throws TypeAnalyzerException
afterChildrenVisit
in interface TypeGraphVisitor
afterChildrenVisit
in class TypeGraphPrintVisitor
node
- The node which children have just been traversed by
TypeGraph.traverse(TypeGraphVisitor)
method.level
- The level in the traversed TypeGraph
spanning
tree of the node, which children have just been traversed.TypeAnalyzerException
- If outputting to the current stream failed for the graph nodeCopyright © 2015-2024 StreamScape Technologies. All rights reserved.