Groovy Documentation

groovy.inspect.swingui
[Groovy] Class ScriptToTreeNodeAdapter

java.lang.Object
  groovy.inspect.swingui.ScriptToTreeNodeAdapter

class ScriptToTreeNodeAdapter

This class controls the conversion from a Groovy script as a String into a tree representation of the AST of that script. The script itself will be a tree node, and each class in the script will be a tree node. The conversion creates tree nodes for any concrete class found within an AST visitor. So, if a tree node should be shown once for each ASTNode and the parent types will not appear as nodes. Custom subclasses of expression types will not appear in the tree. The String label of a tree node is defined by classname in AstBrowserProperties.properties.

Authors:
Hamlet D'Arcy
Roshan Dawrani


Property Summary
GroovyClassLoader classLoader

static java.util.Properties classNameToStringForm

AstBrowserNodeMaker nodeMaker

boolean showScriptClass

boolean showScriptFreeForm

 
Constructor Summary
ScriptToTreeNodeAdapter(java.lang.Object classLoader, java.lang.Object showScriptFreeForm, java.lang.Object showScriptClass, java.lang.Object nodeMaker)

 
Method Summary
java.lang.Object compile(java.lang.String script, int compilePhase)

Performs the conversion from script to TreeNode.

java.lang.Object make(java.lang.Object node)

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Property Detail

classLoader

final GroovyClassLoader classLoader


classNameToStringForm

static java.util.Properties classNameToStringForm


nodeMaker

final AstBrowserNodeMaker nodeMaker


showScriptClass

boolean showScriptClass


showScriptFreeForm

boolean showScriptFreeForm


 
Constructor Detail

ScriptToTreeNodeAdapter

ScriptToTreeNodeAdapter(java.lang.Object classLoader, java.lang.Object showScriptFreeForm, java.lang.Object showScriptClass, java.lang.Object nodeMaker)


 
Method Detail

compile

java.lang.Object compile(java.lang.String script, int compilePhase)
Performs the conversion from script to TreeNode.
Parameters:
script - a Groovy script in String form
compilePhase - the int based CompilePhase to compile it to.


make

java.lang.Object make(java.lang.Object node)


 

Groovy Documentation