Java Doc for CompilationUnit.java in  » Scripting » groovy-1.0 » org » codehaus » groovy » control » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Scripting » groovy 1.0 » org.codehaus.groovy.control 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.codehaus.groovy.control.ProcessingUnit
      org.codehaus.groovy.control.CompilationUnit

CompilationUnit
public class CompilationUnit extends ProcessingUnit (Code)
Collects all compilation data as it is generated by the compiler system. Allows additional source units to be added and compilation run again (to affect only the deltas).
author:
   Chris Poirier
author:
   Jochen Theodorou
version:
   $Id: CompilationUnit.java 4661 2007-01-02 16:52:26Z blackdrag $

Inner Class :abstract public static class ClassgenCallback
Inner Class :abstract public static class ProgressCallback
Inner Class :abstract public static class SourceUnitOperation
Inner Class :abstract public static class PrimaryClassNodeOperation
Inner Class :abstract public static class GroovyClassOperation

Field Summary
protected  CompileUnitast
    
protected  MapclassSourcesByPublicClassName
    
protected  ClassgenCallbackclassgenCallback
    
protected  booleanconfigured
    
protected  booleandebug
    
protected  ArrayListgeneratedClasses
    
protected  ArrayListnames
    
 LinkedList[]phaseOperations
    
protected  ProgressCallbackprogressCallback
    
protected  LinkedListqueuedSources
    
protected  ResolveVisitorresolveVisitor
    
protected  HashMapsources
    
protected  MapsummariesByPublicClassName
    
protected  MapsummariesBySourceName
    
protected  Verifierverifier
    

Constructor Summary
public  CompilationUnit()
     Initializes the CompilationUnit with defaults.
public  CompilationUnit(GroovyClassLoader loader)
     Initializes the CompilationUnit with defaults except for class loader.
public  CompilationUnit(CompilerConfiguration configuration)
     Initializes the CompilationUnit with no security considerations.
public  CompilationUnit(CompilerConfiguration configuration, CodeSource security, GroovyClassLoader loader)
     Initializes the CompilationUnit with a CodeSource for controlling security stuff and a class loader for loading classes.

Method Summary
public  voidaddClassNode(ClassNode node)
     Adds a ClassNode directly to the unit (ie.
public  voidaddPhaseOperation(SourceUnitOperation op, int phase)
    
public  voidaddPhaseOperation(PrimaryClassNodeOperation op, int phase)
    
public  voidaddPhaseOperation(GroovyClassOperation op)
    
public  SourceUnitaddSource(File file)
     Adds a source file to the unit.
public  SourceUnitaddSource(URL url)
     Adds a source file to the unit.
public  SourceUnitaddSource(String name, InputStream stream)
     Adds a InputStream source to the unit.
public  SourceUnitaddSource(SourceUnit source)
     Adds a SourceUnit to the unit.
public  voidaddSources(String[] paths)
     Adds a set of file paths to the unit.
public  voidaddSources(File[] files)
     Adds a set of source files to the unit.
public  voidapplyToGeneratedGroovyClasses(GroovyClassOperation body)
    
public  voidapplyToPrimaryClassNodes(PrimaryClassNodeOperation body)
     A loop driver for applying operations to all primary ClassNodes in our AST.
public  voidapplyToSourceUnits(SourceUnitOperation body)
     A loop driver for applying operations to all SourceUnits.
public  voidcompile()
     Synonym for compile(Phases.ALL).
public  voidcompile(int throughPhase)
     Compiles the compilation unit from sources.
public  voidconfigure(CompilerConfiguration configuration)
     Configures its debugging mode and classloader classpath from a given compiler configuration.
protected  ClassVisitorcreateClassVisitor()
    
protected  booleandequeued()
     Dequeues any source units add through addSource and resets the compiler phase to initialization.
public  CompileUnitgetAST()
     Returns the CompileUnit that roots our AST.
public  ClassNodegetClassNode(String name)
     Convenience routine to get the named ClassNode.
public  MapgetClassSourcesByPublicClassName()
    
public  ListgetClasses()
     Get the GroovyClasses generated by compile().
public  ClassNodegetFirstClassNode()
     Convenience routine to get the first ClassNode, for when you are sure there is only one.
public  MapgetSummariesByPublicClassName()
    
public  MapgetSummariesBySourceName()
    
public  booleanisPublicClass(String className)
    
public  Iteratoriterator()
     Returns an iterator on the unit's SourceUnits.
protected  voidmark()
     Updates the phase marker on all sources.
public  voidsetClassgenCallback(ClassgenCallback visitor)
     Sets a ClassgenCallback.
public  voidsetProgressCallback(ProgressCallback callback)
     Sets a ProgressCallback.

Field Detail
ast
protected CompileUnit ast(Code)



classSourcesByPublicClassName
protected Map classSourcesByPublicClassName(Code)



classgenCallback
protected ClassgenCallback classgenCallback(Code)



configured
protected boolean configured(Code)



debug
protected boolean debug(Code)



generatedClasses
protected ArrayList generatedClasses(Code)



names
protected ArrayList names(Code)



phaseOperations
LinkedList[] phaseOperations(Code)



progressCallback
protected ProgressCallback progressCallback(Code)



queuedSources
protected LinkedList queuedSources(Code)



resolveVisitor
protected ResolveVisitor resolveVisitor(Code)



sources
protected HashMap sources(Code)



summariesByPublicClassName
protected Map summariesByPublicClassName(Code)



summariesBySourceName
protected Map summariesBySourceName(Code)



verifier
protected Verifier verifier(Code)




Constructor Detail
CompilationUnit
public CompilationUnit()(Code)
Initializes the CompilationUnit with defaults.



CompilationUnit
public CompilationUnit(GroovyClassLoader loader)(Code)
Initializes the CompilationUnit with defaults except for class loader.



CompilationUnit
public CompilationUnit(CompilerConfiguration configuration)(Code)
Initializes the CompilationUnit with no security considerations.



CompilationUnit
public CompilationUnit(CompilerConfiguration configuration, CodeSource security, GroovyClassLoader loader)(Code)
Initializes the CompilationUnit with a CodeSource for controlling security stuff and a class loader for loading classes.




Method Detail
addClassNode
public void addClassNode(ClassNode node)(Code)
Adds a ClassNode directly to the unit (ie. without source). WARNING: the source is needed for error reporting, using this method without setting a SourceUnit will cause NullPinterExceptions



addPhaseOperation
public void addPhaseOperation(SourceUnitOperation op, int phase)(Code)



addPhaseOperation
public void addPhaseOperation(PrimaryClassNodeOperation op, int phase)(Code)



addPhaseOperation
public void addPhaseOperation(GroovyClassOperation op)(Code)



addSource
public SourceUnit addSource(File file)(Code)
Adds a source file to the unit.



addSource
public SourceUnit addSource(URL url)(Code)
Adds a source file to the unit.



addSource
public SourceUnit addSource(String name, InputStream stream)(Code)
Adds a InputStream source to the unit.



addSource
public SourceUnit addSource(SourceUnit source)(Code)
Adds a SourceUnit to the unit.



addSources
public void addSources(String[] paths)(Code)
Adds a set of file paths to the unit.



addSources
public void addSources(File[] files)(Code)
Adds a set of source files to the unit.



applyToGeneratedGroovyClasses
public void applyToGeneratedGroovyClasses(GroovyClassOperation body) throws CompilationFailedException(Code)



applyToPrimaryClassNodes
public void applyToPrimaryClassNodes(PrimaryClassNodeOperation body) throws CompilationFailedException(Code)
A loop driver for applying operations to all primary ClassNodes in our AST. Automatically skips units that have already been processed through the current phase.



applyToSourceUnits
public void applyToSourceUnits(SourceUnitOperation body) throws CompilationFailedException(Code)
A loop driver for applying operations to all SourceUnits. Automatically skips units that have already been processed through the current phase.



compile
public void compile() throws CompilationFailedException(Code)
Synonym for compile(Phases.ALL).



compile
public void compile(int throughPhase) throws CompilationFailedException(Code)
Compiles the compilation unit from sources.



configure
public void configure(CompilerConfiguration configuration)(Code)
Configures its debugging mode and classloader classpath from a given compiler configuration. This cannot be done more than once due to limitations in java.net.URLClassLoader URLClassLoader .



createClassVisitor
protected ClassVisitor createClassVisitor()(Code)



dequeued
protected boolean dequeued() throws CompilationFailedException(Code)
Dequeues any source units add through addSource and resets the compiler phase to initialization. Note: this does not mean a file is recompiled. If a SoucreUnit has already passed a phase it is skipped until a higher phase is reached. TODO
throws:
  CompilationFailedException -



getAST
public CompileUnit getAST()(Code)
Returns the CompileUnit that roots our AST.



getClassNode
public ClassNode getClassNode(String name)(Code)
Convenience routine to get the named ClassNode.



getClassSourcesByPublicClassName
public Map getClassSourcesByPublicClassName()(Code)



getClasses
public List getClasses()(Code)
Get the GroovyClasses generated by compile().



getFirstClassNode
public ClassNode getFirstClassNode()(Code)
Convenience routine to get the first ClassNode, for when you are sure there is only one.



getSummariesByPublicClassName
public Map getSummariesByPublicClassName()(Code)



getSummariesBySourceName
public Map getSummariesBySourceName()(Code)
Get the source summaries



isPublicClass
public boolean isPublicClass(String className)(Code)



iterator
public Iterator iterator()(Code)
Returns an iterator on the unit's SourceUnits.



mark
protected void mark() throws CompilationFailedException(Code)
Updates the phase marker on all sources.



setClassgenCallback
public void setClassgenCallback(ClassgenCallback visitor)(Code)
Sets a ClassgenCallback. You can have only one, and setting it to null removes any existing setting.



setProgressCallback
public void setProgressCallback(ProgressCallback callback)(Code)
Sets a ProgressCallback. You can have only one, and setting it to null removes any existing setting.



Fields inherited from org.codehaus.groovy.control.ProcessingUnit
protected GroovyClassLoader classLoader(Code)(Java Doc)
protected CompilerConfiguration configuration(Code)(Java Doc)
protected ErrorCollector errorCollector(Code)(Java Doc)
protected int phase(Code)(Java Doc)
protected boolean phaseComplete(Code)(Java Doc)

Methods inherited from org.codehaus.groovy.control.ProcessingUnit
public void completePhase() throws CompilationFailedException(Code)(Java Doc)
public void configure(CompilerConfiguration configuration)(Code)(Java Doc)
public GroovyClassLoader getClassLoader()(Code)(Java Doc)
public CompilerConfiguration getConfiguration()(Code)(Java Doc)
public ErrorCollector getErrorCollector()(Code)(Java Doc)
public int getPhase()(Code)(Java Doc)
public String getPhaseDescription()(Code)(Java Doc)
public void gotoPhase(int phase) throws CompilationFailedException(Code)(Java Doc)
public void nextPhase() throws CompilationFailedException(Code)(Java Doc)
public void setClassLoader(GroovyClassLoader loader)(Code)(Java Doc)
public void setConfiguration(CompilerConfiguration configuration)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.