org.mozilla.javascript.optimizer
public class ClassCompiler extends Object
| Constructor Summary | |
|---|---|
| ClassCompiler(CompilerEnvirons compilerEnv)
Construct ClassCompiler that uses the specified compiler environment
when generating classes. | |
| Method Summary | |
|---|---|
| Object[] | compileToClassFiles(String source, String sourceLocation, int lineno, String mainClassName)
Compile JavaScript source into one or more Java class files.
|
| CompilerEnvirons | getCompilerEnv()
Get the compiler environment the compiler uses. |
| String | getMainMethodClass()
Get the name of the class for main method implementation. |
| Class | getTargetExtends()
Get the class that the generated target will extend. |
| Class[] | getTargetImplements()
Get the interfaces that the generated target will implement. |
| protected String | makeAuxiliaryClassName(String mainClassName, String auxMarker)
Build class name for a auxiliary class generated by compiler.
|
| void | setMainMethodClass(String className)
Set the class name to use for main method implementation.
|
| void | setTargetExtends(Class extendsClass)
Set the class that the generated target will extend.
|
| void | setTargetImplements(Class[] implementsClasses)
Set the interfaces that the generated target will implement.
|
Returns: array where elements with even indexes specifies class name and the followinf odd index gives class file body as byte[] array. The initial elemnt of the array always holds mainClassName and array[1] holds its byte code.
See Also: setMainMethodClass
Parameters: extendsClass the class it extends
Parameters: implementsClasses an array of Class objects, one for each interface the target will extend