class ScriptToTreeNodeAdapter
extends Object
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.
| Type | Name and description |
|---|---|
GroovyClassLoader |
classLoaderClass loader used for script compilation. |
static Properties |
classNameToStringFormMaps AST node class names to display templates. |
AstBrowserNodeMaker |
nodeMakerFactory used to create tree node instances. |
boolean |
showClosureClassesDisplay flags that control which script structures are included. |
boolean |
showScriptClassDisplay flags that control which script structures are included. |
boolean |
showScriptFreeFormDisplay flags that control which script structures are included. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
Object |
compile(String script, int compilePhase)Performs the conversion from script to TreeNode. |
|
void |
extendMethodNodePropertyTable(List<List<?>> table, MethodNode node)Extends the method node property table by adding custom properties. |
|
Object |
make(Object node)Creates a tree node for the supplied AST node. |
|
Object |
make(MethodNode node)Creates a tree node for a method node with its descriptor metadata. |
|
String |
toString(Object o) |
Class loader used for script compilation.
Maps AST node class names to display templates.
Factory used to create tree node instances.
Display flags that control which script structures are included.
Display flags that control which script structures are included.
Display flags that control which script structures are included.
Creates an adapter for the supplied compilation settings.
classLoader - class loader used for compilationshowScriptFreeForm - whether to include free-form script statementsshowScriptClass - whether to include the generated script classshowClosureClasses - whether to include generated closure classesnodeMaker - node factory used for tree creationconfig - optional compiler configurationPerforms the conversion from script to TreeNode.
script
- a Groovy script in String formcompilePhase
- the int based CompilePhase to compile it to.Extends the method node property table by adding custom properties.
table - property table to extendnode - method node supplying the descriptorCreates a tree node for the supplied AST node.
node - AST node to adaptCreates a tree node for a method node with its descriptor metadata.
node - method node to adaptCopyright © 2003-2026 The Apache Software Foundation. All rights reserved.