Java Doc for Javac.java in  » Byte-Code » Javassist » javassist » compiler » 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 » Byte Code » Javassist » javassist.compiler 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javassist.compiler.Javac

Javac
public class Javac (Code)

Inner Class :public static class CtFieldWithInit extends CtField

Field Summary
 JvstCodeGengen
    
final public static  Stringparam0Name
    
final public static  StringproceedName
    
final public static  StringresultVarName
    
 SymbolTablestable
    

Constructor Summary
public  Javac(CtClass thisClass)
     Constructs a compiler.
public  Javac(Bytecode b, CtClass thisClass)
     Constructs a compiler.

Method Summary
public  CtMembercompile(String src)
     Compiles a method, constructor, or field declaration to a class. A field declaration can declare only one field.

In a method or constructor body, $0, $1, ...

public  BytecodecompileBody(CtBehavior method, String src)
     Compiles a method (or constructor) body.
public  voidcompileExpr(String src)
     Compiles an exression.
public  voidcompileExpr(ASTree e)
     Compiles an exression.
public  voidcompileStmnt(String src)
     Compiles a statement (or a block). recordParams() must be called before invoking this method.

Local variables that are not declared in the compiled source text might not be accessible within that source text.

public  BytecodegetBytecode()
     Returns the produced bytecode.
public static  ASTreeparseExpr(String src, SymbolTable st)
     Parsers an expression.
public  booleanrecordLocalVariables(CodeAttribute ca, int pc)
     Records local variables available at the specified program counter. If the LocalVariableAttribute is not available, this method does not record any local variable.
public  booleanrecordParamNames(CodeAttribute ca, int numOfLocalVars)
     Records parameter names if the LocalVariableAttribute is available. It returns false unless the LocalVariableAttribute is available.
Parameters:
  numOfLocalVars - the number of local variables usedfor storing the parameters.
public  intrecordParams(CtClass[] params, boolean isStatic)
     Makes variables $0 (this), $1, $2, ..., and $args represent method parameters.
public  intrecordParams(String target, CtClass[] params, boolean use0, int varNo, boolean isStatic)
     Makes variables $0, $1, $2, ..., and $args represent method parameters.
public  voidrecordProceed(String target, String method)
     Prepares to use $proceed().
public  voidrecordProceed(ProceedHandler h)
     Prepares to use $proceed().
public  intrecordReturnType(CtClass type, boolean useResultVar)
     Prepares to use cast $r, $w, $_, and $type. $type is made to represent the specified return type. It also enables to write a return statement with a return value for void method.

If the return type is void, ($r) does nothing. The type of $_ is java.lang.Object.
Parameters:
  type - the return type.
Parameters:
  useResultVar - true if $_ is used.

public  voidrecordSpecialProceed(String target, String classname, String methodname, String descriptor)
     Prepares to use $proceed() representing a private/super's method. If the return type of $proceed() is void, null is pushed on the stack.
public  voidrecordStaticProceed(String targetClass, String method)
     Prepares to use $proceed() representing a static method.
public  voidrecordType(CtClass t)
     Prepares to use $type.
public  intrecordVariable(CtClass type, String name)
     Makes the given variable available.
public  voidsetMaxLocals(int max)
     Sets maxLocals to max. This method tells the compiler the local variables that have been allocated for the rest of the code.

Field Detail
gen
JvstCodeGen gen(Code)



param0Name
final public static String param0Name(Code)



proceedName
final public static String proceedName(Code)



resultVarName
final public static String resultVarName(Code)



stable
SymbolTable stable(Code)




Constructor Detail
Javac
public Javac(CtClass thisClass)(Code)
Constructs a compiler.
Parameters:
  thisClass - the class that a compiled method/fieldbelongs to.



Javac
public Javac(Bytecode b, CtClass thisClass)(Code)
Constructs a compiler. The produced bytecode is stored in the Bytecode object specified by b.
Parameters:
  thisClass - the class that a compiled method/fieldbelongs to.




Method Detail
compile
public CtMember compile(String src) throws CompileError(Code)
Compiles a method, constructor, or field declaration to a class. A field declaration can declare only one field.

In a method or constructor body, $0, $1, ... and $_ are not available. a CtMethod, CtConstructor,or CtField object.
See Also:   Javac.recordProceed(String,String)




compileBody
public Bytecode compileBody(CtBehavior method, String src) throws CompileError(Code)
Compiles a method (or constructor) body.



compileExpr
public void compileExpr(String src) throws CompileError(Code)
Compiles an exression. recordParams() must be called before invoking this method.

Local variables are not accessible within the compiled source text. Fields and method parameters ($0, $1, ..) are available if recordParams() have been invoked.




compileExpr
public void compileExpr(ASTree e) throws CompileError(Code)
Compiles an exression. recordParams() must be called before invoking this method.

Local variables are not accessible within the compiled source text. Fields and method parameters ($0, $1, ..) are available if recordParams() have been invoked.




compileStmnt
public void compileStmnt(String src) throws CompileError(Code)
Compiles a statement (or a block). recordParams() must be called before invoking this method.

Local variables that are not declared in the compiled source text might not be accessible within that source text. Fields and method parameters ($0, $1, ..) are available.




getBytecode
public Bytecode getBytecode()(Code)
Returns the produced bytecode.



parseExpr
public static ASTree parseExpr(String src, SymbolTable st) throws CompileError(Code)
Parsers an expression.



recordLocalVariables
public boolean recordLocalVariables(CodeAttribute ca, int pc) throws CompileError(Code)
Records local variables available at the specified program counter. If the LocalVariableAttribute is not available, this method does not record any local variable. It only returns false.
Parameters:
  pc - program counter (>= 0) false if the CodeAttribute does not include aLocalVariableAttribute.



recordParamNames
public boolean recordParamNames(CodeAttribute ca, int numOfLocalVars) throws CompileError(Code)
Records parameter names if the LocalVariableAttribute is available. It returns false unless the LocalVariableAttribute is available.
Parameters:
  numOfLocalVars - the number of local variables usedfor storing the parameters. false if the CodeAttribute does not include aLocalVariableAttribute.



recordParams
public int recordParams(CtClass[] params, boolean isStatic) throws CompileError(Code)
Makes variables $0 (this), $1, $2, ..., and $args represent method parameters. $args represents an array of all the parameters. It also makes $$ available as a parameter list of method call.

This must be called before calling compileStmnt() and compileExpr(). The correct value of isStatic must be recorded before compilation. maxLocals is updated to include $0,...




recordParams
public int recordParams(String target, CtClass[] params, boolean use0, int varNo, boolean isStatic) throws CompileError(Code)
Makes variables $0, $1, $2, ..., and $args represent method parameters. $args represents an array of all the parameters. It also makes $$ available as a parameter list of method call. $0 can represent a local variable other than THIS (variable 0). $class is also made available.

This must be called before calling compileStmnt() and compileExpr(). The correct value of isStatic must be recorded before compilation. maxLocals is updated to include $0,...
Parameters:
  varNo - the register number of $0 (use0 is true)or $1 (otherwise).
Parameters:
  target - the type of $0 (it can be null if use0 is false).It is used as the name of the type representedby $class.
Parameters:
  isStatic - true if the method in which the compiled bytecodeis embedded is static.




recordProceed
public void recordProceed(String target, String method) throws CompileError(Code)
Prepares to use $proceed(). If the return type of $proceed() is void, null is pushed on the stack.
Parameters:
  target - an expression specifying the target object.if null, "this" is the target.
Parameters:
  method - the method name.



recordProceed
public void recordProceed(ProceedHandler h)(Code)
Prepares to use $proceed().



recordReturnType
public int recordReturnType(CtClass type, boolean useResultVar) throws CompileError(Code)
Prepares to use cast $r, $w, $_, and $type. $type is made to represent the specified return type. It also enables to write a return statement with a return value for void method.

If the return type is void, ($r) does nothing. The type of $_ is java.lang.Object.
Parameters:
  type - the return type.
Parameters:
  useResultVar - true if $_ is used. -1 or the variable index assigned to $_.
See Also:   Javac.recordType(CtClass)




recordSpecialProceed
public void recordSpecialProceed(String target, String classname, String methodname, String descriptor) throws CompileError(Code)
Prepares to use $proceed() representing a private/super's method. If the return type of $proceed() is void, null is pushed on the stack. This method is for methods invoked by INVOKESPECIAL.
Parameters:
  target - an expression specifying the target object.if null, "this" is the target.
Parameters:
  classname - the class name declaring the method.
Parameters:
  methodname - the method name.
Parameters:
  descriptor - the method descriptor.



recordStaticProceed
public void recordStaticProceed(String targetClass, String method) throws CompileError(Code)
Prepares to use $proceed() representing a static method. If the return type of $proceed() is void, null is pushed on the stack.
Parameters:
  targetClass - the fully-qualified dot-separated nameof the class declaring the method.
Parameters:
  method - the method name.



recordType
public void recordType(CtClass t)(Code)
Prepares to use $type. Note that recordReturnType() overwrites the value of $type.
Parameters:
  t - the type represented by $type.



recordVariable
public int recordVariable(CtClass type, String name) throws CompileError(Code)
Makes the given variable available.
Parameters:
  type - variable type
Parameters:
  name - variable name



setMaxLocals
public void setMaxLocals(int max)(Code)
Sets maxLocals to max. This method tells the compiler the local variables that have been allocated for the rest of the code. When the compiler needs new local variables, the local variables at the index max, max + 1, ... are assigned.

This method is indirectly called by recordParams.




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.