org.aspectj.tools.ajbrowser.core
Class BrowserOutputLocationManager

java.lang.Object
  extended by org.aspectj.tools.ajbrowser.core.BrowserOutputLocationManager
All Implemented Interfaces:
IOutputLocationManager

public class BrowserOutputLocationManager
extends java.lang.Object
implements IOutputLocationManager

IOutputLocationManager which returns the same output location for all files and resources.


Field Summary
 
Fields inherited from interface org.aspectj.ajde.core.IOutputLocationManager
FILETYPE_CLASS, FILETYPE_OUTJAR, FILETYPE_RESOURCE, FILETYPE_UNKNOWN
 
Constructor Summary
BrowserOutputLocationManager(UserPreferencesAdapter preferencesAdapter)
           
 
Method Summary
 int discoverChangesSince(java.io.File dir, long buildtime)
           
 java.util.List getAllOutputLocations()
          Return a list of all output locations handled by this OutputLocationManager
 java.io.File getDefaultOutputLocation()
          Return the default output location (for example, /bin).
 java.util.Map getInpathMap()
           
 java.io.File getOutputLocationForClass(java.io.File compilationUnit)
          Return the directory root under which the results of compiling the given source file.
 java.io.File getOutputLocationForResource(java.io.File resource)
          When copying resources from source folders to output location, return the root directory under which the resource should be copied.
 java.lang.String getSourceFolderForFile(java.io.File sourceFile)
          For environments where multiple source folders are supported, they need to be included in the model.
 void reportFileRemove(java.lang.String outputfile, int filetype)
          Callback from the compiler to indicate that a file has been removed from disk, the type of the file (if known) is also supplied.
 void reportFileWrite(java.lang.String outputfile, int filetype)
          Callback from the compiler to indicate that a file has been written to disk, the type of the file (if known) is also supplied.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BrowserOutputLocationManager

public BrowserOutputLocationManager(UserPreferencesAdapter preferencesAdapter)
Method Detail

getOutputLocationForClass

public java.io.File getOutputLocationForClass(java.io.File compilationUnit)
Description copied from interface: IOutputLocationManager
Return the directory root under which the results of compiling the given source file. For example, if the source file contains the type a.b.C, and this method returns "target/classes" the resulting class file will be written to "target/classes/a/b/C.class"

Specified by:
getOutputLocationForClass in interface IOutputLocationManager
Parameters:
compilationUnit - the compilation unit that has been compiled
Returns:
a File object representing the root directory under which compilation results for this unit should be written

getOutputLocationForResource

public java.io.File getOutputLocationForResource(java.io.File resource)
Description copied from interface: IOutputLocationManager
When copying resources from source folders to output location, return the root directory under which the resource should be copied.

Specified by:
getOutputLocationForResource in interface IOutputLocationManager
Parameters:
resource - the resource to be copied
Returns:
a File object representing the root directory under which this resource should be copied

getAllOutputLocations

public java.util.List getAllOutputLocations()
Description copied from interface: IOutputLocationManager
Return a list of all output locations handled by this OutputLocationManager

Specified by:
getAllOutputLocations in interface IOutputLocationManager

getDefaultOutputLocation

public java.io.File getDefaultOutputLocation()
Description copied from interface: IOutputLocationManager
Return the default output location (for example, /bin). This is where classes which are on the inpath will be placed.

Specified by:
getDefaultOutputLocation in interface IOutputLocationManager

getSourceFolderForFile

public java.lang.String getSourceFolderForFile(java.io.File sourceFile)
Description copied from interface: IOutputLocationManager
For environments where multiple source folders are supported, they need to be included in the model. This method allows AspectJ to determine which source folder a source file came from. Example return values would be "src" or "main/java"

Specified by:
getSourceFolderForFile in interface IOutputLocationManager
Parameters:
sourceFile - the File object for the source file
Returns:
the source folder where this file came from, or null if in project root or source folders not supported.

reportFileWrite

public void reportFileWrite(java.lang.String outputfile,
                            int filetype)
Description copied from interface: IOutputLocationManager
Callback from the compiler to indicate that a file has been written to disk, the type of the file (if known) is also supplied.

Specified by:
reportFileWrite in interface IOutputLocationManager
Parameters:
outputfile - the file that has been written
filetype - the kind of file from the FILETYPE_XXX constants defined in this type

reportFileRemove

public void reportFileRemove(java.lang.String outputfile,
                             int filetype)
Description copied from interface: IOutputLocationManager
Callback from the compiler to indicate that a file has been removed from disk, the type of the file (if known) is also supplied.

Specified by:
reportFileRemove in interface IOutputLocationManager
Parameters:
outputfile - the file that has been written
filetype - the kind of file from the FILETYPE_XXX constants defined in this type

discoverChangesSince

public int discoverChangesSince(java.io.File dir,
                                long buildtime)
Specified by:
discoverChangesSince in interface IOutputLocationManager

getInpathMap

public java.util.Map getInpathMap()
Specified by:
getInpathMap in interface IOutputLocationManager
Returns:
a Map from inpath absolute paths to handle components