Java Doc for UnitCompiler.java in  » Scripting » jacl » org » codehaus » janino » 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 » jacl » org.codehaus.janino 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.codehaus.janino.UnitCompiler

UnitCompiler
public class UnitCompiler (Code)
This class actually implements the JavaTM compiler. It is associated with exactly one compilation unit which it compiles.

Inner Class :public interface ErrorHandler
Inner Class :public static class SimpleIField extends IClass.IField

Field Summary
final public  Java.CompilationUnitcompilationUnit
    

Constructor Summary
public  UnitCompiler(Java.CompilationUnit compilationUnit, IClassLoader iClassLoader)
    

Method Summary
 voidassignSyntheticParametersToSyntheticFields(Java.ConstructorDeclarator cd)
     Copies the values of the synthetic parameters of this constructor ("this$..." and "val$...") to the synthetic fields of the object ("this$..." and "val$...").
public  voidcompile2(Java.PackageMemberTypeDeclaration pmtd)
    
public  voidcompile2(Java.ClassDeclaration cd)
    
public  voidcompile2(Java.AnonymousClassDeclaration acd)
    
public  voidcompile2(Java.LocalClassDeclaration lcd)
    
public  voidcompile2(Java.MemberClassDeclaration mcd)
    
public  voidcompile2(Java.InterfaceDeclaration id)
    
public  ClassFile[]compileUnit(EnumeratorSet debuggingInformation)
     Generates an array of ClassFile objects which represent the classes and interfaces defined in the compilation unit.
public  IClassfindClass(String className)
     Find one class or interface by name.
Parameters:
  className - Fully qualified class name, e.g.
public  IClass.IMethodfindIMethod(Java.MethodInvocation mi)
     Find named methods of "targetType", examine the argument types and choose the most specific method.
public  IClass.IMethodfindIMethod(Java.SuperclassMethodInvocation scmi)
    
public  IClass.IInvocablefindMostSpecificIInvocable(Java.Located located, IClass.IInvocable[] iInvocables, IClass[] argumentTypes)
     Choose the most specific invocable.
public  booleangeneratesCode2(Java.BlockStatement bs)
    
public  booleangeneratesCode2(Java.EmptyStatement es)
    
public  booleangeneratesCode2(Java.LocalClassDeclarationStatement lcds)
    
public  booleangeneratesCode2(Java.Initializer i)
    
public  booleangeneratesCode2(Java.Block b)
    
public  booleangeneratesCode2(Java.FieldDeclaration fd)
    
final public  ObjectgetConstantValue(Java.Rvalue rv)
     Attempts to evaluate as a constant expression.
 IClass.IField[]getIFields(Java.FieldDeclaration fd)
    
public  voidgetIMethods(IClass type, String methodName, List v)
     Add all methods with the given methodName that are declared by the type, its superclasses and all their superinterfaces to the result list v.
public  Java.LocalVariablegetLocalVariable(Java.LocalVariableDeclarationStatement lvds, Java.VariableDeclarator vd)
    
public  Java.LocalVariablegetLocalVariable(Java.FunctionDeclarator.FormalParameter fp)
    
 Java.ArrayInitializerOrRvaluegetNonConstantFinalInitializer(Java.FieldDeclaration fd, Java.VariableDeclarator vd)
     Determine the non-constant-final initializer of the given Java.VariableDeclarator .
static  Java.TypeDeclarationgetOuterClass(Java.TypeDeclaration atd)
    
public  CodeContext.OffsetgetWhereToBreak(Java.BreakableStatement bs)
    
static  intilfd(IClass t)
    
static  intilfd(IClass t, int opcodeInt, int opcodeLong, int opcodeFloat, int opcodeDouble)
    
static  intilfdabcs(IClass t)
    
public  IClassimportTypeOnDemand(String simpleTypeName, Location location)
     6.5.2.BL1.B1.B5, 6.5.2.BL1.B1.B6 Type-import-on-demand.
6.5.5.1.6 Type-import-on-demand declaration.
 voidinitializeInstanceVariablesAndInvokeInstanceInitializers(Java.ConstructorDeclarator cd)
     Compiles the instance variable initializers and the instance initializers in their lexical order.
 Java.LocalVariableisIntLV(Java.Crement c)
     Checks whether the operand is an integer-like local variable.
public  voidleave2(Java.BlockStatement bs, IClass optionalStackValueType)
    
public  voidleave2(Java.SynchronizedStatement ss, IClass optionalStackValueType)
    
public  voidleave2(Java.TryStatement ts, IClass optionalStackValueType)
    
public  voidsetCompileErrorHandler(ErrorHandler optionalCompileErrorHandler)
     By default, CompileException s are thrown on compile errors, but an application my install its own (thread-local) ErrorHandler .

Be aware that a single problem during compilation often causes a bunch of compile errors, so a good ErrorHandler counts errors and throws a CompileException when a limit is reached.

If the given ErrorHandler does not throw CompileException s, then UnitCompiler.compileUnit(EnumeratorSet) will throw one when the compilation of the unit is finished, and errors had occurred.

public  voidsetWarningHandler(WarningHandler optionalWarningHandler)
     By default, warnings are discarded, but an application my install a custom WarningHandler .
 IClass.IConstructortoIConstructor(Java.ConstructorDeclarator cd)
    
public  IClass.IMethodtoIMethod(Java.MethodDeclarator md)
    
final public  Java.LvaluetoLvalueOrCE(Java.Atom a)
    

Field Detail
compilationUnit
final public Java.CompilationUnit compilationUnit(Code)




Constructor Detail
UnitCompiler
public UnitCompiler(Java.CompilationUnit compilationUnit, IClassLoader iClassLoader)(Code)




Method Detail
assignSyntheticParametersToSyntheticFields
void assignSyntheticParametersToSyntheticFields(Java.ConstructorDeclarator cd) throws CompileException(Code)
Copies the values of the synthetic parameters of this constructor ("this$..." and "val$...") to the synthetic fields of the object ("this$..." and "val$...").



compile2
public void compile2(Java.PackageMemberTypeDeclaration pmtd) throws CompileException(Code)



compile2
public void compile2(Java.ClassDeclaration cd) throws CompileException(Code)



compile2
public void compile2(Java.AnonymousClassDeclaration acd) throws CompileException(Code)



compile2
public void compile2(Java.LocalClassDeclaration lcd) throws CompileException(Code)



compile2
public void compile2(Java.MemberClassDeclaration mcd) throws CompileException(Code)



compile2
public void compile2(Java.InterfaceDeclaration id) throws CompileException(Code)



compileUnit
public ClassFile[] compileUnit(EnumeratorSet debuggingInformation) throws CompileException(Code)
Generates an array of ClassFile objects which represent the classes and interfaces defined in the compilation unit.



findClass
public IClass findClass(String className)(Code)
Find one class or interface by name.
Parameters:
  className - Fully qualified class name, e.g. "pkg1.pkg2.Outer$Inner". null if a class with that name is not declared in this compilation unit



findIMethod
public IClass.IMethod findIMethod(Java.MethodInvocation mi) throws CompileException(Code)
Find named methods of "targetType", examine the argument types and choose the most specific method. Check that only the allowed exceptions are thrown.

Notice that the returned IClass.IMethod may be declared in an enclosing type. The selected IClass.IMethod or null




findIMethod
public IClass.IMethod findIMethod(Java.SuperclassMethodInvocation scmi) throws CompileException(Code)



findMostSpecificIInvocable
public IClass.IInvocable findMostSpecificIInvocable(Java.Located located, IClass.IInvocable[] iInvocables, IClass[] argumentTypes) throws CompileException(Code)
Choose the most specific invocable.
Parameters:
  iInvocables - Length must be greater than zero
throws:
  CompileException -



generatesCode2
public boolean generatesCode2(Java.BlockStatement bs)(Code)



generatesCode2
public boolean generatesCode2(Java.EmptyStatement es)(Code)



generatesCode2
public boolean generatesCode2(Java.LocalClassDeclarationStatement lcds)(Code)



generatesCode2
public boolean generatesCode2(Java.Initializer i) throws CompileException(Code)



generatesCode2
public boolean generatesCode2(Java.Block b) throws CompileException(Code)



generatesCode2
public boolean generatesCode2(Java.FieldDeclaration fd) throws CompileException(Code)



getConstantValue
final public Object getConstantValue(Java.Rvalue rv) throws CompileException(Code)
Attempts to evaluate as a constant expression.

Expression typeReturn value type
StringString
byteByte
shortChort
intInteger
booleanBoolean
charCharacter
floatFloat
longLong
doubleDouble
null Java.Rvalue.CONSTANT_VALUE_NULL




getIFields
IClass.IField[] getIFields(Java.FieldDeclaration fd)(Code)



getIMethods
public void getIMethods(IClass type, String methodName, List v) throws CompileException(Code)
Add all methods with the given methodName that are declared by the type, its superclasses and all their superinterfaces to the result list v.
Parameters:
  type -
Parameters:
  methodName -
Parameters:
  v -
throws:
  CompileException -



getLocalVariable
public Java.LocalVariable getLocalVariable(Java.LocalVariableDeclarationStatement lvds, Java.VariableDeclarator vd) throws CompileException(Code)



getLocalVariable
public Java.LocalVariable getLocalVariable(Java.FunctionDeclarator.FormalParameter fp) throws CompileException(Code)



getNonConstantFinalInitializer
Java.ArrayInitializerOrRvalue getNonConstantFinalInitializer(Java.FieldDeclaration fd, Java.VariableDeclarator vd) throws CompileException(Code)
Determine the non-constant-final initializer of the given Java.VariableDeclarator . null if the variable is declared without an initializer or if the initializer is constant-final



getOuterClass
static Java.TypeDeclaration getOuterClass(Java.TypeDeclaration atd)(Code)



getWhereToBreak
public CodeContext.Offset getWhereToBreak(Java.BreakableStatement bs)(Code)



ilfd
static int ilfd(IClass t)(Code)



ilfd
static int ilfd(IClass t, int opcodeInt, int opcodeLong, int opcodeFloat, int opcodeDouble)(Code)



ilfdabcs
static int ilfdabcs(IClass t)(Code)



importTypeOnDemand
public IClass importTypeOnDemand(String simpleTypeName, Location location) throws CompileException(Code)
6.5.2.BL1.B1.B5, 6.5.2.BL1.B1.B6 Type-import-on-demand.
6.5.5.1.6 Type-import-on-demand declaration. null if the given simpleTypeName cannot be resolved through any of the import-on-demand directives



initializeInstanceVariablesAndInvokeInstanceInitializers
void initializeInstanceVariablesAndInvokeInstanceInitializers(Java.ConstructorDeclarator cd) throws CompileException(Code)
Compiles the instance variable initializers and the instance initializers in their lexical order.



isIntLV
Java.LocalVariable isIntLV(Java.Crement c) throws CompileException(Code)
Checks whether the operand is an integer-like local variable.



leave2
public void leave2(Java.BlockStatement bs, IClass optionalStackValueType)(Code)



leave2
public void leave2(Java.SynchronizedStatement ss, IClass optionalStackValueType)(Code)



leave2
public void leave2(Java.TryStatement ts, IClass optionalStackValueType)(Code)



setCompileErrorHandler
public void setCompileErrorHandler(ErrorHandler optionalCompileErrorHandler)(Code)
By default, CompileException s are thrown on compile errors, but an application my install its own (thread-local) ErrorHandler .

Be aware that a single problem during compilation often causes a bunch of compile errors, so a good ErrorHandler counts errors and throws a CompileException when a limit is reached.

If the given ErrorHandler does not throw CompileException s, then UnitCompiler.compileUnit(EnumeratorSet) will throw one when the compilation of the unit is finished, and errors had occurred. In other words: The ErrorHandler may throw a CompileException or not, but UnitCompiler.compileUnit(EnumeratorSet) will definitely throw a CompileException if one or more compile errors have occurred.
Parameters:
  optionalCompileErrorHandler - null to restore the default behavior (throwing a CompileException




setWarningHandler
public void setWarningHandler(WarningHandler optionalWarningHandler)(Code)
By default, warnings are discarded, but an application my install a custom WarningHandler .
Parameters:
  optionalWarningHandler - null to indicate that no warnings be issued



toIConstructor
IClass.IConstructor toIConstructor(Java.ConstructorDeclarator cd)(Code)



toIMethod
public IClass.IMethod toIMethod(Java.MethodDeclarator md)(Code)



toLvalueOrCE
final public Java.Lvalue toLvalueOrCE(Java.Atom a) throws CompileException(Code)



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.