Packages  This Package  Prev  Next  Index  

§1.5 Class Compiler

public  final  class  java.lang.Compiler
    extends  java.lang.Object  (I-§1.12)
{
        // Methods
    public static Object command(Object  any);	§1.5.1
    public static boolean compileClass(Class  clazz);	§1.5.2
    public static boolean compileClasses(String  string);	§1.5.3
    public static void disable();	§1.5.4
    public static void enable();	§1.5.5
}
The Compiler class is provided in support of Java-to-native-code compilers and related services.

When the Java Virtual Machine first starts, it determines if a system property (I-§1.18.9) java.compiler exists. If so, it is assumed to be the name of a library (whose exact location and type is platform-dependent); the loadLibrary method (I-§1.18.13) in class System is called to load that library. If this loading succeeds, the function named java_lang_Compiler_start() in that library is called.

If there is no compiler available, these methods do nothing.


Methods

command

public static Object command(Object any)
The Compiler should examine the argument type and its fields and perform some documented operation. No specific operations are required.
Parameters:
any - an argument
Returns:
a compiler-specific value, or null if no compiler is available.

compileClass

public static boolean compileClass(Class clazz)
The indicated class is compiled.
Parameters:
clazz - a class
Returns:
true if the compilation succeeded; false if the compilation failed or no compiler is available.

compileClasses

public static boolean compileClasses(String string)
Indicates that the application would like the third-party software to compile all classes whose name matches the indicated string.
Parameters:
string - the name of the classes to compile
Returns:
true if the compilation succeeded; false if the compilation failed or no compiler is available.

disable

public static void disable()
Cause the Compiler to cease operation.

enable

public static void enable()
Cause the Compiler to resume operation.

Packages  This Package  Prev  Next  Index
Java API Document (HTML generated by dkramer on April 22, 1996)
Copyright © 1996 Sun Microsystems, Inc. All rights reserved
Please send any comments or corrections to doug.kramer@sun.com