Groovy 2.2.0

org.codehaus.groovy.syntax
[Java] Class ASTHelper

java.lang.Object
  org.codehaus.groovy.syntax.ASTHelper

public class ASTHelper
extends Object

A common base class of AST helper methods which can be shared across the classic and new parsers

Authors:
Jochen Theodorou
James Strachan
Bob McWhirter
Sam Pullara
Chris Poirier


Field Summary
protected ModuleNode output

protected static Map resolutions

 
Constructor Summary
ASTHelper(SourceUnit controller, ClassLoader classLoader)

ASTHelper()

 
Method Summary
protected void addImport(ClassNode type, String name, String aliasName)

protected void addImport(ClassNode type, String name, String aliasName, List annotations)

protected void addStarImport(String importPackage)

protected void addStarImport(String importPackage, List annotations)

protected void addStaticImport(ClassNode type, String name, String alias)

protected void addStaticImport(ClassNode type, String name, String alias, List annotations)

protected void addStaticStarImport(ClassNode type, String importClass)

protected void addStaticStarImport(ClassNode type, String importClass, List annotations)

static String dot(String base, String name)

Returns:
Two names joined by a dot.

protected String dot(String base)

A synonym for dot( base, "" ).

ClassLoader getClassLoader()

Returns our class loader (as supplied on construction).

SourceUnit getController()

String getPackageName()

protected void makeModule()

void setClassLoader(ClassLoader classLoader)

void setController(SourceUnit controller)

PackageNode setPackage(String packageName, List annotations)

void setPackageName(String packageName)

 
Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Field Detail

output

protected ModuleNode output


resolutions

protected static Map resolutions


 
Constructor Detail

ASTHelper

public ASTHelper(SourceUnit controller, ClassLoader classLoader)


ASTHelper

public ASTHelper()


 
Method Detail

addImport

protected void addImport(ClassNode type, String name, String aliasName)


addImport

protected void addImport(ClassNode type, String name, String aliasName, List annotations)


addStarImport

protected void addStarImport(String importPackage)


addStarImport

protected void addStarImport(String importPackage, List annotations)


addStaticImport

protected void addStaticImport(ClassNode type, String name, String alias)


addStaticImport

protected void addStaticImport(ClassNode type, String name, String alias, List annotations)


addStaticStarImport

protected void addStaticStarImport(ClassNode type, String importClass)


addStaticStarImport

protected void addStaticStarImport(ClassNode type, String importClass, List annotations)


dot

public static String dot(String base, String name)
Parameters:
base - typically a package
name - typically a simple unqualified class name
Returns:
Two names joined by a dot. If the base name is empty, returns the name unchanged.


dot

protected String dot(String base)
A synonym for dot( base, "" ).


getClassLoader

public ClassLoader getClassLoader()
Returns our class loader (as supplied on construction).


getController

public SourceUnit getController()


getPackageName

public String getPackageName()


makeModule

protected void makeModule()


setClassLoader

public void setClassLoader(ClassLoader classLoader)


setController

public void setController(SourceUnit controller)


setPackage

public PackageNode setPackage(String packageName, List annotations)


setPackageName

public void setPackageName(String packageName)


 

Copyright © 2003-2013 The Codehaus. All rights reserved.