org.aspectj.ajde.core.internal
Class OutputLocationAdapter

java.lang.Object
  extended by org.aspectj.ajde.core.internal.OutputLocationAdapter
All Implemented Interfaces:
CompilationResultDestinationManager

public class OutputLocationAdapter
extends java.lang.Object
implements CompilationResultDestinationManager

Enables the output locations detailed by the IOutputLocationManager implementation to be related to the comipler/weaver.


Field Summary
 
Fields inherited from interface org.aspectj.ajdt.internal.compiler.CompilationResultDestinationManager
FILETYPE_CLASS, FILETYPE_OUTJAR, FILETYPE_RESOURCE, FILETYPE_UNKNOWN
 
Constructor Summary
OutputLocationAdapter(IOutputLocationManager mgr)
           
 
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()
          Return a map from fully qualified jar/dir entries to handle components.
 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)
          Return the source folder where this source file came from, relative to the project root.
 void reportFileRemove(java.lang.String outputfile, int filetype)
          Report that a class file is being deleted from the specified location.
 void reportFileWrite(java.lang.String outputfile, int filetype)
          Report that a class file is being written to the specified location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutputLocationAdapter

public OutputLocationAdapter(IOutputLocationManager mgr)
Method Detail

getOutputLocationForClass

public java.io.File getOutputLocationForClass(java.io.File compilationUnit)
Description copied from interface: CompilationResultDestinationManager
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 CompilationResultDestinationManager
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

getSourceFolderForFile

public java.lang.String getSourceFolderForFile(java.io.File sourceFile)
Description copied from interface: CompilationResultDestinationManager
Return the source folder where this source file came from, relative to the project root. For example 'src' or 'src/main/java' or 'src/test/java'

Specified by:
getSourceFolderForFile in interface CompilationResultDestinationManager
Parameters:
sourceFile - the file for which the source folder should be determined
Returns:
the source folder

getOutputLocationForResource

public java.io.File getOutputLocationForResource(java.io.File resource)
Description copied from interface: CompilationResultDestinationManager
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 CompilationResultDestinationManager
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: CompilationResultDestinationManager
Return a list of all output locations handled by this OutputLocationManager

Specified by:
getAllOutputLocations in interface CompilationResultDestinationManager

getDefaultOutputLocation

public java.io.File getDefaultOutputLocation()
Description copied from interface: CompilationResultDestinationManager
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 CompilationResultDestinationManager

reportFileWrite

public void reportFileWrite(java.lang.String outputfile,
                            int filetype)
Description copied from interface: CompilationResultDestinationManager
Report that a class file is being written to the specified location.

Specified by:
reportFileWrite in interface CompilationResultDestinationManager
Parameters:
outputfile - the output file (including .class suffix)

reportFileRemove

public void reportFileRemove(java.lang.String outputfile,
                             int filetype)
Description copied from interface: CompilationResultDestinationManager
Report that a class file is being deleted from the specified location.

Specified by:
reportFileRemove in interface CompilationResultDestinationManager
Parameters:
outputfile - the output file (including .class suffix)

discoverChangesSince

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

getInpathMap

public java.util.Map getInpathMap()
Return a map from fully qualified jar/dir entries to handle components.

Specified by:
getInpathMap in interface CompilationResultDestinationManager
Returns:
a map from inpath entries (jars/dirs) to handle components.