| java.lang.Object org.apache.harmony.rmi.common.JavaCompiler org.apache.harmony.rmi.common.MethodJavaCompiler
All known Subclasses: org.apache.harmony.rmi.common.EclipseJavaCompiler,
MethodJavaCompiler | public class MethodJavaCompiler extends JavaCompiler (Code) | | This class represents a Java Compiler executed with a simple Java call.
The class provides multiple constructors to allow flexible specification
of what class and method must be used.
author: Vasily Zakharov version: $Revision: 1.1.2.3 $ |
Method Summary | |
protected static Class | getClass(String className, ClassLoader classLoader) Loads the specified class with the specified class loader.
Wraps the possible exceptions to
JavaCompilerException .
Parameters: className - Name of the class to get. Parameters: classLoader - Class loader to use to instantiate the specified class.Can be null , in this casethe default class loader is used. | protected static ClassLoader | getClassLoaderFromJarFile(File jar) Tries to create a class loader for the specified JAR file.
Parameters: jar - Jar file to create class loader for. | protected static Method | getMethod(Class c, String methodName) Returns the specified compiler method for the specified class.
Wraps the possible exceptions to
JavaCompilerException .
Parameters: c - Class to get method for. Parameters: methodName - Name of the method to get. | protected static Method | getMethod(Class c, String methodName, Class[] methodSignature) Returns the specified method for the specified class.
Wraps the possible exceptions to
JavaCompilerException .
Parameters: c - Class to get method for. Parameters: methodName - Name of the method to get. Parameters: methodSignature - Signature of the method to get. | protected int | run(String[] args) Runs the compilation process with the specified arguments.
Parameters: args - Full arguments list. |
COMPILER_METHOD_SIGNATURE | final protected static Class[] COMPILER_METHOD_SIGNATURE(Code) | | Compiler method signature.
|
DEFAULT_COMPILER_METHOD | final public static String DEFAULT_COMPILER_METHOD(Code) | | Default name of a method to call in a compiler class.
|
compilerInstance | protected Object compilerInstance(Code) | | Compiler instance.
|
compilerMethod | protected Method compilerMethod(Code) | | Compiler method.
|
MethodJavaCompiler | protected MethodJavaCompiler()(Code) | | Creates uninitialized instance of this class.
Note that using this constructor in most cases
requires overriding
MethodJavaCompiler.run(String[]) method.
|
MethodJavaCompiler | public MethodJavaCompiler(String className, ClassLoader classLoader, String methodName) throws JavaCompilerException(Code) | | Configures this class to use the specified class
(loaded by the specified class loader) and method to compile.
Equivalent to
MethodJavaCompiler.MethodJavaCompiler(Class,String)MethodJavaCompiler(Class.forName(className, true, classLoader),methodName) .
Parameters: className - Name of the compiler class to use. Parameters: classLoader - Class loader to use to instantiate the specified class.Can be null , in this casethe default class loader is used. Parameters: methodName - Name of the method to use.Can be null , in this case theis used. throws: JavaCompilerException - If error occurs while finding or loadingthe compiler class or method. |
MethodJavaCompiler | public MethodJavaCompiler(Class c, String methodName) throws JavaCompilerException(Code) | | Configures this class to use the specified class and method to compile.
Parameters: c - Compiler class to use. Parameters: methodName - Name of the method to use.Can be null , in this case theis used. throws: JavaCompilerException - If error occurs while finding or loadingthe compiler method. |
MethodJavaCompiler | public MethodJavaCompiler(Method method) throws JavaCompilerException(Code) | | Configures this class to use the specified method to compile.
Parameters: method - Compiler method to use. throws: JavaCompilerException - If specified method is an instance method,and the compiler class cannot be instantiated. |
getClass | protected static Class getClass(String className, ClassLoader classLoader) throws JavaCompilerException(Code) | | Loads the specified class with the specified class loader.
Wraps the possible exceptions to
JavaCompilerException .
Parameters: className - Name of the class to get. Parameters: classLoader - Class loader to use to instantiate the specified class.Can be null , in this casethe default class loader is used. The loaded class. throws: JavaCompilerException - If error occurs while trying to load the class. |
getClassLoaderFromJarFile | protected static ClassLoader getClassLoaderFromJarFile(File jar) throws JavaCompilerException(Code) | | Tries to create a class loader for the specified JAR file.
Parameters: jar - Jar file to create class loader for. Class loader for the specified JAR file. throws: JavaCompilerException - If file name parsing failed. |
run | protected int run(String[] args) throws JavaCompilerException(Code) | | Runs the compilation process with the specified arguments.
Parameters: args - Full arguments list. Java Compiler return value.For this particular implementation, always 0 ,unless exception is thrown. throws: JavaCompilerException - If some error occurs during invocation. |
Fields inherited from org.apache.harmony.rmi.common.JavaCompiler | protected String[] compilerOptions(Code)(Java Doc)
|
|
|