org.aspectj.ajde.core
Class AjCompiler

java.lang.Object
  extended by org.aspectj.ajde.core.AjCompiler

public class AjCompiler
extends java.lang.Object

The class to be used by tools to drive a build. An AjCompiler is created with a unique id (for example the absolute pathname of a project or .lst file) along with implementations of ICompilerConfiguration, IBuildProgressMonitor and IBuildMessageHandler. Tools then call build() or buildFresh() on this AjCompiler.

An AjCompiler is associated with one id, therefore a new one needs to be created for a new id (project, .lst file etc.). It is the responsibility of the tools to manage the lifecycle of the AjCompiler's.


Constructor Summary
AjCompiler(java.lang.String compilerId, ICompilerConfiguration compilerConfig, IBuildProgressMonitor buildProgressMonitor, IBuildMessageHandler buildMessageHandler)
          Creates a new AjCompiler for the given id, ICompilerConfiguration, IBuildProgressMonitor and IBuildMessageHandler.
 
Method Summary
 boolean addDependencies(java.io.File file, java.lang.String[] typeNameDependencies)
           
 void build()
          Perform an incremental build if possible, otherwise it will default to a full build.
 void buildFresh()
          Perform a full build.
 void clearLastState()
          Clear the incremental state associated with this AjCompiler from the IncrementalStateManager.
 AjdeCoreBuildManager getBuildManager()
           
 IBuildProgressMonitor getBuildProgressMonitor()
           
 ICompilerConfiguration getCompilerConfiguration()
           
 java.lang.Object getCustomMungerFactory()
           
 java.lang.String getId()
           
 IBuildMessageHandler getMessageHandler()
           
 AsmManager getModel()
           
 boolean isJava6Compatible()
           
 void setCustomMungerFactory(java.lang.Object factory)
          Set a CustomMungerFactory to the compiler's weaver The type of factory should be org.aspectj.weaver.CustomMungerFactory but due to dependency problem of project ajde.core, it is Object for now.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AjCompiler

public AjCompiler(java.lang.String compilerId,
                  ICompilerConfiguration compilerConfig,
                  IBuildProgressMonitor buildProgressMonitor,
                  IBuildMessageHandler buildMessageHandler)
Creates a new AjCompiler for the given id, ICompilerConfiguration, IBuildProgressMonitor and IBuildMessageHandler. None of the arguments can be null.

Parameters:
compilerId - - Unique String used to identify this AjCompiler
compilerConfig - - ICompilerConfiguration implementation
buildProgressMonitor - - IBuildProgressMonitor implementation
buildMessageHandler - - IBuildMessageHandler implementation
Method Detail

getId

public java.lang.String getId()
Returns:
the id for this AjCompiler

getCompilerConfiguration

public ICompilerConfiguration getCompilerConfiguration()
Returns:
the ICompilerConfiguration associated with this AjCompiler

getBuildProgressMonitor

public IBuildProgressMonitor getBuildProgressMonitor()
Returns:
the IBuildProgressMonitor associated with this AjCompiler

getMessageHandler

public IBuildMessageHandler getMessageHandler()
Returns:
the IBuildMessageHandler associated with this AjCompiler

build

public void build()
Perform an incremental build if possible, otherwise it will default to a full build.


buildFresh

public void buildFresh()
Perform a full build.


clearLastState

public void clearLastState()
Clear the incremental state associated with this AjCompiler from the IncrementalStateManager. This is necessary until AjState is reworked and there's an AjState associated with an AjCompiler rather than requiring a map of them. If the environment is not cleaned up then jar locks may be kept.


addDependencies

public boolean addDependencies(java.io.File file,
                               java.lang.String[] typeNameDependencies)

isJava6Compatible

public boolean isJava6Compatible()
Returns:
true if the underlying version of the compiler is compatible with Java 6, returns false otherwise.

setCustomMungerFactory

public void setCustomMungerFactory(java.lang.Object factory)
Set a CustomMungerFactory to the compiler's weaver The type of factory should be org.aspectj.weaver.CustomMungerFactory but due to dependency problem of project ajde.core, it is Object for now.

Parameters:
factory -

getCustomMungerFactory

public java.lang.Object getCustomMungerFactory()
Returns:
the CustomMungerFactory from the compiler's weaver The return type should be org.aspectj.weaver.CustomMungerFactory but due to dependency problem of project ajde.core, it is Object for now.

getModel

public AsmManager getModel()

getBuildManager

public AjdeCoreBuildManager getBuildManager()