Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.7.0)

E13403-08

oracle.ide.compiler
Class Compiler

java.lang.Object
  extended by oracle.ide.compiler.Compiler
Direct Known Subclasses:
JCompiler

public abstract class Compiler
extends java.lang.Object

The Compiler interface provides the API to drive the actual build system.


Field Summary
static java.lang.String COMPILER_GENERATE_CLASSES_DESPITE_ERRORS
          Deprecated. The setting of compiler options is an internal process, exposed through the visual UI.
 
Constructor Summary
Compiler()
           
 
Method Summary
abstract  boolean addBuildSystemListener(BuildSystemListener bsl)
          addBuildSystemListener method adds a build system listener instance implementation to the build system, see BuildSystemListener for more information.
abstract  boolean addCopyListener(CopyListener cl)
          addCopyListener method adds a copy listener instance implementation to the build system, see CopyListener for more information.
abstract  boolean clean(Context context, boolean throwOnFailedDelete, java.io.OutputStream outStream, java.io.OutputStream errStream)
          Clean the context (may be workspace or project).
abstract  boolean compile(CompileArguments compileArguments)
          Compile one or more targets using the arguments defined in the CompileArguments object.
abstract  boolean compile(Context context, boolean rebuild, boolean wait)
          Deprecated. Use compile(CompileArguments) instead
abstract  boolean compile(Context context, boolean rebuild, boolean wait, boolean save)
          Deprecated. Use compile(CompileArguments) instead
abstract  boolean compile(Context context, boolean rebuild, boolean wait, java.io.OutputStream outStream, java.io.OutputStream errStream)
          Deprecated. Use compile(CompileArguments) instead
abstract  void compile(Context context, boolean rebuild, PostBuilder postBuild, boolean save)
          Deprecated. Use compile(CompileArguments) instead
static Compiler getCompiler()
          Returns the active Compiler instance.
abstract  LogPage getErrorLog()
           
abstract  LogPage getOutputLog()
          get{Output|Error}Log gets the default compiler output/error log.
abstract  boolean isBusy(Context context)
          Determine if the compiler is already busy with a compilation.
abstract  boolean lock(Context context, boolean wait)
          lock/unlock the context (may be project, workspace, file, ...) and return true if the operation was successful.
abstract  void logOutMsg(java.lang.String msg)
          logOutMsg log a message on the default compiler output log
abstract  boolean removeBuildSystemListener(BuildSystemListener bsl)
          removeBuildSystemListener method removes a build system listener instance implementation from the build system, see BuildSystemListener for more information.
abstract  boolean removeCopyListener(CopyListener cl)
          removeCopyListener method removes a copy listener instance implementation from the build system, see CopyListener for more information.
static void setCompiler(Compiler compiler)
          Sets the active Compiler instance.
abstract  boolean unlock(Context context)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPILER_GENERATE_CLASSES_DESPITE_ERRORS

@Deprecated
public static final java.lang.String COMPILER_GENERATE_CLASSES_DESPITE_ERRORS
Deprecated. The setting of compiler options is an internal process, exposed through the visual UI.
The name of the context property used to instruct the compiler to generate classes despite errors. The run system uses this property if the user has specified that they want to be able to run/debug their project even if there were compiler errors. The value of the property is a Boolean. Boolean.TRUE means that the compiler should generate classes despite errors.

See Also:
Constant Field Values
Constructor Detail

Compiler

public Compiler()
Method Detail

getCompiler

public static Compiler getCompiler()
Returns the active Compiler instance. This instance is usually created and initialized at startup.


setCompiler

public static void setCompiler(Compiler compiler)
Sets the active Compiler instance. This method is usually called only at startup.


compile

public abstract boolean compile(CompileArguments compileArguments)
Compile one or more targets using the arguments defined in the CompileArguments object.

Parameters:
compileArguments - The arguments that define the compilation, which cannot be null.
Returns:
If CompileArguments.waitForTermination() returns true, this method will return true if the compilation succeeded without errors, false otherwise; if CompileArguments.waitForTermination() returns false, this method will return true if the compilation was successfully started, false otherwise
Throws:
java.lang.IllegalArgumentException - if compileArguments is null or if compileArguments.getContext() return null

compile

@Deprecated
public abstract boolean compile(Context context,
                                           boolean rebuild,
                                           boolean wait,
                                           java.io.OutputStream outStream,
                                           java.io.OutputStream errStream)
Deprecated. Use compile(CompileArguments) instead

compile -- compile the context (may be project, workspace, file, ...) and return true if they are no errors else false. If wait is false, the method will not wait for the compile to terminate and the return value is undefined. Output log information (verbose stuff) is logged to on specified outStream and build system errors/warnings are logged on the specified errStream.

Parameters:
context - -- workspace, project or file to compile
rebuild - -- if true, unconditionally rebuild sources
wait - -- if true, wait for compile to terminate
outStream - -- stream where to log all verbose build system messages
errStream - -- stream where to log all translators errors/warnings
Returns:
true if successful (no translator errors), else false

compile

@Deprecated
public abstract boolean compile(Context context,
                                           boolean rebuild,
                                           boolean wait)
Deprecated. Use compile(CompileArguments) instead

compile -- compile the context (may be project, workspace, file, ...) and return true if they are no errors else false. If wait is false, the method will not wait for the compile to terminate and the return value is undefined.

Parameters:
context - -- workspace, project or file to compile
rebuild - -- if true, unconditionally rebuild sources
wait - -- if true, wait for compile to terminate
Returns:
true if successful (no translator errors), else false

compile

@Deprecated
public abstract boolean compile(Context context,
                                           boolean rebuild,
                                           boolean wait,
                                           boolean save)
Deprecated. Use compile(CompileArguments) instead

compile -- compile the context (may be project, workspace, file, ...) and return true if they are no errors else false. If wait is false, the method will not wait for the compile to terminate and the return value is undefined.

Parameters:
context - -- workspace, project or file to compile
rebuild - -- if true, unconditionally rebuild sources
wait - -- if true, wait for compile to terminate
save - -- if true, will save files before compiling if the IDE setting is enabled; if false, will never save files, regardless of the IDE setting. The compile method without the save parameter will never save files.
Returns:
true if successful (no translator errors), else false

compile

@Deprecated
public abstract void compile(Context context,
                                        boolean rebuild,
                                        PostBuilder postBuild,
                                        boolean save)
Deprecated. Use compile(CompileArguments) instead

compile -- compile the context (may be project, workspace, file, ...) on a background thread and call the specified worker object once compilation is completed with build successful or not as the postBuild method input parameter.

Parameters:
context - -- workspace, project or file to compile
rebuild - -- if true, unconditionally rebuild sources
postBuild - --method postBuild will be called once the build is completed
save - -- if true, will save files before compiling if the IDE setting is enabled; if false, will never save files, regardless of the IDE setting. The compile method without the save parameter will never save files.

clean

public abstract boolean clean(Context context,
                              boolean throwOnFailedDelete,
                              java.io.OutputStream outStream,
                              java.io.OutputStream errStream)
                       throws java.io.IOException
Clean the context (may be workspace or project). Cleaning is done in an auto-safe manner, meaning the cleaning will not require any user interaction, and if anything element is unclear or ambiguous, such as trying to clean the directory 'classes', and there is no directory 'classes' but there IS a file called 'classes', the cleaning of that element is skipped.

Parameters:
context - -- workspace or project to clean
throwOnFailedDelete - -- if true, throw an IOException if delete on any file or directory fails
outStream - -- stream where to log any verbose system message; if null, stdout will be used
errStream - -- stream where to log any error/warning; if null, stderr will be used
Returns:
true if the context was cleaned, false otherwise
Throws:
java.io.IOException - if throwOnDeleteFailure is true and delete on any file or directory fails

isBusy

public abstract boolean isBusy(Context context)
Determine if the compiler is already busy with a compilation.

Parameters:
context - -- workspace, project or file
Returns:
true if the compiler is busy with a compilation, false otherwise.

lock

public abstract boolean lock(Context context,
                             boolean wait)
lock/unlock the context (may be project, workspace, file, ...) and return true if the operation was successful. If wait is false, the method will not wait for the context to be locked and return false if the context can't be lock else if wait is true, the context compilation will complete before returning true

Parameters:
context - -- workspace, project or file to lock/unlock
wait - -- if true, wait for compilation to terminate
Returns:
true if successful else false

unlock

public abstract boolean unlock(Context context)

addBuildSystemListener

public abstract boolean addBuildSystemListener(BuildSystemListener bsl)
addBuildSystemListener method adds a build system listener instance implementation to the build system, see BuildSystemListener for more information.

Parameters:
bsl - build system listener to add
Returns:
true if properly added, false if the specified bsl is already been added before

removeBuildSystemListener

public abstract boolean removeBuildSystemListener(BuildSystemListener bsl)
removeBuildSystemListener method removes a build system listener instance implementation from the build system, see BuildSystemListener for more information.

Parameters:
bsl - build system listener to remove
Returns:
true if properly removed, false if the specified bsl is not found

addCopyListener

public abstract boolean addCopyListener(CopyListener cl)
addCopyListener method adds a copy listener instance implementation to the build system, see CopyListener for more information.

Parameters:
cl - copy listener to add
Returns:
true if properly added, false if the specified cl is already been added before

removeCopyListener

public abstract boolean removeCopyListener(CopyListener cl)
removeCopyListener method removes a copy listener instance implementation from the build system, see CopyListener for more information.

Parameters:
cl - copy listener to remove
Returns:
true if properly removed, false if the specified cl is not found

getOutputLog

public abstract LogPage getOutputLog()
get{Output|Error}Log gets the default compiler output/error log.

Returns:
the default LogPage

getErrorLog

public abstract LogPage getErrorLog()

logOutMsg

public abstract void logOutMsg(java.lang.String msg)
logOutMsg log a message on the default compiler output log

Parameters:
msg - -- msg to print on the log

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.7.0)

E13403-08

Copyright © 1997, 2013, Oracle. All rights reserved.